@tanstack/router-core 0.0.1-beta.174 → 0.0.1-beta.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/route.js.map +1 -1
- package/build/cjs/router.js +57 -36
- package/build/cjs/router.js.map +1 -1
- package/build/esm/index.js +56 -36
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +158 -191
- package/build/types/defer.d.ts +19 -0
- package/build/types/fileRoute.d.ts +35 -0
- package/build/types/history.d.ts +31 -0
- package/build/types/index.d.ts +12 -780
- package/build/types/link.d.ts +92 -0
- package/build/types/path.d.ts +16 -0
- package/build/types/qss.d.ts +2 -0
- package/build/types/route.d.ts +234 -0
- package/build/types/routeInfo.d.ts +22 -0
- package/build/types/router.d.ts +251 -0
- package/build/types/scroll-restoration.d.ts +6 -0
- package/build/types/searchParams.d.ts +5 -0
- package/build/types/utils.d.ts +53 -0
- package/build/umd/index.development.js +57 -36
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +2 -2
- package/build/umd/index.production.js.map +1 -1
- package/package.json +3 -3
- package/src/route.ts +12 -16
- package/src/router.ts +100 -55
package/build/types/index.d.ts
CHANGED
|
@@ -1,782 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @tanstack/router-core/src/index.ts
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) TanStack
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @license MIT
|
|
10
|
-
*/
|
|
11
1
|
export { default as invariant } from 'tiny-invariant';
|
|
12
2
|
export { default as warning } from 'tiny-warning';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
interface ParsedPath {
|
|
27
|
-
href: string;
|
|
28
|
-
pathname: string;
|
|
29
|
-
search: string;
|
|
30
|
-
hash: string;
|
|
31
|
-
}
|
|
32
|
-
interface RouterLocation extends ParsedPath {
|
|
33
|
-
state: any;
|
|
34
|
-
}
|
|
35
|
-
type BlockerFn = (retry: () => void, cancel: () => void) => void;
|
|
36
|
-
declare function createBrowserHistory(opts?: {
|
|
37
|
-
getHref?: () => string;
|
|
38
|
-
createHref?: (path: string) => string;
|
|
39
|
-
}): RouterHistory;
|
|
40
|
-
declare function createHashHistory(): RouterHistory;
|
|
41
|
-
declare function createMemoryHistory(opts?: {
|
|
42
|
-
initialEntries: string[];
|
|
43
|
-
initialIndex?: number;
|
|
44
|
-
}): RouterHistory;
|
|
45
|
-
|
|
46
|
-
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
47
|
-
type IsAny<T, Y, N> = 1 extends 0 & T ? Y : N;
|
|
48
|
-
type IsAnyBoolean<T> = 1 extends 0 & T ? true : false;
|
|
49
|
-
type IsKnown<T, Y, N> = unknown extends T ? N : Y;
|
|
50
|
-
type PickAsRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
51
|
-
type PickAsPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
52
|
-
type PickUnsafe<T, K> = K extends keyof T ? Pick<T, K> : never;
|
|
53
|
-
type PickExtra<T, K> = {
|
|
54
|
-
[TKey in keyof K as string extends TKey ? never : TKey extends keyof T ? never : TKey]: K[TKey];
|
|
55
|
-
};
|
|
56
|
-
type PickRequired<T> = {
|
|
57
|
-
[K in keyof T as undefined extends T[K] ? never : K]: T[K];
|
|
58
|
-
};
|
|
59
|
-
type Expand<T> = T extends object ? T extends infer O ? {
|
|
60
|
-
[K in keyof O]: O[K];
|
|
61
|
-
} : never : T;
|
|
62
|
-
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => any ? I : never;
|
|
63
|
-
type Compute<T> = {
|
|
64
|
-
[K in keyof T]: T[K];
|
|
65
|
-
} | never;
|
|
66
|
-
type AllKeys<T> = T extends any ? keyof T : never;
|
|
67
|
-
type MergeUnion<T, Keys extends keyof T = keyof T> = Compute<{
|
|
68
|
-
[K in Keys]: T[Keys];
|
|
69
|
-
} & {
|
|
70
|
-
[K in AllKeys<T>]?: T extends any ? K extends keyof T ? T[K] : never : never;
|
|
71
|
-
}>;
|
|
72
|
-
type Values<O> = O[ValueKeys<O>];
|
|
73
|
-
type ValueKeys<O> = Extract<keyof O, PropertyKey>;
|
|
74
|
-
type DeepAwaited<T> = T extends Promise<infer A> ? DeepAwaited<A> : T extends Record<infer A, Promise<infer B>> ? {
|
|
75
|
-
[K in A]: DeepAwaited<B>;
|
|
76
|
-
} : T;
|
|
77
|
-
type PathParamMask<TRoutePath extends string> = TRoutePath extends `${infer L}/$${infer C}/${infer R}` ? PathParamMask<`${L}/${string}/${R}`> : TRoutePath extends `${infer L}/$${infer C}` ? PathParamMask<`${L}/${string}`> : TRoutePath;
|
|
78
|
-
type Timeout = ReturnType<typeof setTimeout>;
|
|
79
|
-
type Updater<TPrevious, TResult = TPrevious> = TResult | ((prev?: TPrevious) => TResult);
|
|
80
|
-
type PickExtract<T, U> = {
|
|
81
|
-
[K in keyof T as T[K] extends U ? K : never]: T[K];
|
|
82
|
-
};
|
|
83
|
-
type PickExclude<T, U> = {
|
|
84
|
-
[K in keyof T as T[K] extends U ? never : K]: T[K];
|
|
85
|
-
};
|
|
86
|
-
declare function last<T>(arr: T[]): T | undefined;
|
|
87
|
-
declare function functionalUpdate<TResult>(updater: Updater<TResult>, previous: TResult): TResult;
|
|
88
|
-
declare function pick<T, K extends keyof T>(parent: T, keys: K[]): Pick<T, K>;
|
|
89
|
-
/**
|
|
90
|
-
* This function returns `a` if `b` is deeply equal.
|
|
91
|
-
* If not, it will replace any deeply equal children of `b` with those of `a`.
|
|
92
|
-
* This can be used for structural sharing between immutable JSON values for example.
|
|
93
|
-
* Do not use this with signals
|
|
94
|
-
*/
|
|
95
|
-
declare function replaceEqualDeep<T>(prev: any, _next: T): T;
|
|
96
|
-
declare function isPlainObject(o: any): boolean;
|
|
97
|
-
declare function partialDeepEqual(a: any, b: any): boolean;
|
|
98
|
-
|
|
99
|
-
type ParseRoute<TRouteTree extends AnyRoute> = TRouteTree | ParseRouteChildren<TRouteTree>;
|
|
100
|
-
type ParseRouteChildren<TRouteTree extends AnyRoute> = TRouteTree extends Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, infer TChildren, any> ? unknown extends TChildren ? never : TChildren extends AnyRoute[] ? {
|
|
101
|
-
[TId in TChildren[number]['id'] as string]: ParseRoute<TChildren[number]>;
|
|
102
|
-
}[string] : never : never;
|
|
103
|
-
type RoutesById<TRouteTree extends AnyRoute> = {
|
|
104
|
-
[K in ParseRoute<TRouteTree> as K['id']]: K;
|
|
105
|
-
};
|
|
106
|
-
type RouteById<TRouteTree extends AnyRoute, TId> = Extract<ParseRoute<TRouteTree>, {
|
|
107
|
-
id: TId;
|
|
108
|
-
}>;
|
|
109
|
-
type RouteIds<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree>['id'];
|
|
110
|
-
type RoutesByPath<TRouteTree extends AnyRoute> = {
|
|
111
|
-
[K in ParseRoute<TRouteTree> as K['fullPath']]: K;
|
|
112
|
-
};
|
|
113
|
-
type RouteByPath<TRouteTree extends AnyRoute, TPath> = Extract<ParseRoute<TRouteTree>, {
|
|
114
|
-
fullPath: TPath;
|
|
115
|
-
}>;
|
|
116
|
-
type RoutePaths<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree>['fullPath'] | '/';
|
|
117
|
-
type FullSearchSchema<TRouteTree extends AnyRoute> = MergeUnion<ParseRoute<TRouteTree>['types']['fullSearchSchema']> & {};
|
|
118
|
-
type AllParams<TRouteTree extends AnyRoute> = MergeUnion<ParseRoute<TRouteTree>['types']['allParams']>;
|
|
119
|
-
|
|
120
|
-
declare global {
|
|
121
|
-
interface Window {
|
|
122
|
-
__TSR_DEHYDRATED__?: HydrationCtx;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
interface Register {
|
|
126
|
-
}
|
|
127
|
-
type AnyRouter = Router<any, any>;
|
|
128
|
-
type RegisteredRouter = Register extends {
|
|
129
|
-
router: infer TRouter extends AnyRouter;
|
|
130
|
-
} ? TRouter : AnyRouter;
|
|
131
|
-
interface LocationState {
|
|
132
|
-
}
|
|
133
|
-
interface ParsedLocation<TSearchObj extends AnySearchSchema = {}> {
|
|
134
|
-
href: string;
|
|
135
|
-
pathname: string;
|
|
136
|
-
search: TSearchObj;
|
|
137
|
-
searchStr: string;
|
|
138
|
-
state: LocationState;
|
|
139
|
-
hash: string;
|
|
140
|
-
key?: string;
|
|
141
|
-
}
|
|
142
|
-
interface FromLocation {
|
|
143
|
-
pathname: string;
|
|
144
|
-
search?: unknown;
|
|
145
|
-
key?: string;
|
|
146
|
-
hash?: string;
|
|
147
|
-
}
|
|
148
|
-
type SearchSerializer = (searchObj: Record<string, any>) => string;
|
|
149
|
-
type SearchParser = (searchStr: string) => Record<string, any>;
|
|
150
|
-
type HydrationCtx = {
|
|
151
|
-
router: DehydratedRouter;
|
|
152
|
-
payload: Record<string, any>;
|
|
153
|
-
};
|
|
154
|
-
interface RouteMatch<TRouteTree extends AnyRoute = AnyRoute, TRouteId extends RouteIds<TRouteTree> = ParseRoute<TRouteTree>['id']> {
|
|
155
|
-
id: string;
|
|
156
|
-
key?: string;
|
|
157
|
-
routeId: TRouteId;
|
|
158
|
-
pathname: string;
|
|
159
|
-
params: RouteById<TRouteTree, TRouteId>['types']['allParams'];
|
|
160
|
-
status: 'pending' | 'success' | 'error';
|
|
161
|
-
isFetching: boolean;
|
|
162
|
-
invalid: boolean;
|
|
163
|
-
error: unknown;
|
|
164
|
-
paramsError: unknown;
|
|
165
|
-
searchError: unknown;
|
|
166
|
-
updatedAt: number;
|
|
167
|
-
invalidAt: number;
|
|
168
|
-
preloadInvalidAt: number;
|
|
169
|
-
loaderData: RouteById<TRouteTree, TRouteId>['types']['loader'];
|
|
170
|
-
loadPromise?: Promise<void>;
|
|
171
|
-
__resolveLoadPromise?: () => void;
|
|
172
|
-
routeContext: RouteById<TRouteTree, TRouteId>['types']['routeContext'];
|
|
173
|
-
context: RouteById<TRouteTree, TRouteId>['types']['context'];
|
|
174
|
-
routeSearch: RouteById<TRouteTree, TRouteId>['types']['searchSchema'];
|
|
175
|
-
search: FullSearchSchema<TRouteTree> & RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'];
|
|
176
|
-
fetchedAt: number;
|
|
177
|
-
abortController: AbortController;
|
|
178
|
-
}
|
|
179
|
-
type AnyRouteMatch = RouteMatch<any>;
|
|
180
|
-
type RouterContextOptions<TRouteTree extends AnyRoute> = AnyContext extends TRouteTree['types']['routerContext'] ? {
|
|
181
|
-
context?: TRouteTree['types']['routerContext'];
|
|
182
|
-
} : {
|
|
183
|
-
context: TRouteTree['types']['routerContext'];
|
|
184
|
-
};
|
|
185
|
-
interface RouterOptions<TRouteTree extends AnyRoute, TDehydrated extends Record<string, any>> {
|
|
186
|
-
history?: RouterHistory;
|
|
187
|
-
stringifySearch?: SearchSerializer;
|
|
188
|
-
parseSearch?: SearchParser;
|
|
189
|
-
defaultPreload?: false | 'intent';
|
|
190
|
-
defaultPreloadDelay?: number;
|
|
191
|
-
defaultComponent?: RegisteredRouteComponent<unknown, AnySearchSchema, AnyPathParams, AnyContext, AnyContext>;
|
|
192
|
-
defaultErrorComponent?: RegisteredErrorRouteComponent<AnySearchSchema, AnyPathParams, AnyContext, AnyContext>;
|
|
193
|
-
defaultPendingComponent?: RegisteredPendingRouteComponent<AnySearchSchema, AnyPathParams, AnyContext, AnyContext>;
|
|
194
|
-
defaultMaxAge?: number;
|
|
195
|
-
defaultGcMaxAge?: number;
|
|
196
|
-
defaultPreloadMaxAge?: number;
|
|
197
|
-
caseSensitive?: boolean;
|
|
198
|
-
routeTree?: TRouteTree;
|
|
199
|
-
basepath?: string;
|
|
200
|
-
createRoute?: (opts: {
|
|
201
|
-
route: AnyRoute;
|
|
202
|
-
router: AnyRouter;
|
|
203
|
-
}) => void;
|
|
204
|
-
context?: TRouteTree['types']['routerContext'];
|
|
205
|
-
Wrap?: React.ComponentType<{
|
|
206
|
-
children: React.ReactNode;
|
|
207
|
-
dehydratedState?: TDehydrated;
|
|
208
|
-
}>;
|
|
209
|
-
dehydrate?: () => TDehydrated;
|
|
210
|
-
hydrate?: (dehydrated: TDehydrated) => void;
|
|
211
|
-
}
|
|
212
|
-
interface RouterState<TRouteTree extends AnyRoute = AnyRoute> {
|
|
213
|
-
status: 'idle' | 'pending';
|
|
214
|
-
isFetching: boolean;
|
|
215
|
-
matchesById: Record<string, RouteMatch<TRouteTree>>;
|
|
216
|
-
matchIds: string[];
|
|
217
|
-
pendingMatchIds: string[];
|
|
218
|
-
matches: RouteMatch<TRouteTree>[];
|
|
219
|
-
pendingMatches: RouteMatch<TRouteTree>[];
|
|
220
|
-
location: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
221
|
-
resolvedLocation: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
222
|
-
lastUpdated: number;
|
|
223
|
-
}
|
|
224
|
-
type ListenerFn<TEvent extends RouterEvent> = (event: TEvent) => void;
|
|
225
|
-
interface BuildNextOptions {
|
|
226
|
-
to?: string | number | null;
|
|
227
|
-
params?: true | Updater<unknown>;
|
|
228
|
-
search?: true | Updater<unknown>;
|
|
229
|
-
hash?: true | Updater<string>;
|
|
230
|
-
state?: LocationState;
|
|
231
|
-
key?: string;
|
|
232
|
-
from?: string;
|
|
233
|
-
fromCurrent?: boolean;
|
|
234
|
-
__matches?: AnyRouteMatch[];
|
|
235
|
-
}
|
|
236
|
-
interface MatchLocation {
|
|
237
|
-
to?: string | number | null;
|
|
238
|
-
fuzzy?: boolean;
|
|
239
|
-
caseSensitive?: boolean;
|
|
240
|
-
from?: string;
|
|
241
|
-
fromCurrent?: boolean;
|
|
242
|
-
}
|
|
243
|
-
interface MatchRouteOptions {
|
|
244
|
-
pending?: boolean;
|
|
245
|
-
caseSensitive?: boolean;
|
|
246
|
-
includeSearch?: boolean;
|
|
247
|
-
fuzzy?: boolean;
|
|
248
|
-
}
|
|
249
|
-
interface DehydratedRouterState {
|
|
250
|
-
dehydratedMatches: DehydratedRouteMatch[];
|
|
251
|
-
}
|
|
252
|
-
type DehydratedRouteMatch = Pick<RouteMatch, 'fetchedAt' | 'invalid' | 'invalidAt' | 'id' | 'loaderData' | 'status' | 'updatedAt'>;
|
|
253
|
-
interface DehydratedRouter {
|
|
254
|
-
state: DehydratedRouterState;
|
|
255
|
-
}
|
|
256
|
-
type RouterConstructorOptions<TRouteTree extends AnyRoute, TDehydrated extends Record<string, any>> = Omit<RouterOptions<TRouteTree, TDehydrated>, 'context'> & RouterContextOptions<TRouteTree>;
|
|
257
|
-
declare const componentTypes: readonly ["component", "errorComponent", "pendingComponent"];
|
|
258
|
-
type RouterEvents = {
|
|
259
|
-
onBeforeLoad: {
|
|
260
|
-
type: 'onBeforeLoad';
|
|
261
|
-
from: ParsedLocation;
|
|
262
|
-
to: ParsedLocation;
|
|
263
|
-
pathChanged: boolean;
|
|
264
|
-
};
|
|
265
|
-
onLoad: {
|
|
266
|
-
type: 'onLoad';
|
|
267
|
-
from: ParsedLocation;
|
|
268
|
-
to: ParsedLocation;
|
|
269
|
-
pathChanged: boolean;
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
type RouterEvent = RouterEvents[keyof RouterEvents];
|
|
273
|
-
type RouterListener<TRouterEvent extends RouterEvent> = {
|
|
274
|
-
eventType: TRouterEvent['type'];
|
|
275
|
-
fn: ListenerFn<TRouterEvent>;
|
|
276
|
-
};
|
|
277
|
-
declare class Router<TRouteTree extends AnyRoute = AnyRoute, TDehydrated extends Record<string, any> = Record<string, any>> {
|
|
278
|
-
#private;
|
|
279
|
-
types: {
|
|
280
|
-
RootRoute: TRouteTree;
|
|
281
|
-
};
|
|
282
|
-
options: PickAsRequired<RouterOptions<TRouteTree, TDehydrated>, 'stringifySearch' | 'parseSearch' | 'context'>;
|
|
283
|
-
history: RouterHistory;
|
|
284
|
-
basepath: string;
|
|
285
|
-
routeTree: TRouteTree;
|
|
286
|
-
routesById: RoutesById<TRouteTree>;
|
|
287
|
-
routesByPath: RoutesByPath<TRouteTree>;
|
|
288
|
-
flatRoutes: ParseRoute<TRouteTree>[];
|
|
289
|
-
navigateTimeout: undefined | Timeout;
|
|
290
|
-
nextAction: undefined | 'push' | 'replace';
|
|
291
|
-
navigationPromise: undefined | Promise<void>;
|
|
292
|
-
__store: Store<RouterState<TRouteTree>>;
|
|
293
|
-
state: RouterState<TRouteTree>;
|
|
294
|
-
dehydratedData?: TDehydrated;
|
|
295
|
-
resetNextScroll: boolean;
|
|
296
|
-
constructor(options: RouterConstructorOptions<TRouteTree, TDehydrated>);
|
|
297
|
-
subscribers: Set<RouterListener<RouterEvent>>;
|
|
298
|
-
subscribe: <TType extends keyof RouterEvents>(eventType: TType, fn: ListenerFn<RouterEvents[TType]>) => () => void;
|
|
299
|
-
reset: () => void;
|
|
300
|
-
mount: () => void;
|
|
301
|
-
update: (opts?: RouterOptions<any, any>) => this;
|
|
302
|
-
buildNext: (opts: BuildNextOptions) => ParsedLocation;
|
|
303
|
-
cancelMatches: () => void;
|
|
304
|
-
cancelMatch: (id: string) => void;
|
|
305
|
-
safeLoad: (opts?: {
|
|
306
|
-
next?: ParsedLocation;
|
|
307
|
-
}) => Promise<void>;
|
|
308
|
-
latestLoadPromise: Promise<void>;
|
|
309
|
-
load: (opts?: {
|
|
310
|
-
next?: ParsedLocation;
|
|
311
|
-
throwOnError?: boolean;
|
|
312
|
-
__dehydratedMatches?: DehydratedRouteMatch[];
|
|
313
|
-
}) => Promise<void>;
|
|
314
|
-
getRoute: (id: string) => Route;
|
|
315
|
-
preloadRoute: (navigateOpts?: BuildNextOptions & {
|
|
316
|
-
maxAge?: number;
|
|
317
|
-
}) => Promise<RouteMatch<TRouteTree, ParseRoute<TRouteTree>["id"]>[]>;
|
|
318
|
-
cleanMatches: () => void;
|
|
319
|
-
matchRoutes: (pathname: string, locationSearch: AnySearchSchema, opts?: {
|
|
320
|
-
throwOnError?: boolean;
|
|
321
|
-
debug?: boolean;
|
|
322
|
-
}) => RouteMatch<TRouteTree>[];
|
|
323
|
-
loadMatches: (resolvedMatches: AnyRouteMatch[], opts?: {
|
|
324
|
-
preload?: boolean;
|
|
325
|
-
maxAge?: number;
|
|
326
|
-
}) => Promise<void>;
|
|
327
|
-
reload: () => Promise<void>;
|
|
328
|
-
resolvePath: (from: string, path: string) => string;
|
|
329
|
-
navigate: <TFrom extends RoutePaths<TRouteTree> = "/", TTo extends string = "">({ from, to, search, hash, replace, params, resetScroll, }: NavigateOptions<TRouteTree, TFrom, TTo>) => Promise<void>;
|
|
330
|
-
matchRoute: <TFrom extends RoutePaths<TRouteTree> = "/", TTo extends string = "", TResolved extends string = ResolveRelativePath<TFrom, NoInfer<TTo>>>(location: ToOptions<TRouteTree, TFrom, TTo, ResolveRelativePath<TFrom, NoInfer<TTo>>>, opts?: MatchRouteOptions) => false | RouteById<TRouteTree, TResolved>["types"]["allParams"];
|
|
331
|
-
buildLink: <TFrom extends RoutePaths<TRouteTree> = "/", TTo extends string = "">({ from, to, search, params, hash, target, replace, activeOptions, preload, preloadDelay: userPreloadDelay, disabled, state, resetScroll, }: LinkOptions<TRouteTree, TFrom, TTo>) => LinkInfo;
|
|
332
|
-
dehydrate: () => DehydratedRouter;
|
|
333
|
-
hydrate: (__do_not_use_server_ctx?: HydrationCtx) => Promise<void>;
|
|
334
|
-
injectedHtml: (string | (() => Promise<string> | string))[];
|
|
335
|
-
injectHtml: (html: string | (() => Promise<string> | string)) => Promise<void>;
|
|
336
|
-
dehydrateData: <T>(key: any, getData: T | (() => T | Promise<T>)) => () => T | undefined;
|
|
337
|
-
hydrateData: <T = unknown>(key: any) => T | undefined;
|
|
338
|
-
getRouteMatch: (id: string) => undefined | RouteMatch<TRouteTree>;
|
|
339
|
-
setRouteMatch: (id: string, updater: (prev: RouteMatch<TRouteTree>) => RouteMatch<TRouteTree>) => void;
|
|
340
|
-
setRouteMatchData: (id: string, updater: (prev: any) => any, opts?: {
|
|
341
|
-
updatedAt?: number;
|
|
342
|
-
maxAge?: number;
|
|
343
|
-
}) => void;
|
|
344
|
-
invalidate: (opts?: {
|
|
345
|
-
matchId?: string;
|
|
346
|
-
reload?: boolean;
|
|
347
|
-
}) => Promise<void>;
|
|
348
|
-
getIsInvalid: (opts?: {
|
|
349
|
-
matchId: string;
|
|
350
|
-
preload?: boolean;
|
|
351
|
-
}) => boolean;
|
|
352
|
-
}
|
|
353
|
-
type AnyRedirect = Redirect<any, any, any>;
|
|
354
|
-
type Redirect<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = ''> = NavigateOptions<TRouteTree, TFrom, TTo> & {
|
|
355
|
-
code?: number;
|
|
356
|
-
};
|
|
357
|
-
declare function redirect<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = ''>(opts: Redirect<TRouteTree, TFrom, TTo>): Redirect<TRouteTree, TFrom, TTo>;
|
|
358
|
-
declare function isRedirect(obj: any): obj is AnyRedirect;
|
|
359
|
-
declare class SearchParamError extends Error {
|
|
360
|
-
}
|
|
361
|
-
declare class PathParamError extends Error {
|
|
362
|
-
}
|
|
363
|
-
declare function lazyFn<T extends Record<string, (...args: any[]) => any>, TKey extends keyof T = 'default'>(fn: () => Promise<T>, key?: TKey): (...args: Parameters<T[TKey]>) => Promise<ReturnType<T[TKey]>>;
|
|
364
|
-
|
|
365
|
-
declare const rootRouteId: "__root__";
|
|
366
|
-
type RootRouteId = typeof rootRouteId;
|
|
367
|
-
type AnyPathParams = {};
|
|
368
|
-
type AnySearchSchema = {};
|
|
369
|
-
type AnyContext = {};
|
|
370
|
-
interface RouteMeta {
|
|
371
|
-
}
|
|
372
|
-
interface RouteContext {
|
|
373
|
-
}
|
|
374
|
-
interface RegisterRouteComponent<TLoader = unknown, TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
|
|
375
|
-
}
|
|
376
|
-
interface RegisterErrorRouteComponent<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
|
|
377
|
-
}
|
|
378
|
-
interface RegisterPendingRouteComponent<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
|
|
379
|
-
}
|
|
380
|
-
interface RegisterRouteProps<TLoader = unknown, TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
|
|
381
|
-
}
|
|
382
|
-
interface RegisterErrorRouteProps<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
|
|
383
|
-
}
|
|
384
|
-
interface RegisterPendingRouteProps<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
|
|
385
|
-
}
|
|
386
|
-
type RegisteredRouteComponent<TLoader = unknown, TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> = RegisterRouteComponent<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TAllContext> extends {
|
|
387
|
-
RouteComponent: infer T;
|
|
388
|
-
} ? T : () => unknown;
|
|
389
|
-
type RegisteredErrorRouteComponent<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> = RegisterErrorRouteComponent<TFullSearchSchema, TAllParams, TRouteContext, TAllContext> extends {
|
|
390
|
-
ErrorRouteComponent: infer T;
|
|
391
|
-
} ? T : () => unknown;
|
|
392
|
-
type RegisteredPendingRouteComponent<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> = RegisterPendingRouteComponent<TFullSearchSchema, TAllParams, TRouteContext, TAllContext> extends {
|
|
393
|
-
PendingRouteComponent: infer T;
|
|
394
|
-
} ? T : () => unknown;
|
|
395
|
-
type RegisteredRouteProps<TLoader = unknown, TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> = RegisterRouteProps<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TAllContext> extends {
|
|
396
|
-
RouteProps: infer T;
|
|
397
|
-
} ? T : {};
|
|
398
|
-
type RegisteredErrorRouteProps<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> = RegisterRouteProps<TFullSearchSchema, TAllParams, TRouteContext, TAllContext> extends {
|
|
399
|
-
ErrorRouteProps: infer T;
|
|
400
|
-
} ? T : {};
|
|
401
|
-
type RegisteredPendingRouteProps<TFullSearchSchema extends AnySearchSchema = AnySearchSchema, TAllParams extends AnyPathParams = AnyPathParams, TRouteContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> = RegisterRouteProps<TFullSearchSchema, TAllParams, TRouteContext, TAllContext> extends {
|
|
402
|
-
PendingRouteProps: infer T;
|
|
403
|
-
} ? T : {};
|
|
404
|
-
type PreloadableObj = {
|
|
405
|
-
preload?: () => Promise<void>;
|
|
406
|
-
};
|
|
407
|
-
type RoutePathOptions<TCustomId, TPath> = {
|
|
408
|
-
path: TPath;
|
|
409
|
-
} | {
|
|
410
|
-
id: TCustomId;
|
|
411
|
-
};
|
|
412
|
-
type RoutePathOptionsIntersection<TCustomId, TPath> = UnionToIntersection<RoutePathOptions<TCustomId, TPath>>;
|
|
413
|
-
type MetaOptions = keyof PickRequired<RouteMeta> extends never ? {
|
|
414
|
-
meta?: RouteMeta;
|
|
415
|
-
} : {
|
|
416
|
-
meta: RouteMeta;
|
|
417
|
-
};
|
|
418
|
-
type AnyRouteProps = RegisteredRouteProps<any, any, any, any, any>;
|
|
419
|
-
type RouteOptions<TParentRoute extends AnyRoute = AnyRoute, TCustomId extends string = string, TPath extends string = string, TLoader = unknown, TParentSearchSchema extends AnySearchSchema = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParams extends AnyPathParams = AnyPathParams, TAllParams extends AnyPathParams = TParams, TParentContext extends AnyContext = AnyContext, TAllParentContext extends AnyContext = AnyContext, TRouteContext extends RouteContext = RouteContext, TAllContext extends AnyContext = AnyContext> = BaseRouteOptions<TParentRoute, TCustomId, TPath, TLoader, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TParentContext, TAllParentContext, TRouteContext, TAllContext> & UpdatableRouteOptions<TLoader, TSearchSchema, TFullSearchSchema, TAllParams, TRouteContext, TAllContext>;
|
|
420
|
-
type ParamsFallback<TPath extends string, TParams> = unknown extends TParams ? Record<ParsePathParams<TPath>, string> : TParams;
|
|
421
|
-
type BaseRouteOptions<TParentRoute extends AnyRoute = AnyRoute, TCustomId extends string = string, TPath extends string = string, TLoader = unknown, TParentSearchSchema extends AnySearchSchema = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParams extends AnyPathParams = {}, TAllParams = ParamsFallback<TPath, TParams>, TParentContext extends AnyContext = AnyContext, TAllParentContext extends AnyContext = AnyContext, TRouteContext extends RouteContext = RouteContext, TAllContext extends AnyContext = AnyContext> = RoutePathOptions<TCustomId, TPath> & {
|
|
422
|
-
layoutLimit?: string;
|
|
423
|
-
getParentRoute: () => TParentRoute;
|
|
424
|
-
validateSearch?: SearchSchemaValidator<TSearchSchema>;
|
|
425
|
-
loader?: LoaderFn<TLoader, TSearchSchema, TFullSearchSchema, TAllParams, NoInfer<TRouteContext>, TAllContext>;
|
|
426
|
-
} & ([TLoader] extends [never] ? {
|
|
427
|
-
loader: 'Loaders must return a type other than never. If you are throwing a redirect() and not returning anything, return a redirect() instead.';
|
|
428
|
-
} : {}) & ({
|
|
429
|
-
parseParams?: (rawParams: IsAny<TPath, any, Record<ParsePathParams<TPath>, string>>) => TParams extends Record<ParsePathParams<TPath>, any> ? TParams : 'parseParams must return an object';
|
|
430
|
-
stringifyParams?: (params: NoInfer<ParamsFallback<TPath, TParams>>) => Record<ParsePathParams<TPath>, string>;
|
|
431
|
-
} | {
|
|
432
|
-
stringifyParams?: never;
|
|
433
|
-
parseParams?: never;
|
|
434
|
-
}) & (keyof PickRequired<RouteContext> extends never ? {
|
|
435
|
-
getContext?: GetContextFn<TParentRoute, TAllParams, TFullSearchSchema, TParentContext, TAllParentContext, TRouteContext>;
|
|
436
|
-
} : {
|
|
437
|
-
getContext: GetContextFn<TParentRoute, TAllParams, TFullSearchSchema, TParentContext, TAllParentContext, TRouteContext>;
|
|
438
|
-
});
|
|
439
|
-
type GetContextFn<TParentRoute, TAllParams, TFullSearchSchema, TParentContext, TAllParentContext, TRouteContext> = (opts: {
|
|
440
|
-
params: TAllParams;
|
|
441
|
-
search: TFullSearchSchema;
|
|
442
|
-
} & (TParentRoute extends undefined ? {
|
|
443
|
-
context?: TAllParentContext;
|
|
444
|
-
parentContext?: TParentContext;
|
|
445
|
-
} : {
|
|
446
|
-
context: TAllParentContext;
|
|
447
|
-
parentContext: TParentContext;
|
|
448
|
-
})) => TRouteContext;
|
|
449
|
-
type UpdatableRouteOptions<TLoader, TSearchSchema extends AnySearchSchema, TFullSearchSchema extends AnySearchSchema, TAllParams extends AnyPathParams, TRouteContext extends AnyContext, TAllContext extends AnyContext> = MetaOptions & {
|
|
450
|
-
key?: null | false | GetKeyFn<TFullSearchSchema, TAllParams>;
|
|
451
|
-
caseSensitive?: boolean;
|
|
452
|
-
wrapInSuspense?: boolean;
|
|
453
|
-
component?: RegisteredRouteComponent<TLoader, TFullSearchSchema, TAllParams, TRouteContext, TAllContext>;
|
|
454
|
-
errorComponent?: RegisteredErrorRouteComponent<TFullSearchSchema, TAllParams, TRouteContext, TAllContext>;
|
|
455
|
-
pendingComponent?: RegisteredPendingRouteComponent<TFullSearchSchema, TAllParams, TRouteContext, TAllContext>;
|
|
456
|
-
preSearchFilters?: SearchFilter<TFullSearchSchema>[];
|
|
457
|
-
postSearchFilters?: SearchFilter<TFullSearchSchema>[];
|
|
458
|
-
preloadMaxAge?: number;
|
|
459
|
-
maxAge?: number;
|
|
460
|
-
gcMaxAge?: number;
|
|
461
|
-
beforeLoad?: (opts: LoaderContext<TSearchSchema, TFullSearchSchema, TAllParams, NoInfer<TRouteContext>, TAllContext>) => Promise<void> | void;
|
|
462
|
-
onError?: (err: any) => void;
|
|
463
|
-
onLoaded?: (matchContext: {
|
|
464
|
-
params: TAllParams;
|
|
465
|
-
search: TFullSearchSchema;
|
|
466
|
-
}) => void | undefined | ((match: {
|
|
467
|
-
params: TAllParams;
|
|
468
|
-
search: TFullSearchSchema;
|
|
469
|
-
}) => void);
|
|
470
|
-
onTransition?: (match: {
|
|
471
|
-
params: TAllParams;
|
|
472
|
-
search: TFullSearchSchema;
|
|
473
|
-
}) => void;
|
|
474
|
-
};
|
|
475
|
-
type ParseParamsOption<TPath extends string, TParams> = ParseParamsFn<TPath, TParams>;
|
|
476
|
-
type ParseParamsFn<TPath extends string, TParams> = (rawParams: IsAny<TPath, any, Record<ParsePathParams<TPath>, string>>) => TParams extends Record<ParsePathParams<TPath>, any> ? TParams : 'parseParams must return an object';
|
|
477
|
-
type ParseParamsObj<TPath extends string, TParams> = {
|
|
478
|
-
parse?: ParseParamsFn<TPath, TParams>;
|
|
479
|
-
};
|
|
480
|
-
type SearchSchemaValidator<TReturn> = SearchSchemaValidatorObj<TReturn> | SearchSchemaValidatorFn<TReturn>;
|
|
481
|
-
type SearchSchemaValidatorObj<TReturn> = {
|
|
482
|
-
parse?: SearchSchemaValidatorFn<TReturn>;
|
|
483
|
-
};
|
|
484
|
-
type SearchSchemaValidatorFn<TReturn> = (searchObj: Record<string, unknown>) => TReturn;
|
|
485
|
-
type DefinedPathParamWarning = 'Path params cannot be redefined by child routes!';
|
|
486
|
-
type ParentParams<TParentParams> = AnyPathParams extends TParentParams ? {} : {
|
|
487
|
-
[Key in keyof TParentParams]?: DefinedPathParamWarning;
|
|
488
|
-
};
|
|
489
|
-
type LoaderFn<TLoader = unknown, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TAllParams = {}, TContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> = (match: LoaderContext<TSearchSchema, TFullSearchSchema, TAllParams, TContext, TAllContext> & {
|
|
490
|
-
parentMatchPromise?: Promise<void>;
|
|
491
|
-
}) => Promise<TLoader> | TLoader;
|
|
492
|
-
type GetKeyFn<TFullSearchSchema extends AnySearchSchema = {}, TAllParams = {}> = (loaderContext: {
|
|
493
|
-
params: TAllParams;
|
|
494
|
-
search: TFullSearchSchema;
|
|
495
|
-
}) => any;
|
|
496
|
-
interface LoaderContext<TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TAllParams = {}, TContext extends AnyContext = AnyContext, TAllContext extends AnyContext = AnyContext> {
|
|
497
|
-
params: TAllParams;
|
|
498
|
-
routeSearch: TSearchSchema;
|
|
499
|
-
search: TFullSearchSchema;
|
|
500
|
-
abortController: AbortController;
|
|
501
|
-
preload: boolean;
|
|
502
|
-
routeContext: TContext;
|
|
503
|
-
context: TAllContext;
|
|
504
|
-
}
|
|
505
|
-
type UnloaderFn<TPath extends string> = (routeMatch: RouteMatch<any, Route>) => void;
|
|
506
|
-
type SearchFilter<T, U = T> = (prev: T) => U;
|
|
507
|
-
type ResolveId<TParentRoute, TCustomId extends string, TPath extends string> = TParentRoute extends {
|
|
508
|
-
id: infer TParentId extends string;
|
|
509
|
-
} ? RoutePrefix<TParentId, string extends TCustomId ? TPath : TCustomId> : RootRouteId;
|
|
510
|
-
type InferFullSearchSchema<TRoute> = TRoute extends {
|
|
511
|
-
isRoot: true;
|
|
512
|
-
types: {
|
|
513
|
-
searchSchema: infer TSearchSchema;
|
|
514
|
-
};
|
|
515
|
-
} ? TSearchSchema : TRoute extends {
|
|
516
|
-
types: {
|
|
517
|
-
fullSearchSchema: infer TFullSearchSchema;
|
|
518
|
-
};
|
|
519
|
-
} ? TFullSearchSchema : {};
|
|
520
|
-
type ResolveFullSearchSchema<TParentRoute, TSearchSchema> = InferFullSearchSchema<TParentRoute> & TSearchSchema;
|
|
521
|
-
interface AnyRoute extends Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> {
|
|
522
|
-
}
|
|
523
|
-
type MergeParamsFromParent<T, U> = IsAny<T, U, T & U>;
|
|
524
|
-
type UseLoaderResult<T> = T;
|
|
525
|
-
type StreamedPromise<T> = {
|
|
526
|
-
promise: Promise<T>;
|
|
527
|
-
status: 'resolved' | 'pending';
|
|
528
|
-
data: T;
|
|
529
|
-
resolve: (value: T) => void;
|
|
530
|
-
};
|
|
531
|
-
type RouteConstraints = {
|
|
532
|
-
TParentRoute: AnyRoute;
|
|
533
|
-
TPath: string;
|
|
534
|
-
TFullPath: string;
|
|
535
|
-
TCustomId: string;
|
|
536
|
-
TId: string;
|
|
537
|
-
TSearchSchema: AnySearchSchema;
|
|
538
|
-
TFullSearchSchema: AnySearchSchema;
|
|
539
|
-
TParams: Record<string, any>;
|
|
540
|
-
TAllParams: Record<string, any>;
|
|
541
|
-
TParentContext: AnyContext;
|
|
542
|
-
TAllParentContext: AnyContext;
|
|
543
|
-
TRouteContext: RouteContext;
|
|
544
|
-
TAllContext: AnyContext;
|
|
545
|
-
TRouterContext: AnyContext;
|
|
546
|
-
TChildren: unknown;
|
|
547
|
-
TRouteTree: AnyRoute;
|
|
548
|
-
};
|
|
549
|
-
declare class Route<TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, TPath extends RouteConstraints['TPath'] = '/', TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, TCustomId extends RouteConstraints['TCustomId'] = string, TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, TLoader = unknown, TSearchSchema extends RouteConstraints['TSearchSchema'] = {}, TFullSearchSchema extends RouteConstraints['TFullSearchSchema'] = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TParams extends RouteConstraints['TParams'] = Record<ParsePathParams<TPath>, string>, TAllParams extends RouteConstraints['TAllParams'] = MergeParamsFromParent<TParentRoute['types']['allParams'], TParams>, TParentContext extends RouteConstraints['TParentContext'] = TParentRoute['types']['routeContext'], TAllParentContext extends RouteConstraints['TAllParentContext'] = TParentRoute['types']['context'], TRouteContext extends RouteConstraints['TRouteContext'] = RouteContext, TAllContext extends RouteConstraints['TAllContext'] = MergeParamsFromParent<TParentRoute['types']['context'], TRouteContext>, TRouterContext extends RouteConstraints['TRouterContext'] = AnyContext, TChildren extends RouteConstraints['TChildren'] = unknown, TRouteTree extends RouteConstraints['TRouteTree'] = AnyRoute> {
|
|
550
|
-
types: {
|
|
551
|
-
parentRoute: TParentRoute;
|
|
552
|
-
path: TPath;
|
|
553
|
-
to: TrimPathRight<TFullPath>;
|
|
554
|
-
fullPath: TFullPath;
|
|
555
|
-
customId: TCustomId;
|
|
556
|
-
id: TId;
|
|
557
|
-
loader: TLoader;
|
|
558
|
-
searchSchema: TSearchSchema;
|
|
559
|
-
fullSearchSchema: TFullSearchSchema;
|
|
560
|
-
params: TParams;
|
|
561
|
-
allParams: TAllParams;
|
|
562
|
-
parentContext: TParentContext;
|
|
563
|
-
allParentContext: TAllParentContext;
|
|
564
|
-
routeContext: TRouteContext;
|
|
565
|
-
context: TAllContext;
|
|
566
|
-
children: TChildren;
|
|
567
|
-
routeTree: TRouteTree;
|
|
568
|
-
routerContext: TRouterContext;
|
|
569
|
-
};
|
|
570
|
-
isRoot: TParentRoute extends Route<any> ? true : false;
|
|
571
|
-
options: RouteOptions<TParentRoute, TCustomId, TPath, TLoader, InferFullSearchSchema<TParentRoute>, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TParentContext, TAllParentContext, TRouteContext, TAllContext> & UpdatableRouteOptions<TLoader, TSearchSchema, TFullSearchSchema, TAllParams, TRouteContext, TAllContext>;
|
|
572
|
-
parentRoute: TParentRoute;
|
|
573
|
-
id: TId;
|
|
574
|
-
path: TPath;
|
|
575
|
-
fullPath: TFullPath;
|
|
576
|
-
to: TrimPathRight<TFullPath>;
|
|
577
|
-
children?: TChildren;
|
|
578
|
-
originalIndex?: number;
|
|
579
|
-
router?: AnyRouter;
|
|
580
|
-
rank: number;
|
|
581
|
-
constructor(options: RouteOptions<TParentRoute, TCustomId, TPath, TLoader, InferFullSearchSchema<TParentRoute>, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TParentContext, TAllParentContext, TRouteContext, TAllContext> & UpdatableRouteOptions<TLoader, TSearchSchema, TFullSearchSchema, TAllParams, TRouteContext, TAllContext>);
|
|
582
|
-
init: (opts: {
|
|
583
|
-
originalIndex: number;
|
|
584
|
-
router: AnyRouter;
|
|
585
|
-
}) => void;
|
|
586
|
-
addChildren: <TNewChildren extends AnyRoute[]>(children: TNewChildren) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TLoader, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TParentContext, TAllParentContext, TRouteContext, TAllContext, TRouterContext, TNewChildren, TRouteTree>;
|
|
587
|
-
update: (options: UpdatableRouteOptions<TLoader, TSearchSchema, TFullSearchSchema, TAllParams, TRouteContext, TAllContext>) => this;
|
|
588
|
-
static __onInit: (route: any) => void;
|
|
589
|
-
}
|
|
590
|
-
type AnyRootRoute = RootRoute<any, any, any, any>;
|
|
591
|
-
declare class RouterContext<TRouterContext extends {}> {
|
|
592
|
-
constructor();
|
|
593
|
-
createRootRoute: <TLoader = unknown, TSearchSchema extends AnySearchSchema = {}, TRouteContext extends RouteContext = RouteContext>(options?: Omit<RouteOptions<AnyRoute, "__root__", "", TLoader, TSearchSchema, TSearchSchema, TSearchSchema, {}, {}, TRouterContext, TRouterContext, TRouteContext, IsAny<TRouterContext, TRouteContext, TRouterContext & TRouteContext>>, "caseSensitive" | "id" | "path" | "getParentRoute" | "stringifyParams" | "parseParams"> | undefined) => RootRoute<TLoader, TSearchSchema, TRouteContext, TRouterContext>;
|
|
594
|
-
}
|
|
595
|
-
declare class RootRoute<TLoader = unknown, TSearchSchema extends AnySearchSchema = {}, TRouteContext extends RouteContext = RouteContext, TRouterContext extends {} = {}> extends Route<any, '/', '/', string, RootRouteId, TLoader, TSearchSchema, TSearchSchema, {}, {}, TRouterContext, TRouterContext, TRouteContext, MergeParamsFromParent<TRouterContext, TRouteContext>, TRouterContext, any, any> {
|
|
596
|
-
constructor(options?: Omit<RouteOptions<AnyRoute, RootRouteId, '', TLoader, TSearchSchema, TSearchSchema, TSearchSchema, {}, {}, TRouterContext, TRouterContext, TRouteContext, MergeParamsFromParent<TRouterContext, TRouteContext>>, 'path' | 'id' | 'getParentRoute' | 'caseSensitive' | 'parseParams' | 'stringifyParams'>);
|
|
597
|
-
}
|
|
598
|
-
type ResolveFullPath<TParentRoute extends AnyRoute, TPath extends string, TPrefixed = RoutePrefix<TParentRoute['fullPath'], TPath>> = TPrefixed extends RootRouteId ? '/' : TPrefixed;
|
|
599
|
-
type RoutePrefix<TPrefix extends string, TPath extends string> = string extends TPath ? RootRouteId : TPath extends string ? TPrefix extends RootRouteId ? TPath extends '/' ? '/' : `/${TrimPath<TPath>}` : `${TPrefix}/${TPath}` extends '/' ? '/' : `/${TrimPathLeft<`${TrimPathRight<TPrefix>}/${TrimPath<TPath>}`>}` : never;
|
|
600
|
-
type TrimPath<T extends string> = '' extends T ? '' : TrimPathRight<TrimPathLeft<T>>;
|
|
601
|
-
type TrimPathLeft<T extends string> = T extends `${RootRouteId}/${infer U}` ? TrimPathLeft<U> : T extends `/${infer U}` ? TrimPathLeft<U> : T;
|
|
602
|
-
type TrimPathRight<T extends string> = T extends '/' ? '/' : T extends `${infer U}/` ? TrimPathRight<U> : T;
|
|
603
|
-
|
|
604
|
-
interface FileRoutesByPath {
|
|
605
|
-
}
|
|
606
|
-
type Replace<S extends string, From extends string, To extends string> = S extends `${infer Start}${From}${infer Rest}` ? `${Start}${To}${Replace<Rest, From, To>}` : S;
|
|
607
|
-
type TrimLeft<T extends string, S extends string> = T extends `${S}${infer U}` ? U : T;
|
|
608
|
-
type TrimRight<T extends string, S extends string> = T extends `${infer U}${S}` ? U : T;
|
|
609
|
-
type Trim<T extends string, S extends string> = TrimLeft<TrimRight<T, S>, S>;
|
|
610
|
-
type RemoveUnderScores<T extends string> = Replace<Replace<TrimRight<TrimLeft<T, '/_'>, '_'>, '_/', '/'>, '/_', '/'>;
|
|
611
|
-
type ResolveFilePath<TParentRoute extends AnyRoute, TFilePath extends string> = TParentRoute['id'] extends RootRouteId ? TrimPathLeft<TFilePath> : Replace<TrimPathLeft<TFilePath>, TrimPathLeft<TParentRoute['types']['customId']>, ''>;
|
|
612
|
-
type FileRoutePath<TParentRoute extends AnyRoute, TFilePath extends string> = ResolveFilePath<TParentRoute, TFilePath> extends `_${infer _}` ? string : ResolveFilePath<TParentRoute, TFilePath>;
|
|
613
|
-
declare class FileRoute<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'], TId extends RouteConstraints['TId'] = TFilePath, TPath extends RouteConstraints['TPath'] = FileRoutePath<TParentRoute, TFilePath>, TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, RemoveUnderScores<TPath>>> {
|
|
614
|
-
path: TFilePath;
|
|
615
|
-
constructor(path: TFilePath);
|
|
616
|
-
createRoute: <TLoader = unknown, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = ResolveFullSearchSchema<TParentRoute, TSearchSchema>, TParams extends Record<string, any> = (TrimLeft<TrimRight<Split<TPath, true>[number], "_">, "_"> extends infer T ? T extends TrimLeft<TrimRight<Split<TPath, true>[number], "_">, "_"> ? T extends `$${infer L}` ? L : never : never : never) extends never ? AnyPathParams : Record<TrimLeft<TrimRight<Split<TPath, true>[number], "_">, "_"> extends infer T ? T extends TrimLeft<TrimRight<Split<TPath, true>[number], "_">, "_"> ? T extends `$${infer L}` ? L : never : never : never, string>, TAllParams extends Record<string, any> = IsAny<TParentRoute["types"]["allParams"], TParams, TParentRoute["types"]["allParams"] & TParams>, TParentContext extends AnyContext = TParentRoute["types"]["routeContext"], TAllParentContext extends string = TParentRoute["types"]["context"], TRouteContext extends RouteContext = RouteContext, TContext extends AnyContext = IsAny<TParentRoute["types"]["context"], TRouteContext, TParentRoute["types"]["context"] & TRouteContext>, TRouterContext extends AnyContext = AnyContext, TChildren extends unknown = unknown, TRouteTree extends AnyRoute = AnyRoute>(options: Omit<RouteOptions<TParentRoute, string, string, TLoader, InferFullSearchSchema<TParentRoute>, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TParentContext, TAllParentContext, TRouteContext, TContext>, "id" | "path" | "getParentRoute"> & {
|
|
617
|
-
meta?: RouteMeta | undefined;
|
|
618
|
-
} & {
|
|
619
|
-
key?: false | GetKeyFn<TFullSearchSchema, TAllParams> | null | undefined;
|
|
620
|
-
caseSensitive?: boolean | undefined;
|
|
621
|
-
wrapInSuspense?: boolean | undefined;
|
|
622
|
-
component?: (() => unknown) | undefined;
|
|
623
|
-
errorComponent?: (() => unknown) | undefined;
|
|
624
|
-
pendingComponent?: (() => unknown) | undefined;
|
|
625
|
-
preSearchFilters?: SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
|
|
626
|
-
postSearchFilters?: SearchFilter<TFullSearchSchema, TFullSearchSchema>[] | undefined;
|
|
627
|
-
preloadMaxAge?: number | undefined;
|
|
628
|
-
maxAge?: number | undefined;
|
|
629
|
-
gcMaxAge?: number | undefined;
|
|
630
|
-
beforeLoad?: ((opts: LoaderContext<TSearchSchema, TFullSearchSchema, TAllParams, NoInfer<TRouteContext>, TContext>) => void | Promise<void>) | undefined;
|
|
631
|
-
onError?: ((err: any) => void) | undefined;
|
|
632
|
-
onLoaded?: ((matchContext: {
|
|
633
|
-
params: TAllParams;
|
|
634
|
-
search: TFullSearchSchema;
|
|
635
|
-
}) => void | ((match: {
|
|
636
|
-
params: TAllParams;
|
|
637
|
-
search: TFullSearchSchema;
|
|
638
|
-
}) => void) | undefined) | undefined;
|
|
639
|
-
onTransition?: ((match: {
|
|
640
|
-
params: TAllParams;
|
|
641
|
-
search: TFullSearchSchema;
|
|
642
|
-
}) => void) | undefined;
|
|
643
|
-
}) => Route<TParentRoute, TPath, TFullPath, TFilePath, TId, TLoader, TSearchSchema, TFullSearchSchema, TParams, TAllParams, TParentContext, TAllParentContext, TRouteContext, TContext, TRouterContext, TChildren, TRouteTree>;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
type LinkInfo = {
|
|
647
|
-
type: 'external';
|
|
648
|
-
href: string;
|
|
649
|
-
} | {
|
|
650
|
-
type: 'internal';
|
|
651
|
-
next: ParsedLocation;
|
|
652
|
-
handleFocus: (e: any) => void;
|
|
653
|
-
handleClick: (e: any) => void;
|
|
654
|
-
handleEnter: (e: any) => void;
|
|
655
|
-
handleLeave: (e: any) => void;
|
|
656
|
-
handleTouchStart: (e: any) => void;
|
|
657
|
-
isActive: boolean;
|
|
658
|
-
disabled?: boolean;
|
|
659
|
-
};
|
|
660
|
-
type CleanPath<T extends string> = T extends `${infer L}//${infer R}` ? CleanPath<`${CleanPath<L>}/${CleanPath<R>}`> : T extends `${infer L}//` ? `${CleanPath<L>}/` : T extends `//${infer L}` ? `/${CleanPath<L>}` : T;
|
|
661
|
-
type Split<S, TIncludeTrailingSlash = true> = S extends unknown ? string extends S ? string[] : S extends string ? CleanPath<S> extends '' ? [] : TIncludeTrailingSlash extends true ? CleanPath<S> extends `${infer T}/` ? [...Split<T>, '/'] : CleanPath<S> extends `/${infer U}` ? Split<U> : CleanPath<S> extends `${infer T}/${infer U}` ? [...Split<T>, ...Split<U>] : [S] : CleanPath<S> extends `${infer T}/${infer U}` ? [...Split<T>, ...Split<U>] : S extends string ? [S] : never : never : never;
|
|
662
|
-
type ParsePathParams<T extends string> = keyof {
|
|
663
|
-
[K in Trim<Split<T>[number], '_'> as K extends `$${infer L}` ? L : never]: K;
|
|
664
|
-
};
|
|
665
|
-
type Join<T, Delimiter extends string = '/'> = T extends [] ? '' : T extends [infer L extends string] ? L : T extends [infer L extends string, ...infer Tail extends [...string[]]] ? CleanPath<`${L}${Delimiter}${Join<Tail>}`> : never;
|
|
666
|
-
type Last<T extends any[]> = T extends [...infer _, infer L] ? L : never;
|
|
667
|
-
type RelativeToPathAutoComplete<AllPaths extends string, TFrom extends string, TTo extends string, SplitPaths extends string[] = Split<AllPaths, false>> = TTo extends `..${infer _}` ? SplitPaths extends [
|
|
668
|
-
...Split<ResolveRelativePath<TFrom, TTo>, false>,
|
|
669
|
-
...infer TToRest
|
|
670
|
-
] ? `${CleanPath<Join<[
|
|
671
|
-
...Split<TTo, false>,
|
|
672
|
-
...(TToRest | (Split<ResolveRelativePath<TFrom, TTo>, false>['length'] extends 1 ? never : ['../']))
|
|
673
|
-
]>>}` : never : TTo extends `./${infer RestTTo}` ? SplitPaths extends [
|
|
674
|
-
...Split<TFrom, false>,
|
|
675
|
-
...Split<RestTTo, false>,
|
|
676
|
-
...infer RestPath
|
|
677
|
-
] ? `${TTo}${Join<RestPath>}` : never : (TFrom extends `/` ? never : SplitPaths extends [...Split<TFrom, false>, ...infer RestPath] ? Join<RestPath> extends {
|
|
678
|
-
length: 0;
|
|
679
|
-
} ? never : './' : never) | (TFrom extends `/` ? never : '../') | AllPaths;
|
|
680
|
-
type NavigateOptions<TRouteTree extends AnyRoute = AnyRoute, TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = ''> = ToOptions<TRouteTree, TFrom, TTo> & {
|
|
681
|
-
replace?: boolean;
|
|
682
|
-
resetScroll?: boolean;
|
|
683
|
-
};
|
|
684
|
-
type ToOptions<TRouteTree extends AnyRoute = AnyRoute, TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = '', TResolvedTo = ResolveRelativePath<TFrom, NoInfer<TTo>>> = {
|
|
685
|
-
to?: ToPathOption<TRouteTree, TFrom, TTo>;
|
|
686
|
-
hash?: Updater<string>;
|
|
687
|
-
state?: LocationState;
|
|
688
|
-
from?: TFrom;
|
|
689
|
-
} & CheckPath<TRouteTree, NoInfer<TResolvedTo>, {}> & SearchParamOptions<TRouteTree, TFrom, TResolvedTo> & PathParamOptions<TRouteTree, TFrom, TResolvedTo>;
|
|
690
|
-
type SearchParamOptions<TRouteTree extends AnyRoute, TFrom, TTo, TFromSchema = UnionToIntersection<FullSearchSchema<TRouteTree> & RouteByPath<TRouteTree, TFrom> extends never ? {} : RouteByPath<TRouteTree, TFrom>['types']['fullSearchSchema']>, TToSchema = Partial<RouteByPath<TRouteTree, TFrom>['types']['fullSearchSchema']> & Omit<RouteByPath<TRouteTree, TTo>['types']['fullSearchSchema'], keyof PickRequired<RouteByPath<TRouteTree, TFrom>['types']['fullSearchSchema']>>, TFromFullSchema = UnionToIntersection<FullSearchSchema<TRouteTree> & TFromSchema>, TToFullSchema = UnionToIntersection<FullSearchSchema<TRouteTree> & TToSchema>> = keyof PickRequired<TToSchema> extends never ? {
|
|
691
|
-
search?: true | SearchReducer<TFromFullSchema, TToFullSchema>;
|
|
692
|
-
} : {
|
|
693
|
-
search: SearchReducer<TFromFullSchema, TToFullSchema>;
|
|
694
|
-
};
|
|
695
|
-
type SearchReducer<TFrom, TTo> = {
|
|
696
|
-
[TKey in keyof TTo]: TTo[TKey];
|
|
697
|
-
} | ((current: TFrom) => TTo);
|
|
698
|
-
type PathParamOptions<TRouteTree extends AnyRoute, TFrom, TTo, TFromSchema = UnionToIntersection<RouteByPath<TRouteTree, TFrom> extends never ? {} : RouteByPath<TRouteTree, TFrom>['types']['allParams']>, TToSchema = Partial<RouteByPath<TRouteTree, TFrom>['types']['allParams']> & Omit<RouteByPath<TRouteTree, TTo>['types']['allParams'], keyof PickRequired<RouteByPath<TRouteTree, TFrom>['types']['allParams']>>, TFromFullParams = UnionToIntersection<AllParams<TRouteTree> & TFromSchema>, TToFullParams = UnionToIntersection<AllParams<TRouteTree> & TToSchema>> = keyof PickRequired<TToSchema> extends never ? {
|
|
699
|
-
params?: ParamsReducer<TFromFullParams, TToFullParams>;
|
|
700
|
-
} : {
|
|
701
|
-
params: ParamsReducer<TFromFullParams, TToFullParams>;
|
|
702
|
-
};
|
|
703
|
-
type ParamsReducer<TFrom, TTo> = TTo | ((current: TFrom) => TTo);
|
|
704
|
-
type ToPathOption<TRouteTree extends AnyRoute = AnyRoute, TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = ''> = TTo | RelativeToPathAutoComplete<RoutePaths<TRouteTree>, NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
|
|
705
|
-
type ToIdOption<TRouteTree extends AnyRoute = AnyRoute, TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = ''> = TTo | RelativeToPathAutoComplete<RouteIds<TRouteTree>, NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>;
|
|
706
|
-
interface ActiveOptions {
|
|
707
|
-
exact?: boolean;
|
|
708
|
-
includeHash?: boolean;
|
|
709
|
-
includeSearch?: boolean;
|
|
710
|
-
}
|
|
711
|
-
type LinkOptions<TRouteTree extends AnyRoute = AnyRoute, TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string = ''> = NavigateOptions<TRouteTree, TFrom, TTo> & {
|
|
712
|
-
target?: HTMLAnchorElement['target'];
|
|
713
|
-
activeOptions?: ActiveOptions;
|
|
714
|
-
preload?: false | 'intent';
|
|
715
|
-
preloadDelay?: number;
|
|
716
|
-
disabled?: boolean;
|
|
717
|
-
};
|
|
718
|
-
type CheckRelativePath<TRouteTree extends AnyRoute, TFrom, TTo> = TTo extends string ? TFrom extends string ? ResolveRelativePath<TFrom, TTo> extends RoutePaths<TRouteTree> ? {} : {
|
|
719
|
-
Error: `${TFrom} + ${TTo} resolves to ${ResolveRelativePath<TFrom, TTo>}, which is not a valid route path.`;
|
|
720
|
-
'Valid Route Paths': RoutePaths<TRouteTree>;
|
|
721
|
-
} : {} : {};
|
|
722
|
-
type CheckPath<TRouteTree extends AnyRoute, TPath, TPass> = Exclude<TPath, RoutePaths<TRouteTree>> extends never ? TPass : CheckPathError<TRouteTree, Exclude<TPath, RoutePaths<TRouteTree>>>;
|
|
723
|
-
type CheckPathError<TRouteTree extends AnyRoute, TInvalids> = {
|
|
724
|
-
to: RoutePaths<TRouteTree>;
|
|
725
|
-
};
|
|
726
|
-
type CheckId<TRouteTree extends AnyRoute, TPath, TPass> = Exclude<TPath, RouteIds<TRouteTree>> extends never ? TPass : CheckIdError<TRouteTree, Exclude<TPath, RouteIds<TRouteTree>>>;
|
|
727
|
-
type CheckIdError<TRouteTree extends AnyRoute, TInvalids> = {
|
|
728
|
-
Error: `${TInvalids extends string ? TInvalids : never} is not a valid route ID.`;
|
|
729
|
-
'Valid Route IDs': RouteIds<TRouteTree>;
|
|
730
|
-
};
|
|
731
|
-
type ResolveRelativePath<TFrom, TTo = '.'> = TFrom extends string ? TTo extends string ? TTo extends '.' ? TFrom : TTo extends `./` ? Join<[TFrom, '/']> : TTo extends `./${infer TRest}` ? ResolveRelativePath<TFrom, TRest> : TTo extends `/${infer TRest}` ? TTo : Split<TTo> extends ['..', ...infer ToRest] ? Split<TFrom> extends [...infer FromRest, infer FromTail] ? ToRest extends ['/'] ? Join<[...FromRest, '/']> : ResolveRelativePath<Join<FromRest>, Join<ToRest>> : never : Split<TTo> extends ['.', ...infer ToRest] ? ToRest extends ['/'] ? Join<[TFrom, '/']> : ResolveRelativePath<TFrom, Join<ToRest>> : CleanPath<Join<['/', ...Split<TFrom>, ...Split<TTo>]>> : never : never;
|
|
732
|
-
|
|
733
|
-
interface Segment {
|
|
734
|
-
type: 'pathname' | 'param' | 'wildcard';
|
|
735
|
-
value: string;
|
|
736
|
-
}
|
|
737
|
-
declare function joinPaths(paths: (string | undefined)[]): string;
|
|
738
|
-
declare function cleanPath(path: string): string;
|
|
739
|
-
declare function trimPathLeft(path: string): string;
|
|
740
|
-
declare function trimPathRight(path: string): string;
|
|
741
|
-
declare function trimPath(path: string): string;
|
|
742
|
-
declare function resolvePath(basepath: string, base: string, to: string): string;
|
|
743
|
-
declare function parsePathname(pathname?: string): Segment[];
|
|
744
|
-
declare function interpolatePath(path: string | undefined, params: any, leaveWildcards?: boolean): string;
|
|
745
|
-
declare function matchPathname(basepath: string, currentPathname: string, matchLocation: Pick<MatchLocation, 'to' | 'fuzzy' | 'caseSensitive'>): AnyPathParams | undefined;
|
|
746
|
-
declare function matchByPath(basepath: string, from: string, matchLocation: Pick<MatchLocation, 'to' | 'caseSensitive' | 'fuzzy'>): Record<string, string> | undefined;
|
|
747
|
-
|
|
748
|
-
declare function encode(obj: any, pfx?: string): string;
|
|
749
|
-
declare function decode(str: any): {};
|
|
750
|
-
|
|
751
|
-
declare const defaultParseSearch: (searchStr: string) => AnySearchSchema;
|
|
752
|
-
declare const defaultStringifySearch: (search: Record<string, any>) => string;
|
|
753
|
-
declare function parseSearchWith(parser: (str: string) => any): (searchStr: string) => AnySearchSchema;
|
|
754
|
-
declare function stringifySearchWith(stringify: (search: any) => string, parser?: (str: string) => any): (search: Record<string, any>) => string;
|
|
755
|
-
|
|
756
|
-
type ScrollRestorationOptions = {
|
|
757
|
-
getKey?: (location: ParsedLocation) => string;
|
|
758
|
-
};
|
|
759
|
-
declare function watchScrollPositions(router: AnyRouter, opts?: ScrollRestorationOptions): () => void;
|
|
760
|
-
declare function restoreScrollPositions(router: AnyRouter, opts?: ScrollRestorationOptions): void;
|
|
761
|
-
|
|
762
|
-
type DeferredPromiseState<T> = {
|
|
763
|
-
uid: string;
|
|
764
|
-
} & ({
|
|
765
|
-
status: 'pending';
|
|
766
|
-
data?: T;
|
|
767
|
-
error?: unknown;
|
|
768
|
-
} | {
|
|
769
|
-
status: 'success';
|
|
770
|
-
data: T;
|
|
771
|
-
} | {
|
|
772
|
-
status: 'error';
|
|
773
|
-
data?: T;
|
|
774
|
-
error: unknown;
|
|
775
|
-
});
|
|
776
|
-
type DeferredPromise<T> = Promise<T> & {
|
|
777
|
-
__deferredState: DeferredPromiseState<T>;
|
|
778
|
-
};
|
|
779
|
-
declare function defer<T>(_promise: Promise<T>): DeferredPromise<T>;
|
|
780
|
-
declare function isDehydratedDeferred(obj: any): boolean;
|
|
781
|
-
|
|
782
|
-
export { ActiveOptions, AllParams, AnyContext, AnyPathParams, AnyRedirect, AnyRootRoute, AnyRoute, AnyRouteMatch, AnyRouteProps, AnyRouter, AnySearchSchema, BaseRouteOptions, BuildNextOptions, CheckId, CheckIdError, CheckPath, CheckPathError, CheckRelativePath, CleanPath, DeepAwaited, DeferredPromise, DeferredPromiseState, DefinedPathParamWarning, DehydratedRouteMatch, DehydratedRouter, DehydratedRouterState, Expand, FileRoute, FileRoutePath, FileRoutesByPath, FromLocation, FullSearchSchema, GetKeyFn, HydrationCtx, InferFullSearchSchema, IsAny, IsAnyBoolean, IsKnown, Join, Last, LinkInfo, LinkOptions, ListenerFn, LoaderContext, LoaderFn, LocationState, MatchLocation, MatchRouteOptions, MergeParamsFromParent, MergeUnion, MetaOptions, NavigateOptions, NoInfer, ParamsFallback, ParentParams, ParseParamsFn, ParseParamsObj, ParseParamsOption, ParsePathParams, ParseRoute, ParseRouteChildren, ParsedLocation, ParsedPath, PathParamError, PathParamMask, PathParamOptions, PickAsPartial, PickAsRequired, PickExclude, PickExtra, PickExtract, PickRequired, PickUnsafe, PreloadableObj, Redirect, Register, RegisterErrorRouteComponent, RegisterErrorRouteProps, RegisterPendingRouteComponent, RegisterPendingRouteProps, RegisterRouteComponent, RegisterRouteProps, RegisteredErrorRouteComponent, RegisteredErrorRouteProps, RegisteredPendingRouteComponent, RegisteredPendingRouteProps, RegisteredRouteComponent, RegisteredRouteProps, RegisteredRouter, RelativeToPathAutoComplete, RemoveUnderScores, ResolveFilePath, ResolveFullPath, ResolveFullSearchSchema, ResolveId, ResolveRelativePath, RootRoute, RootRouteId, Route, RouteById, RouteByPath, RouteConstraints, RouteContext, RouteIds, RouteMatch, RouteMeta, RouteOptions, RoutePathOptions, RoutePathOptionsIntersection, RoutePaths, Router, RouterConstructorOptions, RouterContext, RouterContextOptions, RouterEvent, RouterEvents, RouterHistory, RouterListener, RouterLocation, RouterOptions, RouterState, RoutesById, RoutesByPath, ScrollRestorationOptions, SearchFilter, SearchParamError, SearchParamOptions, SearchParser, SearchSchemaValidator, SearchSchemaValidatorFn, SearchSchemaValidatorObj, SearchSerializer, Segment, Split, StreamedPromise, Timeout, ToIdOption, ToOptions, ToPathOption, Trim, TrimLeft, TrimPath, TrimPathLeft, TrimPathRight, TrimRight, UnionToIntersection, UnloaderFn, UpdatableRouteOptions, Updater, UseLoaderResult, ValueKeys, Values, cleanPath, componentTypes, createBrowserHistory, createHashHistory, createMemoryHistory, decode, defaultParseSearch, defaultStringifySearch, defer, encode, functionalUpdate, interpolatePath, isDehydratedDeferred, isPlainObject, isRedirect, joinPaths, last, lazyFn, matchByPath, matchPathname, parsePathname, parseSearchWith, partialDeepEqual, pick, redirect, replaceEqualDeep, resolvePath, restoreScrollPositions, rootRouteId, stringifySearchWith, trimPath, trimPathLeft, trimPathRight, watchScrollPositions };
|
|
3
|
+
export * from './history';
|
|
4
|
+
export * from './link';
|
|
5
|
+
export * from './path';
|
|
6
|
+
export * from './qss';
|
|
7
|
+
export * from './route';
|
|
8
|
+
export * from './fileRoute';
|
|
9
|
+
export * from './routeInfo';
|
|
10
|
+
export * from './router';
|
|
11
|
+
export * from './searchParams';
|
|
12
|
+
export * from './utils';
|
|
13
|
+
export * from './scroll-restoration';
|
|
14
|
+
export * from './defer';
|