Server: Phase 2 (REVIEW not respected yet)
This commit is contained in:
1 parent
5d16ded553
commit
142b47674d
4271 files changed
+1203269
No files matched your search
+18
@@ -0,0 +1,18 @@
|
||||
import { StructuralSharingOption, ValidateSelected } from './structuralSharing.js';
|
||||
import { AnyRouter, MakeRouteMatch, MakeRouteMatchUnion, RegisteredRouter, StrictOrFrom, ThrowConstraint, ThrowOrOptional } from '@tanstack/router-core';
|
||||
export declare function useStructuralSharing<TRouter extends AnyRouter, TSelected, TStructuralSharing extends boolean, TStoreSlice, TSelectSlice = TStoreSlice>(opts: {
|
||||
select?: (slice: TSelectSlice) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
|
||||
structuralSharing?: boolean;
|
||||
} | undefined, router: TRouter): (slice: TStoreSlice) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
|
||||
export interface UseMatchBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TThrow extends boolean, TSelected, TStructuralSharing extends boolean> {
|
||||
select?: (match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
|
||||
shouldThrow?: TThrow;
|
||||
}
|
||||
export type UseMatchRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean, TThrow extends boolean = true>(opts?: UseMatchBaseOptions<TRouter, TFrom, true, TThrow, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>) => ThrowOrOptional<UseMatchResult<TRouter, TFrom, true, TSelected>, TThrow>;
|
||||
export type UseMatchOptions<TRouter extends AnyRouter, TFrom extends string | undefined, TStrict extends boolean, TThrow extends boolean, TSelected, TStructuralSharing extends boolean> = StrictOrFrom<TRouter, TFrom, TStrict> & UseMatchBaseOptions<TRouter, TFrom, TStrict, TThrow, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>;
|
||||
export type UseMatchResult<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> = unknown extends TSelected ? TStrict extends true ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict> : MakeRouteMatchUnion<TRouter> : TSelected;
|
||||
/**
|
||||
* Read and select the nearest or targeted route match.
|
||||
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchHook
|
||||
*/
|
||||
export declare function useMatch<TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, TStrict extends boolean = true, TThrow extends boolean = true, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts: UseMatchOptions<TRouter, TFrom, TStrict, ThrowConstraint<TStrict, TThrow>, TSelected, TStructuralSharing>): ThrowOrOptional<UseMatchResult<TRouter, TFrom, TStrict, TSelected>, TThrow>;
|
||||
Reference in new issue
Block a user