@powerhousedao/connect-core 6.2.3-dev.70 → 6.2.3-dev.71
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/dist/index-PjlUqG36.d.ts +2023 -0
- package/dist/index-PjlUqG36.d.ts.map +1 -0
- package/dist/route-tree.d.ts +36 -2088
- package/dist/route-tree.d.ts.map +1 -1
- package/dist/route-tree.js +18 -106
- package/dist/route-tree.js.map +1 -1
- package/dist/routes/__root.d.ts +25 -0
- package/dist/routes/__root.d.ts.map +1 -0
- package/dist/routes/__root.js +17 -0
- package/dist/routes/__root.js.map +1 -0
- package/dist/routes/_app/$.d.ts +20 -0
- package/dist/routes/_app/$.d.ts.map +1 -0
- package/dist/routes/_app/$.js +17 -0
- package/dist/routes/_app/$.js.map +1 -0
- package/dist/routes/_app/d/$driveSlug/{-$nodeSlug}.d.ts +40 -0
- package/dist/routes/_app/d/$driveSlug/{-$nodeSlug}.d.ts.map +1 -0
- package/dist/routes/_app/d/$driveSlug/{-$nodeSlug}.js +26 -0
- package/dist/routes/_app/d/$driveSlug/{-$nodeSlug}.js.map +1 -0
- package/dist/routes/_app/d/$driveSlug.d.ts +28 -0
- package/dist/routes/_app/d/$driveSlug.d.ts.map +1 -0
- package/dist/routes/_app/d/$driveSlug.js +24 -0
- package/dist/routes/_app/d/$driveSlug.js.map +1 -0
- package/dist/routes/_app/index.d.ts +8 -0
- package/dist/routes/_app/index.d.ts.map +1 -0
- package/dist/routes/_app/index.js +14 -0
- package/dist/routes/_app/index.js.map +1 -0
- package/dist/routes/_app/settings/appearance.d.ts +15 -0
- package/dist/routes/_app/settings/appearance.d.ts.map +1 -0
- package/dist/routes/_app/settings/appearance.js +17 -0
- package/dist/routes/_app/settings/appearance.js.map +1 -0
- package/dist/routes/_app/settings/packages.d.ts +15 -0
- package/dist/routes/_app/settings/packages.d.ts.map +1 -0
- package/dist/routes/_app/settings/packages.js +17 -0
- package/dist/routes/_app/settings/packages.js.map +1 -0
- package/dist/routes/_app/settings.d.ts +25 -0
- package/dist/routes/_app/settings.d.ts.map +1 -0
- package/dist/routes/_app/settings.js +18 -0
- package/dist/routes/_app/settings.js.map +1 -0
- package/dist/routes/_app.d.ts +8 -0
- package/dist/routes/_app.d.ts.map +1 -0
- package/dist/routes/_app.js +14 -0
- package/dist/routes/_app.js.map +1 -0
- package/package.json +13 -9
|
@@ -0,0 +1,2023 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/sieve-cache.d.ts
|
|
2
|
+
type SieveCache<TKey, TValue> = {
|
|
3
|
+
get: (key: TKey) => TValue | undefined;
|
|
4
|
+
set: (key: TKey, value: TValue) => void;
|
|
5
|
+
clear: () => void;
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/validators.d.ts
|
|
9
|
+
interface StandardSchemaValidatorProps<TInput, TOutput> {
|
|
10
|
+
readonly types?: StandardSchemaValidatorTypes<TInput, TOutput> | undefined;
|
|
11
|
+
readonly validate: AnyStandardSchemaValidate;
|
|
12
|
+
}
|
|
13
|
+
interface StandardSchemaValidator<TInput, TOutput> {
|
|
14
|
+
readonly '~standard': StandardSchemaValidatorProps<TInput, TOutput>;
|
|
15
|
+
}
|
|
16
|
+
type AnyStandardSchemaValidator = StandardSchemaValidator<any, any>;
|
|
17
|
+
interface StandardSchemaValidatorTypes<TInput, TOutput> {
|
|
18
|
+
readonly input: TInput;
|
|
19
|
+
readonly output: TOutput;
|
|
20
|
+
}
|
|
21
|
+
interface AnyStandardSchemaValidateSuccess {
|
|
22
|
+
readonly value: any;
|
|
23
|
+
readonly issues?: undefined;
|
|
24
|
+
}
|
|
25
|
+
interface AnyStandardSchemaValidateFailure {
|
|
26
|
+
readonly issues: ReadonlyArray<AnyStandardSchemaValidateIssue>;
|
|
27
|
+
}
|
|
28
|
+
interface AnyStandardSchemaValidateIssue {
|
|
29
|
+
readonly message: string;
|
|
30
|
+
}
|
|
31
|
+
type AnyStandardSchemaValidate = (value: unknown) => (AnyStandardSchemaValidateSuccess | AnyStandardSchemaValidateFailure) | Promise<AnyStandardSchemaValidateSuccess | AnyStandardSchemaValidateFailure>;
|
|
32
|
+
interface ValidatorObj<TInput, TOutput> {
|
|
33
|
+
parse: ValidatorFn<TInput, TOutput>;
|
|
34
|
+
}
|
|
35
|
+
type AnyValidatorObj = ValidatorObj<any, any>;
|
|
36
|
+
interface ValidatorAdapter<TInput, TOutput> {
|
|
37
|
+
types: {
|
|
38
|
+
input: TInput;
|
|
39
|
+
output: TOutput;
|
|
40
|
+
};
|
|
41
|
+
parse: (input: unknown) => TOutput;
|
|
42
|
+
}
|
|
43
|
+
type AnyValidatorAdapter = ValidatorAdapter<any, any>;
|
|
44
|
+
type ValidatorFn<TInput, TOutput> = (input: TInput) => TOutput;
|
|
45
|
+
type Validator<TInput, TOutput> = ValidatorObj<TInput, TOutput> | ValidatorFn<TInput, TOutput> | ValidatorAdapter<TInput, TOutput> | StandardSchemaValidator<TInput, TOutput> | undefined;
|
|
46
|
+
type AnyValidator = Validator<any, any>;
|
|
47
|
+
type AnySchema = {};
|
|
48
|
+
type DefaultValidator = Validator<Record<string, unknown>, AnySchema>;
|
|
49
|
+
type ResolveSearchValidatorInputFn<TValidator> = TValidator extends ((input: infer TSchemaInput) => any) ? TSchemaInput extends SearchSchemaInput ? Omit<TSchemaInput, keyof SearchSchemaInput> : ResolveValidatorOutputFn<TValidator> : AnySchema;
|
|
50
|
+
type ResolveSearchValidatorInput<TValidator> = TValidator extends AnyStandardSchemaValidator ? NonNullable<TValidator['~standard']['types']>['input'] : TValidator extends AnyValidatorAdapter ? TValidator['types']['input'] : TValidator extends AnyValidatorObj ? ResolveSearchValidatorInputFn<TValidator['parse']> : ResolveSearchValidatorInputFn<TValidator>;
|
|
51
|
+
type ResolveValidatorOutputFn<TValidator> = TValidator extends ((...args: any) => infer TSchema) ? TSchema : AnySchema;
|
|
52
|
+
type ResolveValidatorOutput<TValidator> = unknown extends TValidator ? TValidator : TValidator extends AnyStandardSchemaValidator ? NonNullable<TValidator['~standard']['types']>['output'] : TValidator extends AnyValidatorAdapter ? TValidator['types']['output'] : TValidator extends AnyValidatorObj ? ResolveValidatorOutputFn<TValidator['parse']> : ResolveValidatorOutputFn<TValidator>;
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/fileRoute.d.ts
|
|
55
|
+
interface FileRouteTypes {
|
|
56
|
+
fileRoutesByFullPath: any;
|
|
57
|
+
fullPaths: any;
|
|
58
|
+
to: any;
|
|
59
|
+
fileRoutesByTo: any;
|
|
60
|
+
id: any;
|
|
61
|
+
fileRoutesById: any;
|
|
62
|
+
}
|
|
63
|
+
type InferFileRouteTypes<TRouteTree extends AnyRoute> = unknown extends TRouteTree['types']['fileRouteTypes'] ? never : TRouteTree['types']['fileRouteTypes'] extends FileRouteTypes ? TRouteTree['types']['fileRouteTypes'] : never;
|
|
64
|
+
type LazyRouteOptions = Pick<UpdatableRouteOptions<AnyRoute, string, string, AnyPathParams, AnyValidator, {}, AnyContext, AnyContext, AnyContext, AnyContext>, 'component' | 'errorComponent' | 'pendingComponent' | 'notFoundComponent'>;
|
|
65
|
+
interface LazyRoute<in out TRoute extends AnyRoute> {
|
|
66
|
+
options: {
|
|
67
|
+
id: string;
|
|
68
|
+
} & LazyRouteOptions;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ../../node_modules/.pnpm/@tanstack+history@1.162.4/node_modules/@tanstack/history/dist/esm/index.d.ts
|
|
72
|
+
interface NavigateOptions$1 {
|
|
73
|
+
ignoreBlocker?: boolean;
|
|
74
|
+
}
|
|
75
|
+
type SubscriberHistoryAction = {
|
|
76
|
+
type: Exclude<HistoryAction, 'GO'>;
|
|
77
|
+
} | {
|
|
78
|
+
type: 'GO';
|
|
79
|
+
index: number;
|
|
80
|
+
};
|
|
81
|
+
type SubscriberArgs = {
|
|
82
|
+
location: HistoryLocation;
|
|
83
|
+
action: SubscriberHistoryAction;
|
|
84
|
+
};
|
|
85
|
+
interface RouterHistory {
|
|
86
|
+
location: HistoryLocation;
|
|
87
|
+
length: number;
|
|
88
|
+
subscribers: Set<(opts: SubscriberArgs) => void>;
|
|
89
|
+
subscribe: (cb: (opts: SubscriberArgs) => void) => () => void;
|
|
90
|
+
push: (path: string, state?: any, navigateOpts?: NavigateOptions$1) => void;
|
|
91
|
+
replace: (path: string, state?: any, navigateOpts?: NavigateOptions$1) => void;
|
|
92
|
+
go: (index: number, navigateOpts?: NavigateOptions$1) => void;
|
|
93
|
+
back: (navigateOpts?: NavigateOptions$1) => void;
|
|
94
|
+
forward: (navigateOpts?: NavigateOptions$1) => void;
|
|
95
|
+
canGoBack: () => boolean;
|
|
96
|
+
createHref: (href: string) => string;
|
|
97
|
+
block: (blocker: NavigationBlocker) => () => void;
|
|
98
|
+
flush: () => void;
|
|
99
|
+
destroy: () => void;
|
|
100
|
+
notify: (action: SubscriberHistoryAction) => void;
|
|
101
|
+
_getBlockers: () => Array<NavigationBlocker>;
|
|
102
|
+
_ignoreSubscribers?: boolean;
|
|
103
|
+
_ignoreNextBeforeUnload?: (href: string) => void;
|
|
104
|
+
}
|
|
105
|
+
interface HistoryLocation extends ParsedPath {
|
|
106
|
+
state: ParsedHistoryState;
|
|
107
|
+
}
|
|
108
|
+
interface ParsedPath {
|
|
109
|
+
href: string;
|
|
110
|
+
pathname: string;
|
|
111
|
+
search: string;
|
|
112
|
+
hash: string;
|
|
113
|
+
}
|
|
114
|
+
interface HistoryState {}
|
|
115
|
+
type ParsedHistoryState = HistoryState & {
|
|
116
|
+
key?: string;
|
|
117
|
+
__TSR_key?: string;
|
|
118
|
+
__TSR_index: number;
|
|
119
|
+
};
|
|
120
|
+
type ShouldAllowNavigation = any;
|
|
121
|
+
type HistoryAction = 'PUSH' | 'REPLACE' | 'FORWARD' | 'BACK' | 'GO';
|
|
122
|
+
type BlockerFnArgs = {
|
|
123
|
+
currentLocation: HistoryLocation;
|
|
124
|
+
nextLocation: HistoryLocation;
|
|
125
|
+
action: HistoryAction;
|
|
126
|
+
};
|
|
127
|
+
type BlockerFn = (args: BlockerFnArgs) => Promise<ShouldAllowNavigation> | ShouldAllowNavigation;
|
|
128
|
+
type NavigationBlocker = {
|
|
129
|
+
blockerFn: BlockerFn;
|
|
130
|
+
enableBeforeUnload?: (() => boolean) | boolean;
|
|
131
|
+
};
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/utils.d.ts
|
|
134
|
+
type Awaitable<T> = T | Promise<T>;
|
|
135
|
+
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
136
|
+
type PickAsRequired<TValue, TKey extends keyof TValue> = Omit<TValue, TKey> & Required<Pick<TValue, TKey>>;
|
|
137
|
+
type Expand<T> = T extends object ? T extends (infer O) ? O extends Function ? O : { [K in keyof O]: O[K]; } : never : T;
|
|
138
|
+
type MakeDifferenceOptional<TLeft, TRight> = keyof TLeft & keyof TRight extends never ? TRight : Omit<TRight, keyof TLeft & keyof TRight> & { [K in keyof TLeft & keyof TRight]?: TRight[K]; };
|
|
139
|
+
type IsNonEmptyObject<T> = T extends object ? keyof T extends never ? false : true : false;
|
|
140
|
+
type Assign<TLeft, TRight> = TLeft extends any ? TRight extends any ? IsNonEmptyObject<TLeft> extends false ? TRight : IsNonEmptyObject<TRight> extends false ? TLeft : keyof TLeft & keyof TRight extends never ? TLeft & TRight : Omit<TLeft, keyof TRight> & TRight : never : never;
|
|
141
|
+
type IntersectAssign<TLeft, TRight> = TLeft extends any ? TRight extends any ? IsNonEmptyObject<TLeft> extends false ? TRight : IsNonEmptyObject<TRight> extends false ? TLeft : TRight & TLeft : never : never;
|
|
142
|
+
type Updater<TPrevious, TResult = TPrevious> = TResult | ((prev?: TPrevious) => TResult);
|
|
143
|
+
type NonNullableUpdater<TPrevious, TResult = TPrevious> = TResult | ((prev: TPrevious) => TResult);
|
|
144
|
+
type ExtractObjects<TUnion> = TUnion extends MergeAllPrimitive ? never : TUnion;
|
|
145
|
+
type PartialMergeAllObject<TUnion> = ExtractObjects<TUnion> extends (infer TObj) ? [TObj] extends [never] ? never : { [TKey in TObj extends any ? keyof TObj : never]?: TObj extends any ? TKey extends keyof TObj ? TObj[TKey] : never : never; } : never;
|
|
146
|
+
type MergeAllPrimitive = ReadonlyArray<any> | number | string | bigint | boolean | symbol | undefined | null;
|
|
147
|
+
type ExtractPrimitives<TUnion> = TUnion extends MergeAllPrimitive ? TUnion : TUnion extends object ? never : TUnion;
|
|
148
|
+
type PartialMergeAll<TUnion> = ExtractPrimitives<TUnion> | PartialMergeAllObject<TUnion>;
|
|
149
|
+
type Constrain<T, TConstraint, TDefault = TConstraint> = (T extends TConstraint ? T : never) | TDefault;
|
|
150
|
+
type ConstrainLiteral<T, TConstraint, TDefault = TConstraint> = (T & TConstraint) | TDefault;
|
|
151
|
+
type LooseReturnType<T> = T extends ((...args: Array<any>) => infer TReturn) ? TReturn : never;
|
|
152
|
+
type LooseAsyncReturnType<T> = T extends ((...args: Array<any>) => infer TReturn) ? TReturn extends Promise<infer TReturn> ? TReturn : TReturn : never;
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/location.d.ts
|
|
155
|
+
interface ParsedLocation<TSearchObj extends AnySchema = {}> {
|
|
156
|
+
/**
|
|
157
|
+
* The full path of the location, including pathname, search, and hash.
|
|
158
|
+
* Does not include the origin. Is the equivalent of calling
|
|
159
|
+
* `url.replace(url.origin, '')`
|
|
160
|
+
*/
|
|
161
|
+
href: string;
|
|
162
|
+
/**
|
|
163
|
+
* @description The pathname of the location, including the leading slash.
|
|
164
|
+
*/
|
|
165
|
+
pathname: string;
|
|
166
|
+
/**
|
|
167
|
+
* The parsed search parameters of the location in object form.
|
|
168
|
+
*/
|
|
169
|
+
search: TSearchObj;
|
|
170
|
+
/**
|
|
171
|
+
* The search string of the location, including the leading question mark.
|
|
172
|
+
*/
|
|
173
|
+
searchStr: string;
|
|
174
|
+
/**
|
|
175
|
+
* The in-memory state of the location as it *may* exist in the browser's history.
|
|
176
|
+
*/
|
|
177
|
+
state: ParsedHistoryState;
|
|
178
|
+
/**
|
|
179
|
+
* The hash of the location, excluding the leading hash character.
|
|
180
|
+
* (e.g., '123' instead of '#123')
|
|
181
|
+
*/
|
|
182
|
+
hash: string;
|
|
183
|
+
/**
|
|
184
|
+
* The masked location of the location.
|
|
185
|
+
*/
|
|
186
|
+
maskedLocation?: ParsedLocation<TSearchObj>;
|
|
187
|
+
/**
|
|
188
|
+
* Whether to unmask the location on reload.
|
|
189
|
+
*/
|
|
190
|
+
unmaskOnReload?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* @private
|
|
193
|
+
* @description The public href of the location.
|
|
194
|
+
* If a rewrite is applied, the `href` property will be the rewritten URL.
|
|
195
|
+
*/
|
|
196
|
+
publicHref: string;
|
|
197
|
+
/**
|
|
198
|
+
* @private
|
|
199
|
+
* @description Whether the publicHref is external (different origin from rewrite).
|
|
200
|
+
*/
|
|
201
|
+
external: boolean;
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/link.d.ts
|
|
205
|
+
type IsRequiredParams<TParams> = Record<never, never> extends TParams ? never : true;
|
|
206
|
+
interface ParsePathParamsResult<in out TRequired, in out TOptional, in out TRest> {
|
|
207
|
+
required: TRequired;
|
|
208
|
+
optional: TOptional;
|
|
209
|
+
rest: TRest;
|
|
210
|
+
}
|
|
211
|
+
type ParsePathParamsBoundaryStart<T extends string> = T extends `${infer TLeft}{-${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['required'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : T extends `${infer TLeft}{${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'] | ParsePathParams<TRight>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : never;
|
|
212
|
+
type ParsePathParamsSymbol<T extends string> = T extends `${string}$${infer TRight}` ? TRight extends `${string}/${string}` ? TRight extends `${infer TParam}/${infer TRest}` ? TParam extends '' ? ParsePathParamsResult<ParsePathParams<TRest>['required'], '_splat' | ParsePathParams<TRest>['optional'], ParsePathParams<TRest>['rest']> : ParsePathParamsResult<TParam | ParsePathParams<TRest>['required'], ParsePathParams<TRest>['optional'], ParsePathParams<TRest>['rest']> : never : TRight extends '' ? ParsePathParamsResult<never, '_splat', never> : ParsePathParamsResult<TRight, never, never> : never;
|
|
213
|
+
type ParsePathParamsBoundaryEnd<T extends string> = T extends `${infer TLeft}}${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'] | ParsePathParams<TRight>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : never;
|
|
214
|
+
type ParsePathParamsEscapeStart<T extends string> = T extends `${infer TLeft}[${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'] | ParsePathParams<TRight>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : never;
|
|
215
|
+
type ParsePathParamsEscapeEnd<T extends string> = T extends `${string}]${infer TRight}` ? ParsePathParams<TRight> : never;
|
|
216
|
+
type ParsePathParams<T extends string> = T extends `${string}[${string}` ? ParsePathParamsEscapeStart<T> : T extends `${string}]${string}` ? ParsePathParamsEscapeEnd<T> : T extends `${string}}${string}` ? ParsePathParamsBoundaryEnd<T> : T extends `${string}{${string}` ? ParsePathParamsBoundaryStart<T> : T extends `${string}$${string}` ? ParsePathParamsSymbol<T> : never;
|
|
217
|
+
type AddTrailingSlash<T> = T extends `${string}/` ? T : `${T & string}/`;
|
|
218
|
+
type RemoveTrailingSlashes<T> = T & `${string}/` extends never ? T : T extends `${infer R}/` ? R : T;
|
|
219
|
+
type AddLeadingSlash<T> = T & `/${string}` extends never ? `/${T & string}` : T;
|
|
220
|
+
type RemoveLeadingSlashes<T> = T & `/${string}` extends never ? T : T extends `/${infer R}` ? R : T;
|
|
221
|
+
type JoinPath<TLeft extends string, TRight extends string> = TRight extends '' ? TLeft : TLeft extends '' ? TRight : `${RemoveTrailingSlashes<TLeft>}/${RemoveLeadingSlashes<TRight>}`;
|
|
222
|
+
type RemoveLastSegment<T extends string, TAcc extends string = ''> = T extends `${infer TSegment}/${infer TRest}` ? TRest & `${string}/${string}` extends never ? TRest extends '' ? TAcc : `${TAcc}${TSegment}` : RemoveLastSegment<TRest, `${TAcc}${TSegment}/`> : TAcc;
|
|
223
|
+
type ResolveCurrentPath<TFrom extends string, TTo extends string> = TTo extends '.' ? TFrom : TTo extends './' ? AddTrailingSlash<TFrom> : TTo & `./${string}` extends never ? never : TTo extends `./${infer TRest}` ? AddLeadingSlash<JoinPath<TFrom, TRest>> : never;
|
|
224
|
+
type ResolveParentPath<TFrom extends string, TTo extends string> = TTo extends '../' | '..' ? TFrom extends '' | '/' ? never : AddLeadingSlash<RemoveLastSegment<TFrom>> : TTo & `../${string}` extends never ? AddLeadingSlash<JoinPath<TFrom, TTo>> : TFrom extends '' | '/' ? never : TTo extends `../${infer ToRest}` ? ResolveParentPath<RemoveLastSegment<TFrom>, ToRest> : AddLeadingSlash<JoinPath<TFrom, TTo>>;
|
|
225
|
+
type ResolveRelativePath<TFrom, TTo = '.'> = string extends TFrom ? TTo : string extends TTo ? TFrom : undefined extends TTo ? TFrom : TTo extends string ? TFrom extends string ? TTo extends `/${string}` ? TTo : TTo extends `..${string}` ? ResolveParentPath<TFrom, TTo> : TTo extends `.${string}` ? ResolveCurrentPath<TFrom, TTo> : AddLeadingSlash<JoinPath<TFrom, TTo>> : never : never;
|
|
226
|
+
type FindDescendantToPaths<TRouter extends AnyRouter, TPrefix extends string> = `${TPrefix}/${string}` & RouteToPath<TRouter>;
|
|
227
|
+
type InferDescendantToPaths<TRouter extends AnyRouter, TPrefix extends string, TPaths = FindDescendantToPaths<TRouter, TPrefix>> = TPaths extends `${TPrefix}/` ? never : TPaths extends `${TPrefix}/${infer TRest}` ? TRest : never;
|
|
228
|
+
type RelativeToPath<TRouter extends AnyRouter, TTo extends string, TResolvedPath extends string> = (TResolvedPath & RouteToPath<TRouter> extends never ? never : ToPath<TRouter, TTo>) | `${RemoveTrailingSlashes<TTo>}/${InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TResolvedPath>>}`;
|
|
229
|
+
type RelativeToParentPath<TRouter extends AnyRouter, TFrom extends string, TTo extends string, TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>> = RelativeToPath<TRouter, TTo, TResolvedPath> | (TTo extends `${string}..` | `${string}../` ? TResolvedPath extends '/' | '' ? never : FindDescendantToPaths<TRouter, RemoveTrailingSlashes<TResolvedPath>> extends never ? never : `${RemoveTrailingSlashes<TTo>}/${ParentPath<TRouter>}` : never);
|
|
230
|
+
type RelativeToCurrentPath<TRouter extends AnyRouter, TFrom extends string, TTo extends string, TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>> = RelativeToPath<TRouter, TTo, TResolvedPath> | CurrentPath<TRouter>;
|
|
231
|
+
type AbsoluteToPath<TRouter extends AnyRouter, TFrom extends string> = (string extends TFrom ? CurrentPath<TRouter> : TFrom extends `/` ? never : CurrentPath<TRouter>) | (string extends TFrom ? ParentPath<TRouter> : TFrom extends `/` ? never : ParentPath<TRouter>) | RouteToPath<TRouter> | (TFrom extends '/' ? never : string extends TFrom ? never : InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TFrom>>);
|
|
232
|
+
type RelativeToPathAutoComplete<TRouter extends AnyRouter, TFrom extends string, TTo extends string> = string extends TTo ? string : string extends TFrom ? AbsoluteToPath<TRouter, TFrom> : TTo & `..${string}` extends never ? TTo & `.${string}` extends never ? AbsoluteToPath<TRouter, TFrom> : RelativeToCurrentPath<TRouter, TFrom, TTo> : RelativeToParentPath<TRouter, TFrom, TTo>;
|
|
233
|
+
type NavigateOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & NavigateOptionProps;
|
|
234
|
+
/**
|
|
235
|
+
* The NavigateOptions type is used to describe the options that can be used when describing a navigation action in TanStack Router.
|
|
236
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType)
|
|
237
|
+
*/
|
|
238
|
+
interface NavigateOptionProps {
|
|
239
|
+
/**
|
|
240
|
+
* If set to `true`, the router will scroll the element with an id matching the hash into view with default `ScrollIntoViewOptions`.
|
|
241
|
+
* If set to `false`, the router will not scroll the element with an id matching the hash into view.
|
|
242
|
+
* If set to `ScrollIntoViewOptions`, the router will scroll the element with an id matching the hash into view with the provided options.
|
|
243
|
+
* @default true
|
|
244
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#hashscrollintoview)
|
|
245
|
+
* @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)
|
|
246
|
+
*/
|
|
247
|
+
hashScrollIntoView?: boolean | ScrollIntoViewOptions;
|
|
248
|
+
/**
|
|
249
|
+
* `replace` is a boolean that determines whether the navigation should replace the current history entry or push a new one.
|
|
250
|
+
* @default false
|
|
251
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#replace)
|
|
252
|
+
*/
|
|
253
|
+
replace?: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Defaults to `true` so that the scroll position will be reset to 0,0 after the location is committed to the browser history.
|
|
256
|
+
* If `false`, the scroll position will not be reset to 0,0 after the location is committed to history.
|
|
257
|
+
* @default true
|
|
258
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#resetscroll)
|
|
259
|
+
*/
|
|
260
|
+
resetScroll?: boolean;
|
|
261
|
+
/** @deprecated All navigations now use startTransition under the hood */
|
|
262
|
+
startTransition?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* If set to `true`, the router will wrap the resulting navigation in a `document.startViewTransition()` call.
|
|
265
|
+
* If `ViewTransitionOptions`, route navigations will be called using `document.startViewTransition({update, types})`
|
|
266
|
+
* where `types` will be the strings array passed with `ViewTransitionOptions["types"]`.
|
|
267
|
+
* If the browser does not support viewTransition types, the navigation will fall back to normal `document.startTransition()`, same as if `true` was passed.
|
|
268
|
+
*
|
|
269
|
+
* If the browser does not support this api, this option will be ignored.
|
|
270
|
+
* @default false
|
|
271
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#viewtransition)
|
|
272
|
+
* @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition)
|
|
273
|
+
* @see [Google](https://developer.chrome.com/docs/web-platform/view-transitions/same-document#view-transition-types)
|
|
274
|
+
*/
|
|
275
|
+
viewTransition?: boolean | ViewTransitionOptions;
|
|
276
|
+
/**
|
|
277
|
+
* If `true`, navigation will ignore any blockers that might prevent it.
|
|
278
|
+
* @default false
|
|
279
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#ignoreblocker)
|
|
280
|
+
*/
|
|
281
|
+
ignoreBlocker?: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* If `true`, navigation to a route inside of router will trigger a full page load instead of the traditional SPA navigation.
|
|
284
|
+
* @default false
|
|
285
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#reloaddocument)
|
|
286
|
+
*/
|
|
287
|
+
reloadDocument?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* This can be used instead of `to` to navigate to a fully built href, e.g. pointing to an external target.
|
|
290
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
|
|
291
|
+
*/
|
|
292
|
+
href?: string;
|
|
293
|
+
}
|
|
294
|
+
type ToOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = ToSubOptions<TRouter, TFrom, TTo> & MaskOptions<TRouter, TMaskFrom, TMaskTo>;
|
|
295
|
+
interface MaskOptions<in out TRouter extends AnyRouter, in out TMaskFrom extends string, in out TMaskTo extends string> {
|
|
296
|
+
_fromLocation?: ParsedLocation;
|
|
297
|
+
mask?: ToMaskOptions<TRouter, TMaskFrom, TMaskTo>;
|
|
298
|
+
}
|
|
299
|
+
type ToMaskOptions<TRouter extends AnyRouter = RegisteredRouter, TMaskFrom extends string = string, TMaskTo extends string = '.'> = ToSubOptions<TRouter, TMaskFrom, TMaskTo> & {
|
|
300
|
+
unmaskOnReload?: boolean;
|
|
301
|
+
};
|
|
302
|
+
type ToSubOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.'> = ToSubOptionsProps<TRouter, TFrom, TTo> & SearchParamOptions<TRouter, TFrom, TTo> & PathParamOptions<TRouter, TFrom, TTo>;
|
|
303
|
+
interface RequiredToOptions<in out TRouter extends AnyRouter, in out TFrom extends string, in out TTo extends string | undefined> {
|
|
304
|
+
/**
|
|
305
|
+
* The internal route path to navigate to. This should be a relative or absolute path within your application.
|
|
306
|
+
* For external URLs, use the `href` property instead.
|
|
307
|
+
* @example "/dashboard" or "../profile"
|
|
308
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
|
|
309
|
+
*/
|
|
310
|
+
to: ToPathOption<TRouter, TFrom, TTo> & {};
|
|
311
|
+
}
|
|
312
|
+
interface OptionalToOptions<in out TRouter extends AnyRouter, in out TFrom extends string, in out TTo extends string | undefined> {
|
|
313
|
+
/**
|
|
314
|
+
* The internal route path to navigate to. This should be a relative or absolute path within your application.
|
|
315
|
+
* For external URLs, use the `href` property instead.
|
|
316
|
+
* @example "/dashboard" or "../profile"
|
|
317
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
|
|
318
|
+
*/
|
|
319
|
+
to?: ToPathOption<TRouter, TFrom, TTo> & {};
|
|
320
|
+
}
|
|
321
|
+
type MakeToRequired<TRouter extends AnyRouter, TFrom extends string, TTo extends string | undefined> = string extends TFrom ? string extends TTo ? OptionalToOptions<TRouter, TFrom, TTo> : TTo & CatchAllPaths<TRouter> extends never ? RequiredToOptions<TRouter, TFrom, TTo> : OptionalToOptions<TRouter, TFrom, TTo> : OptionalToOptions<TRouter, TFrom, TTo>;
|
|
322
|
+
type ToSubOptionsProps<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string | undefined = '.'> = MakeToRequired<TRouter, TFrom, TTo> & {
|
|
323
|
+
hash?: true | Updater<string>;
|
|
324
|
+
state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>;
|
|
325
|
+
from?: FromPathOption<TRouter, TFrom> & {};
|
|
326
|
+
unsafeRelative?: 'path';
|
|
327
|
+
};
|
|
328
|
+
type ParamsReducerFn<in out TRouter extends AnyRouter, in out TParamVariant extends ParamVariant, in out TFrom, in out TTo> = (current: Expand<ResolveFromParams<TRouter, TParamVariant, TFrom>>) => Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>>;
|
|
329
|
+
type ParamsReducer<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>> | (ParamsReducerFn<TRouter, TParamVariant, TFrom, TTo> & {});
|
|
330
|
+
type ParamVariant = 'PATH' | 'SEARCH';
|
|
331
|
+
type ResolveRoute<TRouter extends AnyRouter, TFrom, TTo, TPath = ResolveRelativePath<TFrom, TTo>> = TPath extends string ? TFrom extends TPath ? RouteByPath<TRouter['routeTree'], TPath> : RouteByToPath<TRouter, TPath> : never;
|
|
332
|
+
type ResolveFromParamType<TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchema';
|
|
333
|
+
type ResolveFromAllParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? AllParams<TRouter['routeTree']> : FullSearchSchema<TRouter['routeTree']>;
|
|
334
|
+
type ResolveFromParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom> = string extends TFrom ? ResolveFromAllParams<TRouter, TParamVariant> : RouteByPath<TRouter['routeTree'], TFrom>['types'][ResolveFromParamType<TParamVariant>];
|
|
335
|
+
type ResolveToParamType<TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchemaInput';
|
|
336
|
+
type ResolveAllToParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? AllParams<TRouter['routeTree']> : FullSearchSchemaInput<TRouter['routeTree']>;
|
|
337
|
+
type ResolveToParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = ResolveRelativePath<TFrom, TTo> extends (infer TPath) ? undefined extends TPath ? never : string extends TPath ? ResolveAllToParams<TRouter, TParamVariant> : TPath extends CatchAllPaths<TRouter> ? ResolveAllToParams<TRouter, TParamVariant> : ResolveRoute<TRouter, TFrom, TTo>['types'][ResolveToParamType<TParamVariant>] : never;
|
|
338
|
+
type ResolveRelativeToParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo, TToParams = ResolveToParams<TRouter, TParamVariant, TFrom, TTo>> = TParamVariant extends 'SEARCH' ? TToParams : string extends TFrom ? TToParams : MakeDifferenceOptional<ResolveFromParams<TRouter, TParamVariant, TFrom>, TToParams>;
|
|
339
|
+
interface MakeOptionalSearchParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
|
|
340
|
+
search?: true | (ParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {});
|
|
341
|
+
}
|
|
342
|
+
interface MakeOptionalPathParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
|
|
343
|
+
params?: true | (ParamsReducer<TRouter, 'PATH', TFrom, TTo> & {});
|
|
344
|
+
}
|
|
345
|
+
type MakeRequiredParamsReducer<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = (string extends TFrom ? never : ResolveFromParams<TRouter, TParamVariant, TFrom> extends ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo> ? true : never) | (ParamsReducer<TRouter, TParamVariant, TFrom, TTo> & {});
|
|
346
|
+
interface MakeRequiredPathParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
|
|
347
|
+
params: MakeRequiredParamsReducer<TRouter, 'PATH', TFrom, TTo> & {};
|
|
348
|
+
}
|
|
349
|
+
interface MakeRequiredSearchParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
|
|
350
|
+
search: MakeRequiredParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {};
|
|
351
|
+
}
|
|
352
|
+
type IsRequired<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = ResolveRelativePath<TFrom, TTo> extends (infer TPath) ? undefined extends TPath ? never : TPath extends CatchAllPaths<TRouter> ? never : IsRequiredParams<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>> : never;
|
|
353
|
+
type SearchParamOptions<TRouter extends AnyRouter, TFrom, TTo> = IsRequired<TRouter, 'SEARCH', TFrom, TTo> extends never ? MakeOptionalSearchParams<TRouter, TFrom, TTo> : MakeRequiredSearchParams<TRouter, TFrom, TTo>;
|
|
354
|
+
type PathParamOptions<TRouter extends AnyRouter, TFrom, TTo> = IsRequired<TRouter, 'PATH', TFrom, TTo> extends never ? MakeOptionalPathParams<TRouter, TFrom, TTo> : MakeRequiredPathParams<TRouter, TFrom, TTo>;
|
|
355
|
+
type ToPathOption<TRouter extends AnyRouter = AnyRouter, TFrom extends string = string, TTo extends string | undefined = string> = ConstrainLiteral<TTo, RelativeToPathAutoComplete<TRouter, NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>>;
|
|
356
|
+
type FromPathOption<TRouter extends AnyRouter, TFrom> = ConstrainLiteral<TFrom, RoutePaths<TRouter['routeTree']>>;
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/routeInfo.d.ts
|
|
359
|
+
type ParseRoute<TRouteTree, TAcc = TRouteTree> = TRouteTree extends {
|
|
360
|
+
types: {
|
|
361
|
+
children: infer TChildren;
|
|
362
|
+
};
|
|
363
|
+
} ? unknown extends TChildren ? TAcc : TChildren extends ReadonlyArray<any> ? ParseRoute<TChildren[number], TAcc | TChildren[number]> : ParseRoute<TChildren[keyof TChildren], TAcc | TChildren[keyof TChildren]> : TAcc;
|
|
364
|
+
type ParseRouteWithoutBranches<TRouteTree> = ParseRoute<TRouteTree> extends (infer TRoute extends AnyRoute) ? TRoute extends any ? unknown extends TRoute['types']['children'] ? TRoute : TRoute['types']['children'] extends ReadonlyArray<any> ? '/' extends TRoute['types']['children'][number]['path'] ? never : TRoute : '/' extends TRoute['types']['children'][keyof TRoute['types']['children']]['path'] ? never : TRoute : never : never;
|
|
365
|
+
type CodeRoutesById<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? { [K in TRoutes as K['id']]: K; } : never;
|
|
366
|
+
type RoutesById<TRouteTree extends AnyRoute> = InferFileRouteTypes<TRouteTree> extends never ? CodeRoutesById<TRouteTree> : InferFileRouteTypes<TRouteTree>['fileRoutesById'];
|
|
367
|
+
type RouteById<TRouteTree extends AnyRoute, TId> = Extract<RoutesById<TRouteTree>[TId & keyof RoutesById<TRouteTree>], AnyRoute>;
|
|
368
|
+
type CodeRouteIds<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? TRoutes['id'] : never;
|
|
369
|
+
type RouteIds<TRouteTree extends AnyRoute> = InferFileRouteTypes<TRouteTree> extends never ? CodeRouteIds<TRouteTree> : InferFileRouteTypes<TRouteTree>['id'];
|
|
370
|
+
type ParentPath<TRouter extends AnyRouter> = TrailingSlashOptionByRouter<TRouter> extends 'always' ? '../' : TrailingSlashOptionByRouter<TRouter> extends 'never' ? '..' : '../' | '..';
|
|
371
|
+
type CurrentPath<TRouter extends AnyRouter> = TrailingSlashOptionByRouter<TRouter> extends 'always' ? './' : TrailingSlashOptionByRouter<TRouter> extends 'never' ? '.' : './' | '.';
|
|
372
|
+
type ToPath<TRouter extends AnyRouter, TTo extends string> = TrailingSlashOptionByRouter<TRouter> extends 'always' ? AddTrailingSlash<TTo> : TrailingSlashOptionByRouter<TRouter> extends 'never' ? RemoveTrailingSlashes<TTo> : AddTrailingSlash<TTo> | RemoveTrailingSlashes<TTo>;
|
|
373
|
+
type CatchAllPaths<TRouter extends AnyRouter> = CurrentPath<TRouter> | ParentPath<TRouter>;
|
|
374
|
+
type CodeRoutesByPath<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? { [K in TRoutes as K['fullPath']]: K; } : never;
|
|
375
|
+
type RoutesByPath<TRouteTree extends AnyRoute> = InferFileRouteTypes<TRouteTree> extends never ? CodeRoutesByPath<TRouteTree> : InferFileRouteTypes<TRouteTree>['fileRoutesByFullPath'];
|
|
376
|
+
type RouteByPath<TRouteTree extends AnyRoute, TPath> = Extract<RoutesByPath<TRouteTree>[TPath & keyof RoutesByPath<TRouteTree>], AnyRoute>;
|
|
377
|
+
type CodeRoutePaths<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? TRoutes['fullPath'] : never;
|
|
378
|
+
type RoutePaths<TRouteTree extends AnyRoute> = unknown extends TRouteTree ? string : (InferFileRouteTypes<TRouteTree> extends never ? CodeRoutePaths<TRouteTree> : InferFileRouteTypes<TRouteTree>['fullPaths']) | '/';
|
|
379
|
+
type RouteToPathAlwaysTrailingSlash<TRoute extends AnyRoute> = TRoute['path'] extends '/' ? TRoute['fullPath'] : TRoute['fullPath'] extends '/' ? TRoute['fullPath'] : `${TRoute['fullPath']}/`;
|
|
380
|
+
type RouteToPathNeverTrailingSlash<TRoute extends AnyRoute> = TRoute['path'] extends '/' ? TRoute['fullPath'] extends '/' ? TRoute['fullPath'] : RemoveTrailingSlashes<TRoute['fullPath']> : TRoute['fullPath'];
|
|
381
|
+
type RouteToPathPreserveTrailingSlash<TRoute extends AnyRoute> = RouteToPathNeverTrailingSlash<TRoute> | RouteToPathAlwaysTrailingSlash<TRoute>;
|
|
382
|
+
type RouteToPathByTrailingSlashOption<TRoute extends AnyRoute> = {
|
|
383
|
+
always: RouteToPathAlwaysTrailingSlash<TRoute>;
|
|
384
|
+
preserve: RouteToPathPreserveTrailingSlash<TRoute>;
|
|
385
|
+
never: RouteToPathNeverTrailingSlash<TRoute>;
|
|
386
|
+
};
|
|
387
|
+
type TrailingSlashOptionByRouter<TRouter extends AnyRouter> = TrailingSlashOption extends TRouter['options']['trailingSlash'] ? 'never' : NonNullable<TRouter['options']['trailingSlash']>;
|
|
388
|
+
type RouteToByRouter<TRouter extends AnyRouter, TRoute extends AnyRoute> = RouteToPathByTrailingSlashOption<TRoute>[TrailingSlashOptionByRouter<TRouter>];
|
|
389
|
+
type CodeRouteToPath<TRouter extends AnyRouter> = ParseRouteWithoutBranches<TRouter['routeTree']> extends (infer TRoute extends AnyRoute) ? TRoute extends any ? RouteToByRouter<TRouter, TRoute> : never : never;
|
|
390
|
+
type FileRouteToPath<TRouter extends AnyRouter, TTo = InferFileRouteTypes<TRouter['routeTree']>['to'], TTrailingSlashOption = TrailingSlashOptionByRouter<TRouter>> = 'never' extends TTrailingSlashOption ? TTo : 'always' extends TTrailingSlashOption ? AddTrailingSlash<TTo> : TTo | AddTrailingSlash<TTo>;
|
|
391
|
+
type RouteToPath<TRouter extends AnyRouter> = unknown extends TRouter ? string : InferFileRouteTypes<TRouter['routeTree']> extends never ? CodeRouteToPath<TRouter> : FileRouteToPath<TRouter>;
|
|
392
|
+
type CodeRoutesByToPath<TRouter extends AnyRouter> = ParseRouteWithoutBranches<TRouter['routeTree']> extends (infer TRoutes extends AnyRoute) ? { [TRoute in TRoutes as RouteToByRouter<TRouter, TRoute>]: TRoute; } : never;
|
|
393
|
+
type RoutesByToPath<TRouter extends AnyRouter> = InferFileRouteTypes<TRouter['routeTree']> extends never ? CodeRoutesByToPath<TRouter> : InferFileRouteTypes<TRouter['routeTree']>['fileRoutesByTo'];
|
|
394
|
+
type CodeRouteByToPath<TRouter extends AnyRouter, TTo> = Extract<RoutesByToPath<TRouter>[TTo & keyof RoutesByToPath<TRouter>], AnyRoute>;
|
|
395
|
+
type FileRouteByToPath<TRouter extends AnyRouter, TTo> = 'never' extends TrailingSlashOptionByRouter<TRouter> ? CodeRouteByToPath<TRouter, TTo> : 'always' extends TrailingSlashOptionByRouter<TRouter> ? TTo extends '/' ? CodeRouteByToPath<TRouter, TTo> : TTo extends `${infer TPath}/` ? CodeRouteByToPath<TRouter, TPath> : never : CodeRouteByToPath<TRouter, TTo extends '/' ? TTo : RemoveTrailingSlashes<TTo>>;
|
|
396
|
+
type RouteByToPath<TRouter extends AnyRouter, TTo> = InferFileRouteTypes<TRouter['routeTree']> extends never ? CodeRouteByToPath<TRouter, TTo> : FileRouteByToPath<TRouter, TTo>;
|
|
397
|
+
type FullSearchSchema<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? PartialMergeAll<TRoutes['types']['fullSearchSchema']> : never;
|
|
398
|
+
type FullSearchSchemaInput<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? PartialMergeAll<TRoutes['types']['fullSearchSchemaInput']> : never;
|
|
399
|
+
type AllParams<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? PartialMergeAll<TRoutes['types']['allParams']> : never;
|
|
400
|
+
type AllContext<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? PartialMergeAll<TRoutes['types']['allContext']> : never;
|
|
401
|
+
type AllLoaderData<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? PartialMergeAll<TRoutes['types']['loaderData']> : never;
|
|
402
|
+
//#endregion
|
|
403
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/not-found.d.ts
|
|
404
|
+
type NotFoundError = {
|
|
405
|
+
/**
|
|
406
|
+
@deprecated
|
|
407
|
+
Use `routeId: rootRouteId` instead
|
|
408
|
+
*/
|
|
409
|
+
global?: boolean;
|
|
410
|
+
/**
|
|
411
|
+
@private
|
|
412
|
+
Do not use this. It's used internally to indicate a path matching error
|
|
413
|
+
*/
|
|
414
|
+
_global?: boolean;
|
|
415
|
+
data?: any;
|
|
416
|
+
throw?: boolean;
|
|
417
|
+
routeId?: RouteIds<RegisteredRouter['routeTree']>;
|
|
418
|
+
headers?: HeadersInit;
|
|
419
|
+
};
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts
|
|
422
|
+
type AnyRedirect = Redirect<any, any, any, any, any>;
|
|
423
|
+
/**
|
|
424
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
|
|
425
|
+
*/
|
|
426
|
+
type Redirect<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = Response & {
|
|
427
|
+
options: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>;
|
|
428
|
+
};
|
|
429
|
+
type RedirectOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = {
|
|
430
|
+
href?: string;
|
|
431
|
+
/**
|
|
432
|
+
* @deprecated Use `statusCode` instead
|
|
433
|
+
**/
|
|
434
|
+
code?: number;
|
|
435
|
+
/**
|
|
436
|
+
* The HTTP status code to use when redirecting.
|
|
437
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#statuscode-property)
|
|
438
|
+
*/
|
|
439
|
+
statusCode?: number;
|
|
440
|
+
/**
|
|
441
|
+
* If provided, will throw the redirect object instead of returning it. This can be useful in places where `throwing` in a function might cause it to have a return type of `never`. In that case, you can use `redirect({ throw: true })` to throw the redirect object instead of returning it.
|
|
442
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#throw-property)
|
|
443
|
+
*/
|
|
444
|
+
throw?: any;
|
|
445
|
+
/**
|
|
446
|
+
* The HTTP headers to use when redirecting.
|
|
447
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#headers-property)
|
|
448
|
+
*/
|
|
449
|
+
headers?: HeadersInit;
|
|
450
|
+
} & NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>;
|
|
451
|
+
/**
|
|
452
|
+
* Options for route-bound redirect, where 'from' is automatically set.
|
|
453
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
|
|
454
|
+
*/
|
|
455
|
+
type RedirectOptionsRoute<TDefaultFrom extends string = string, TRouter extends AnyRouter = RegisteredRouter, TTo extends string | undefined = undefined, TMaskTo extends string = ''> = Omit<RedirectOptions<TRouter, TDefaultFrom, TTo, TDefaultFrom, TMaskTo>, 'from'>;
|
|
456
|
+
/**
|
|
457
|
+
* A redirect function bound to a specific route, with 'from' pre-set to the route's fullPath.
|
|
458
|
+
* This enables relative redirects like `Route.redirect({ to: './overview' })`.
|
|
459
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
|
|
460
|
+
*/
|
|
461
|
+
interface RedirectFnRoute<in out TDefaultFrom extends string = string> {
|
|
462
|
+
<TRouter extends AnyRouter = RegisteredRouter, const TTo extends string | undefined = undefined, const TMaskTo extends string = ''>(opts: RedirectOptionsRoute<TDefaultFrom, TRouter, TTo, TMaskTo>): Redirect<TRouter, TDefaultFrom, TTo, TDefaultFrom, TMaskTo>;
|
|
463
|
+
}
|
|
464
|
+
//#endregion
|
|
465
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/Matches.d.ts
|
|
466
|
+
interface DefaultRouteMatchExtensions {
|
|
467
|
+
scripts?: unknown;
|
|
468
|
+
links?: unknown;
|
|
469
|
+
headScripts?: unknown;
|
|
470
|
+
meta?: unknown;
|
|
471
|
+
styles?: unknown;
|
|
472
|
+
}
|
|
473
|
+
interface RouteMatchExtensions extends DefaultRouteMatchExtensions {}
|
|
474
|
+
interface RouteMatch$1<out TRouteId, out TFullPath, out TAllParams, out TFullSearchSchema, out TLoaderData, out TAllContext, out TLoaderDeps> extends RouteMatchExtensions {
|
|
475
|
+
id: string;
|
|
476
|
+
routeId: TRouteId;
|
|
477
|
+
fullPath: TFullPath;
|
|
478
|
+
index: number;
|
|
479
|
+
pathname: string;
|
|
480
|
+
params: TAllParams;
|
|
481
|
+
_strictParams: TAllParams;
|
|
482
|
+
status: 'pending' | 'success' | 'error' | 'notFound';
|
|
483
|
+
isFetching: false | 'beforeLoad' | 'loader';
|
|
484
|
+
error: unknown;
|
|
485
|
+
paramsError: unknown;
|
|
486
|
+
searchError: unknown;
|
|
487
|
+
updatedAt: number;
|
|
488
|
+
loaderData?: TLoaderData;
|
|
489
|
+
context: TAllContext;
|
|
490
|
+
search: TFullSearchSchema;
|
|
491
|
+
_strictSearch: TFullSearchSchema;
|
|
492
|
+
abortController: AbortController;
|
|
493
|
+
cause: 'preload' | 'enter' | 'stay';
|
|
494
|
+
loaderDeps: TLoaderDeps;
|
|
495
|
+
preload: boolean;
|
|
496
|
+
invalid: boolean;
|
|
497
|
+
headers?: Record<string, string>;
|
|
498
|
+
_notFound?: boolean;
|
|
499
|
+
staticData: StaticDataRouteOption;
|
|
500
|
+
/** This attribute is not reactive */
|
|
501
|
+
ssr?: SSROption;
|
|
502
|
+
}
|
|
503
|
+
interface PreValidationErrorHandlingRouteMatch<TRouteId, TFullPath, TAllParams, TFullSearchSchema> {
|
|
504
|
+
id: string;
|
|
505
|
+
routeId: TRouteId;
|
|
506
|
+
fullPath: TFullPath;
|
|
507
|
+
index: number;
|
|
508
|
+
pathname: string;
|
|
509
|
+
search: {
|
|
510
|
+
status: 'success';
|
|
511
|
+
value: TFullSearchSchema;
|
|
512
|
+
} | {
|
|
513
|
+
status: 'error';
|
|
514
|
+
error: unknown;
|
|
515
|
+
};
|
|
516
|
+
params: {
|
|
517
|
+
status: 'success';
|
|
518
|
+
value: TAllParams;
|
|
519
|
+
} | {
|
|
520
|
+
status: 'error';
|
|
521
|
+
error: unknown;
|
|
522
|
+
};
|
|
523
|
+
staticData: StaticDataRouteOption;
|
|
524
|
+
ssr?: boolean | 'data-only';
|
|
525
|
+
}
|
|
526
|
+
type MakePreValidationErrorHandlingRouteMatchUnion<TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>> = TRoute extends any ? PreValidationErrorHandlingRouteMatch<TRoute['id'], TRoute['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema']> : never;
|
|
527
|
+
type MakeRouteMatchFromRoute<TRoute extends AnyRoute> = RouteMatch$1<TRoute['types']['id'], TRoute['types']['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps']>;
|
|
528
|
+
type MakeRouteMatch<TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TRouteId = RouteIds<TRouteTree>, TStrict extends boolean = true> = RouteMatch$1<TRouteId, RouteById<TRouteTree, TRouteId>['types']['fullPath'], TStrict extends false ? AllParams<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['allParams'], TStrict extends false ? FullSearchSchema<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['fullSearchSchema'], TStrict extends false ? AllLoaderData<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['loaderData'], TStrict extends false ? AllContext<TRouteTree> : RouteById<TRouteTree, TRouteId>['types']['allContext'], RouteById<TRouteTree, TRouteId>['types']['loaderDeps']>;
|
|
529
|
+
type AnyRouteMatch = RouteMatch$1<any, any, any, any, any, any, any>;
|
|
530
|
+
type MakeRouteMatchUnion<TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute<TRouter['routeTree']>> = TRoute extends any ? RouteMatch$1<TRoute['id'], TRoute['fullPath'], TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps']> : never;
|
|
531
|
+
/**
|
|
532
|
+
* The `MatchRouteOptions` type is used to describe the options that can be used when matching a route.
|
|
533
|
+
*
|
|
534
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#matchrouteoptions-type)
|
|
535
|
+
*/
|
|
536
|
+
interface MatchRouteOptions {
|
|
537
|
+
/**
|
|
538
|
+
* If `true`, will match against pending location instead of the current location.
|
|
539
|
+
*
|
|
540
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#pending-property)
|
|
541
|
+
*/
|
|
542
|
+
pending?: boolean;
|
|
543
|
+
/**
|
|
544
|
+
* If `true`, will match against the current location with case sensitivity.
|
|
545
|
+
*
|
|
546
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#casesensitive-property)
|
|
547
|
+
*
|
|
548
|
+
* @deprecated Declare case sensitivity in the route definition instead, or globally for all routes using the `caseSensitive` option on the router.
|
|
549
|
+
*/
|
|
550
|
+
caseSensitive?: boolean;
|
|
551
|
+
/**
|
|
552
|
+
* If `true`, will match against the current location's search params using a deep inclusive check. e.g. `{ a: 1 }` will match for a current location of `{ a: 1, b: 2 }`.
|
|
553
|
+
*
|
|
554
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#includesearch-property)
|
|
555
|
+
*/
|
|
556
|
+
includeSearch?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* If `true`, will match against the current location using a fuzzy match. e.g. `/posts` will match for a current location of `/posts/123`.
|
|
559
|
+
*
|
|
560
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/MatchRouteOptionsType#fuzzy-property)
|
|
561
|
+
*/
|
|
562
|
+
fuzzy?: boolean;
|
|
563
|
+
}
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/root.d.ts
|
|
566
|
+
/** Stable identifier used for the root route in a route tree. */
|
|
567
|
+
declare const rootRouteId = "__root__";
|
|
568
|
+
type RootRouteId = typeof rootRouteId;
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/RouterProvider.d.ts
|
|
571
|
+
interface CommitLocationOptions {
|
|
572
|
+
replace?: boolean;
|
|
573
|
+
resetScroll?: boolean;
|
|
574
|
+
hashScrollIntoView?: boolean | ScrollIntoViewOptions;
|
|
575
|
+
viewTransition?: boolean | ViewTransitionOptions;
|
|
576
|
+
/**
|
|
577
|
+
* @deprecated All navigations use transitions under the hood now
|
|
578
|
+
**/
|
|
579
|
+
startTransition?: boolean;
|
|
580
|
+
ignoreBlocker?: boolean;
|
|
581
|
+
}
|
|
582
|
+
type NavigateFn = <TRouter extends RegisteredRouter, TTo extends string | undefined, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, TMaskTo extends string = ''>(opts: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => Promise<void>;
|
|
583
|
+
type BuildLocationFn = <TRouter extends RegisteredRouter, TTo extends string | undefined, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TMaskFrom extends RoutePaths<TRouter['routeTree']> | string = TFrom, TMaskTo extends string = ''>(opts: ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {
|
|
584
|
+
leaveParams?: boolean;
|
|
585
|
+
_includeValidateSearch?: boolean;
|
|
586
|
+
_isNavigate?: boolean;
|
|
587
|
+
}) => ParsedLocation;
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/RawStream.d.ts
|
|
590
|
+
type RawStreamHint = 'binary' | 'text';
|
|
591
|
+
interface RawStreamOptions {
|
|
592
|
+
/**
|
|
593
|
+
* Encoding hint for JSON and SSR serialization.
|
|
594
|
+
* - 'binary' (default): Always use base64 encoding
|
|
595
|
+
* - 'text': Try UTF-8 first, fallback to base64 for invalid UTF-8 chunks
|
|
596
|
+
*/
|
|
597
|
+
hint?: RawStreamHint;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Marker class for ReadableStream<Uint8Array> that should be serialized
|
|
601
|
+
* with base64/text encoding (JSON and SSR) or binary framing
|
|
602
|
+
* (server-function responses).
|
|
603
|
+
*
|
|
604
|
+
* Wrap your binary streams with this to get efficient serialization:
|
|
605
|
+
* ```ts
|
|
606
|
+
* // For binary data (files, images, etc.)
|
|
607
|
+
* return { data: new RawStream(file.stream()) }
|
|
608
|
+
*
|
|
609
|
+
* // For text-heavy data (RSC payloads, etc.)
|
|
610
|
+
* return { data: new RawStream(rscStream, { hint: 'text' }) }
|
|
611
|
+
* ```
|
|
612
|
+
*
|
|
613
|
+
* RawStreams returned from one server function share one ordered response.
|
|
614
|
+
* Arbitrary or sequential consumption can require potentially unbounded client
|
|
615
|
+
* buffering for unread data. Cancelling one RawStream discards it locally;
|
|
616
|
+
* abort the whole server-function call to cancel the response and server work.
|
|
617
|
+
* Consume streams concurrently, cancel unused streams promptly, or use separate
|
|
618
|
+
* calls when independent backpressure is required.
|
|
619
|
+
*/
|
|
620
|
+
declare class RawStream {
|
|
621
|
+
readonly stream: ReadableStream<Uint8Array>;
|
|
622
|
+
readonly hint: RawStreamHint;
|
|
623
|
+
constructor(stream: ReadableStream<Uint8Array>, options?: RawStreamOptions);
|
|
624
|
+
}
|
|
625
|
+
//#endregion
|
|
626
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/transformer.d.ts
|
|
627
|
+
declare const TSR_SERIALIZABLE: unique symbol;
|
|
628
|
+
type TSR_SERIALIZABLE = typeof TSR_SERIALIZABLE;
|
|
629
|
+
type TsrSerializable = {
|
|
630
|
+
[TSR_SERIALIZABLE]: true;
|
|
631
|
+
};
|
|
632
|
+
interface DefaultSerializable {
|
|
633
|
+
number: number;
|
|
634
|
+
string: string;
|
|
635
|
+
boolean: boolean;
|
|
636
|
+
null: null;
|
|
637
|
+
undefined: undefined;
|
|
638
|
+
bigint: bigint;
|
|
639
|
+
Date: Date;
|
|
640
|
+
Uint8Array: Uint8Array;
|
|
641
|
+
RawStream: RawStream;
|
|
642
|
+
TsrSerializable: TsrSerializable;
|
|
643
|
+
void: void;
|
|
644
|
+
}
|
|
645
|
+
interface SerializableExtensions extends DefaultSerializable {}
|
|
646
|
+
type Serializable = SerializableExtensions[keyof SerializableExtensions];
|
|
647
|
+
type UnionizeSerializationAdaptersInput<TAdapters extends ReadonlyArray<AnySerializationAdapter>> = TAdapters[number]['~types']['input'];
|
|
648
|
+
type ValidateSerializable<T, TSerializable> = T extends TSerializable ? T : T extends ((...args: Array<any>) => any) ? SerializationError<'Function may not be serializable'> : T extends RegisteredReadableStream ? SerializationError<'JSX is not be serializable'> : T extends ReadonlyArray<any> ? ValidateSerializableArray<T, TSerializable> : T extends Promise<any> ? ValidateSerializablePromise<T, TSerializable> : T extends ReadableStream<any> ? ValidateReadableStream<T, TSerializable> : T extends Set<any> ? ValidateSerializableSet<T, TSerializable> : T extends Map<any, any> ? ValidateSerializableMap<T, TSerializable> : T extends AsyncGenerator<any, any> ? ValidateSerializableAsyncGenerator<T, TSerializable> : T extends object ? ValidateSerializableMapped<T, TSerializable> : SerializationError<'Type may not be serializable'>;
|
|
649
|
+
type ValidateSerializableAsyncGenerator<T, TSerializable> = T extends AsyncGenerator<infer T, infer TReturn, infer TNext> ? AsyncGenerator<ValidateSerializable<T, TSerializable>, ValidateSerializable<TReturn, TSerializable>, TNext> : never;
|
|
650
|
+
type ValidateSerializablePromise<T, TSerializable> = T extends Promise<infer TAwaited> ? Promise<ValidateSerializable<TAwaited, TSerializable>> : never;
|
|
651
|
+
type ValidateReadableStream<T, TSerializable> = T extends ReadableStream<infer TStreamed> ? ReadableStream<ValidateSerializable<TStreamed, TSerializable>> : never;
|
|
652
|
+
type ValidateSerializableSet<T, TSerializable> = T extends Set<infer TItem> ? Set<ValidateSerializable<TItem, TSerializable>> : never;
|
|
653
|
+
type ValidateSerializableMap<T, TSerializable> = T extends Map<infer TKey, infer TValue> ? Map<ValidateSerializable<TKey, TSerializable>, ValidateSerializable<TValue, TSerializable>> : never;
|
|
654
|
+
type ValidateSerializableArray<T, TSerializable> = T extends readonly [any, ...Array<any>] ? ValidateSerializableMapped<T, TSerializable> : T extends Array<infer U> ? Array<ValidateSerializable<U, TSerializable>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<ValidateSerializable<U, TSerializable>> : never;
|
|
655
|
+
type ValidateSerializableMapped<T, TSerializable> = { [K in keyof T]: ValidateSerializable<T[K], TSerializable>; };
|
|
656
|
+
declare const SERIALIZATION_ERROR: unique symbol;
|
|
657
|
+
interface SerializationError<in out TMessage extends string> {
|
|
658
|
+
[SERIALIZATION_ERROR]: TMessage;
|
|
659
|
+
}
|
|
660
|
+
interface SerializationAdapter<TInput, TOutput, TExtendsAdapters extends ReadonlyArray<AnySerializationAdapter>> {
|
|
661
|
+
'~types': SerializationAdapterTypes<TInput, TOutput, TExtendsAdapters>;
|
|
662
|
+
key: string;
|
|
663
|
+
extends?: TExtendsAdapters;
|
|
664
|
+
test: (value: unknown) => value is TInput;
|
|
665
|
+
toSerializable: (value: TInput) => TOutput;
|
|
666
|
+
fromSerializable: (value: TOutput) => TInput;
|
|
667
|
+
}
|
|
668
|
+
interface SerializationAdapterTypes<TInput, TOutput, TExtendsAdapters extends ReadonlyArray<AnySerializationAdapter>> {
|
|
669
|
+
input: TInput | UnionizeSerializationAdaptersInput<TExtendsAdapters>;
|
|
670
|
+
output: TOutput;
|
|
671
|
+
extends: TExtendsAdapters;
|
|
672
|
+
}
|
|
673
|
+
type AnySerializationAdapter = SerializationAdapter<any, any, any>;
|
|
674
|
+
type ValidateSerializableInput<TRegister, T> = ValidateSerializable<T, RegisteredSerializableInput<TRegister>>;
|
|
675
|
+
type RegisteredSerializableInput<TRegister> = (unknown extends RegisteredSerializationAdapters<TRegister> ? never : RegisteredSerializationAdapters<TRegister> extends ReadonlyArray<AnySerializationAdapter> ? RegisteredSerializationAdapters<TRegister>[number]['~types']['input'] : never) | Serializable;
|
|
676
|
+
type RegisteredSerializationAdapters<TRegister> = RegisteredConfigType<TRegister, 'serializationAdapters'>;
|
|
677
|
+
type RegisteredSSROption<TRegister> = unknown extends RegisteredConfigType<TRegister, 'defaultSsr'> ? SSROption : RegisteredConfigType<TRegister, 'defaultSsr'>;
|
|
678
|
+
type ValidateSerializableLifecycleResult<TRegister, TParentRoute extends AnyRoute, TSSR, TFn> = false extends RegisteredSsr<TRegister> ? any : ValidateSerializableLifecycleResultSSR<TRegister, TParentRoute, TSSR, TFn> extends (infer TInput) ? TInput : never;
|
|
679
|
+
type ValidateSerializableLifecycleResultSSR<TRegister, TParentRoute extends AnyRoute, TSSR, TFn> = ResolveAllSSR<TParentRoute, TSSR> extends false ? any : RegisteredSSROption<TRegister> extends false ? any : ValidateSerializableInput<TRegister, LooseReturnType<TFn>>;
|
|
680
|
+
type RegisteredReadableStream = unknown extends SerializerExtensions['ReadableStream'] ? never : SerializerExtensions['ReadableStream'];
|
|
681
|
+
interface DefaultSerializerExtensions {
|
|
682
|
+
ReadableStream: unknown;
|
|
683
|
+
}
|
|
684
|
+
interface SerializerExtensions extends DefaultSerializerExtensions {}
|
|
685
|
+
//#endregion
|
|
686
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/route.d.ts
|
|
687
|
+
type AnyPathParams = {};
|
|
688
|
+
type SearchSchemaInput = {
|
|
689
|
+
__TSearchSchemaInput__: 'TSearchSchemaInput';
|
|
690
|
+
};
|
|
691
|
+
type AnyContext = {};
|
|
692
|
+
type RoutePathOptions<TCustomId, TPath> = {
|
|
693
|
+
path: TPath;
|
|
694
|
+
} | {
|
|
695
|
+
id: TCustomId;
|
|
696
|
+
};
|
|
697
|
+
interface StaticDataRouteOption {}
|
|
698
|
+
type SearchFilter<TInput, TResult = TInput> = (prev: TInput) => TResult;
|
|
699
|
+
type SearchMiddlewareMeta = {
|
|
700
|
+
removed?: Map<string, unknown>;
|
|
701
|
+
removedAny?: Set<string>;
|
|
702
|
+
defaulted?: Map<string, unknown>;
|
|
703
|
+
explicit?: unknown;
|
|
704
|
+
};
|
|
705
|
+
type SearchMiddlewareContext<TSearchSchema> = {
|
|
706
|
+
search: TSearchSchema;
|
|
707
|
+
next: (newSearch: TSearchSchema) => TSearchSchema;
|
|
708
|
+
meta?: SearchMiddlewareMeta;
|
|
709
|
+
};
|
|
710
|
+
type SearchMiddleware<TSearchSchema> = (ctx: SearchMiddlewareContext<TSearchSchema>) => TSearchSchema;
|
|
711
|
+
type InferFullSearchSchema<TRoute> = TRoute extends {
|
|
712
|
+
types: {
|
|
713
|
+
fullSearchSchema: infer TFullSearchSchema;
|
|
714
|
+
};
|
|
715
|
+
} ? TFullSearchSchema : {};
|
|
716
|
+
type InferFullSearchSchemaInput<TRoute> = TRoute extends {
|
|
717
|
+
types: {
|
|
718
|
+
fullSearchSchemaInput: infer TFullSearchSchemaInput;
|
|
719
|
+
};
|
|
720
|
+
} ? TFullSearchSchemaInput : {};
|
|
721
|
+
type InferAllParams<TRoute> = TRoute extends {
|
|
722
|
+
types: {
|
|
723
|
+
allParams: infer TAllParams;
|
|
724
|
+
};
|
|
725
|
+
} ? TAllParams : {};
|
|
726
|
+
type InferAllContext<TRoute> = unknown extends TRoute ? TRoute : TRoute extends {
|
|
727
|
+
types: {
|
|
728
|
+
allContext: infer TAllContext;
|
|
729
|
+
};
|
|
730
|
+
} ? TAllContext : {};
|
|
731
|
+
type ResolveRequiredParams<TPath extends string, T> = { [K in ParsePathParams<TPath>['required']]: T; };
|
|
732
|
+
type ResolveOptionalParams<TPath extends string, T> = { [K in ParsePathParams<TPath>['optional']]?: T | undefined; };
|
|
733
|
+
type ResolveParams<TPath extends string, T = string> = ResolveRequiredParams<TPath, T> & ResolveOptionalParams<TPath, T>;
|
|
734
|
+
type ParseParamsFn<in out TPath extends string, in out TParams> = (rawParams: Expand<ResolveParams<TPath>>) => TParams | false;
|
|
735
|
+
type ValidateParsedParams<TPath extends string, TParams> = [TParams] extends [ResolveParams<TPath, any>] ? unknown : never;
|
|
736
|
+
type StringifyParamsFn<in out TPath extends string, in out TParams> = (params: TParams) => ResolveParams<TPath>;
|
|
737
|
+
type ParamsOptions<in out TPath extends string, in out TParams> = {
|
|
738
|
+
params?: {
|
|
739
|
+
parse?: ParseParamsFn<TPath, TParams> & ValidateParsedParams<TPath, TParams>;
|
|
740
|
+
/**
|
|
741
|
+
* When multiple route candidates use `params.parse` during matching,
|
|
742
|
+
* higher priorities are tried first.
|
|
743
|
+
*
|
|
744
|
+
* @default 0
|
|
745
|
+
*/
|
|
746
|
+
priority?: number;
|
|
747
|
+
stringify?: StringifyParamsFn<TPath, TParams>;
|
|
748
|
+
};
|
|
749
|
+
/**
|
|
750
|
+
@deprecated Use params.parse instead
|
|
751
|
+
*/
|
|
752
|
+
parseParams?: ParseParamsFn<TPath, TParams> & ValidateParsedParams<TPath, TParams>;
|
|
753
|
+
/**
|
|
754
|
+
@deprecated Use params.stringify instead
|
|
755
|
+
*/
|
|
756
|
+
stringifyParams?: StringifyParamsFn<TPath, TParams>;
|
|
757
|
+
};
|
|
758
|
+
interface RequiredStaticDataRouteOption {
|
|
759
|
+
staticData: StaticDataRouteOption;
|
|
760
|
+
}
|
|
761
|
+
interface OptionalStaticDataRouteOption {
|
|
762
|
+
staticData?: StaticDataRouteOption;
|
|
763
|
+
}
|
|
764
|
+
type UpdatableStaticRouteOption = {} extends StaticDataRouteOption ? OptionalStaticDataRouteOption : RequiredStaticDataRouteOption;
|
|
765
|
+
type TrimPathRight<T extends string> = T extends '/' ? '/' : T extends `${infer U}/` ? TrimPathRight<U> : T;
|
|
766
|
+
type ContextReturnType<TContextFn> = unknown extends TContextFn ? TContextFn : LooseReturnType<TContextFn> extends never ? AnyContext : LooseReturnType<TContextFn>;
|
|
767
|
+
type ContextAsyncReturnType<TContextFn> = unknown extends TContextFn ? TContextFn : LooseAsyncReturnType<TContextFn> extends never ? AnyContext : LooseAsyncReturnType<TContextFn>;
|
|
768
|
+
type ResolveRouteContext<TRouteContextFn, TBeforeLoadFn> = Assign<ContextReturnType<TRouteContextFn>, ContextAsyncReturnType<TBeforeLoadFn>>;
|
|
769
|
+
type ResolveRouteLoaderFn<TLoaderFn> = TLoaderFn extends {
|
|
770
|
+
handler: infer THandler;
|
|
771
|
+
} ? THandler : TLoaderFn;
|
|
772
|
+
type RouteLoaderObject<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TParams = {}, TLoaderDeps = {}, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TServerMiddlewares = unknown, THandlers = undefined> = {
|
|
773
|
+
handler: RouteLoaderFn<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers>;
|
|
774
|
+
staleReloadMode?: LoaderStaleReloadMode;
|
|
775
|
+
};
|
|
776
|
+
type ResolveLoaderData<TLoaderFn> = unknown extends TLoaderFn ? TLoaderFn : LooseAsyncReturnType<ResolveRouteLoaderFn<TLoaderFn>> extends never ? undefined : LooseAsyncReturnType<ResolveRouteLoaderFn<TLoaderFn>>;
|
|
777
|
+
type ResolveFullSearchSchema<TParentRoute extends AnyRoute, TSearchValidator> = unknown extends TParentRoute ? ResolveValidatorOutput<TSearchValidator> : IntersectAssign<InferFullSearchSchema<TParentRoute>, ResolveValidatorOutput<TSearchValidator>>;
|
|
778
|
+
type ResolveFullSearchSchemaInput<TParentRoute extends AnyRoute, TSearchValidator> = IntersectAssign<InferFullSearchSchemaInput<TParentRoute>, ResolveSearchValidatorInput<TSearchValidator>>;
|
|
779
|
+
type ResolveAllParamsFromParent<TParentRoute extends AnyRoute, TParams> = Assign<InferAllParams<TParentRoute>, TParams>;
|
|
780
|
+
type RouteContextParameter<TParentRoute extends AnyRoute, TRouterContext> = unknown extends TParentRoute ? TRouterContext : Assign<TRouterContext, InferAllContext<TParentRoute>>;
|
|
781
|
+
type BeforeLoadContextParameter<TParentRoute extends AnyRoute, TRouterContext, TRouteContextFn> = Assign<RouteContextParameter<TParentRoute, TRouterContext>, ContextReturnType<TRouteContextFn>>;
|
|
782
|
+
type ResolveAllContext<TParentRoute extends AnyRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn> = Assign<BeforeLoadContextParameter<TParentRoute, TRouterContext, TRouteContextFn>, ContextAsyncReturnType<TBeforeLoadFn>>;
|
|
783
|
+
interface FullSearchSchemaOption<in out TParentRoute extends AnyRoute, in out TSearchValidator> {
|
|
784
|
+
search: Expand<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>;
|
|
785
|
+
}
|
|
786
|
+
interface RemountDepsOptions<in out TRouteId, in out TFullSearchSchema, in out TAllParams, in out TLoaderDeps> {
|
|
787
|
+
routeId: TRouteId;
|
|
788
|
+
search: TFullSearchSchema;
|
|
789
|
+
params: TAllParams;
|
|
790
|
+
loaderDeps: TLoaderDeps;
|
|
791
|
+
}
|
|
792
|
+
type MakeRemountDepsOptionsUnion<TRouteTree extends AnyRoute = RegisteredRouter['routeTree']> = ParseRoute<TRouteTree> extends (infer TRoute extends AnyRoute) ? TRoute extends any ? RemountDepsOptions<TRoute['id'], TRoute['types']['fullSearchSchema'], TRoute['types']['allParams'], TRoute['types']['loaderDeps']> : never : never;
|
|
793
|
+
interface RouteTypes<in out TRegister, in out TParentRoute extends AnyRoute, in out TPath extends string, in out TFullPath extends string, in out TCustomId extends string, in out TId extends string, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps, in out TLoaderFn, in out TChildren, in out TFileRouteTypes, in out TSSR, in out TServerMiddlewares, in out THandlers> {
|
|
794
|
+
parentRoute: TParentRoute;
|
|
795
|
+
path: TPath;
|
|
796
|
+
to: TrimPathRight<TFullPath>;
|
|
797
|
+
fullPath: TFullPath;
|
|
798
|
+
customId: TCustomId;
|
|
799
|
+
id: TId;
|
|
800
|
+
searchSchema: ResolveValidatorOutput<TSearchValidator>;
|
|
801
|
+
searchSchemaInput: ResolveSearchValidatorInput<TSearchValidator>;
|
|
802
|
+
searchValidator: TSearchValidator;
|
|
803
|
+
fullSearchSchema: ResolveFullSearchSchema<TParentRoute, TSearchValidator>;
|
|
804
|
+
fullSearchSchemaInput: ResolveFullSearchSchemaInput<TParentRoute, TSearchValidator>;
|
|
805
|
+
params: TParams;
|
|
806
|
+
allParams: ResolveAllParamsFromParent<TParentRoute, TParams>;
|
|
807
|
+
routerContext: TRouterContext;
|
|
808
|
+
routeContext: ResolveRouteContext<TRouteContextFn, TBeforeLoadFn>;
|
|
809
|
+
routeContextFn: TRouteContextFn;
|
|
810
|
+
beforeLoadFn: TBeforeLoadFn;
|
|
811
|
+
allContext: ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>;
|
|
812
|
+
children: TChildren;
|
|
813
|
+
loaderData: ResolveLoaderData<TLoaderFn>;
|
|
814
|
+
loaderDeps: TLoaderDeps;
|
|
815
|
+
fileRouteTypes: TFileRouteTypes;
|
|
816
|
+
ssr: ResolveSSR<TSSR>;
|
|
817
|
+
allSsr: ResolveAllSSR<TParentRoute, TSSR>;
|
|
818
|
+
}
|
|
819
|
+
type ResolveSSR<TSSR> = TSSR extends ((...args: ReadonlyArray<any>) => any) ? LooseReturnType<TSSR> : TSSR;
|
|
820
|
+
type ResolveAllSSR<TParentRoute extends AnyRoute, TSSR> = unknown extends TParentRoute ? ResolveSSR<TSSR> : unknown extends TSSR ? TParentRoute['types']['allSsr'] : ResolveSSR<TSSR>;
|
|
821
|
+
interface RouteExtensions<in out TId, in out TFullPath> {
|
|
822
|
+
id: TId;
|
|
823
|
+
fullPath: TFullPath;
|
|
824
|
+
}
|
|
825
|
+
type RouteLazyFn<TRoute extends AnyRoute> = (lazyFn: () => Promise<LazyRoute<TRoute>>) => TRoute;
|
|
826
|
+
type RouteAddChildrenFn<in out TRegister, in out TParentRoute extends AnyRoute, in out TPath extends string, in out TFullPath extends string, in out TCustomId extends string, in out TId extends string, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps extends Record<string, any>, in out TLoaderFn, in out TFileRouteTypes, in out TSSR, in out TServerMiddlewares, in out THandlers> = <const TNewChildren>(children: Constrain<TNewChildren, ReadonlyArray<AnyRoute> | Record<string, AnyRoute>>) => Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TNewChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
|
|
827
|
+
type RouteAddFileChildrenFn<in out TRegister, in out TParentRoute extends AnyRoute, in out TPath extends string, in out TFullPath extends string, in out TCustomId extends string, in out TId extends string, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps extends Record<string, any>, in out TLoaderFn, in out TFileRouteTypes, in out TSSR, in out TServerMiddlewares, in out THandlers> = <const TNewChildren>(children: TNewChildren) => Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TNewChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
|
|
828
|
+
type RouteAddFileTypesFn<TRegister, TParentRoute extends AnyRoute, TPath extends string, TFullPath extends string, TCustomId extends string, TId extends string, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps extends Record<string, any>, TLoaderFn, TChildren, TSSR, TServerMiddlewares, THandlers> = <TNewFileRouteTypes>() => Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TNewFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
|
|
829
|
+
interface Route<in out TRegister, in out TParentRoute extends AnyRoute, in out TPath extends string, in out TFullPath extends string, in out TCustomId extends string, in out TId extends string, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps extends Record<string, any>, in out TLoaderFn, in out TChildren, in out TFileRouteTypes, in out TSSR, in out TServerMiddlewares, in out THandlers> extends RouteExtensions<TId, TFullPath> {
|
|
830
|
+
path: TPath;
|
|
831
|
+
parentRoute: TParentRoute;
|
|
832
|
+
children?: TChildren;
|
|
833
|
+
types: RouteTypes<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
|
|
834
|
+
options: RouteOptions<TRegister, TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TSSR, TServerMiddlewares, THandlers>;
|
|
835
|
+
isRoot: TParentRoute extends AnyRoute ? true : false;
|
|
836
|
+
lazyFn?: () => Promise<LazyRoute<Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>>>;
|
|
837
|
+
rank: number;
|
|
838
|
+
to: TrimPathRight<TFullPath>;
|
|
839
|
+
init: (originalIndex: number) => void;
|
|
840
|
+
update: (options: UpdatableRouteOptions<TParentRoute, TCustomId, TFullPath, TParams, TSearchValidator, TLoaderFn, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn>) => this;
|
|
841
|
+
lazy: RouteLazyFn<Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>>;
|
|
842
|
+
addChildren: RouteAddChildrenFn<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
|
|
843
|
+
_addFileChildren: RouteAddFileChildrenFn<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
|
|
844
|
+
_addFileTypes: RouteAddFileTypesFn<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TSSR, TServerMiddlewares, THandlers>;
|
|
845
|
+
/**
|
|
846
|
+
* Create a redirect with `from` automatically set to this route's path.
|
|
847
|
+
* Enables relative redirects like `Route.redirect({ to: './overview' })`.
|
|
848
|
+
* @param opts Redirect options (same as `redirect()` but without `from`)
|
|
849
|
+
* @returns A redirect Response that can be thrown from loaders/beforeLoad
|
|
850
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/redirectFunction
|
|
851
|
+
*/
|
|
852
|
+
redirect: RedirectFnRoute<TFullPath>;
|
|
853
|
+
}
|
|
854
|
+
type AnyRoute = Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
855
|
+
type RouteOptions<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TCustomId extends string = string, TFullPath extends string = string, TPath extends string = string, TSearchValidator = undefined, TParams = AnyPathParams, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined> = BaseRouteOptions<TRegister, TParentRoute, TId, TCustomId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TSSR, TServerMiddlewares, THandlers> & UpdatableRouteOptions<NoInfer<TParentRoute>, NoInfer<TCustomId>, NoInfer<TFullPath>, NoInfer<TParams>, NoInfer<TSearchValidator>, NoInfer<TLoaderFn>, NoInfer<TLoaderDeps>, NoInfer<TRouterContext>, NoInfer<TRouteContextFn>, NoInfer<TBeforeLoadFn>>;
|
|
856
|
+
type FileBaseRouteOptions<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TPath extends string = string, TSearchValidator = undefined, TParams = {}, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TRemountDepsFn = AnyContext, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined> = ParamsOptions<TPath, TParams> & FilebaseRouteOptionsInterface<TRegister, TParentRoute, TId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TRemountDepsFn, TSSR, TServerMiddlewares, THandlers>;
|
|
857
|
+
interface FilebaseRouteOptionsInterface<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TPath extends string = string, TSearchValidator = undefined, TParams = {}, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TRemountDepsFn = AnyContext, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined> {
|
|
858
|
+
validateSearch?: Constrain<TSearchValidator, AnyValidator, DefaultValidator>;
|
|
859
|
+
shouldReload?: boolean | ((match: LoaderFnContext<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers>) => any);
|
|
860
|
+
context?: Constrain<TRouteContextFn, (ctx: RouteContextOptions<TParentRoute, TParams, TRouterContext, TLoaderDeps, TId>) => any>;
|
|
861
|
+
ssr?: Constrain<TSSR, undefined | SSROption | ((ctx: SsrContextOptions<TParentRoute, TSearchValidator, TParams>) => Awaitable<undefined | SSROption>)>;
|
|
862
|
+
beforeLoad?: Constrain<TBeforeLoadFn, (ctx: BeforeLoadContextOptions<TRegister, TParentRoute, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TId, TServerMiddlewares, THandlers>) => ValidateSerializableLifecycleResult<TRegister, TParentRoute, TSSR, TBeforeLoadFn>>;
|
|
863
|
+
loaderDeps?: (opts: FullSearchSchemaOption<TParentRoute, TSearchValidator>) => TLoaderDeps;
|
|
864
|
+
remountDeps?: Constrain<TRemountDepsFn, (opt: RemountDepsOptions<TId, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>, TLoaderDeps>) => any>;
|
|
865
|
+
loader?: Constrain<TLoaderFn, RouteLoaderFn<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers> | RouteLoaderObject<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers>>;
|
|
866
|
+
}
|
|
867
|
+
type BaseRouteOptions<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TCustomId extends string = string, TPath extends string = string, TSearchValidator = undefined, TParams = {}, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined> = RoutePathOptions<TCustomId, TPath> & FileBaseRouteOptions<TRegister, TParentRoute, TId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, AnyContext, TSSR, TServerMiddlewares, THandlers> & {
|
|
868
|
+
getParentRoute: () => TParentRoute;
|
|
869
|
+
};
|
|
870
|
+
interface ContextOptions<in out TParentRoute extends AnyRoute, in out TParams, in out TRouteId> {
|
|
871
|
+
abortController: AbortController;
|
|
872
|
+
preload: boolean;
|
|
873
|
+
params: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>;
|
|
874
|
+
location: ParsedLocation;
|
|
875
|
+
/**
|
|
876
|
+
* @deprecated Use `throw redirect({ to: '/somewhere' })` instead
|
|
877
|
+
**/
|
|
878
|
+
navigate: NavigateFn;
|
|
879
|
+
buildLocation: BuildLocationFn;
|
|
880
|
+
cause: 'preload' | 'enter' | 'stay';
|
|
881
|
+
matches: Array<MakeRouteMatchUnion>;
|
|
882
|
+
routeId: TRouteId;
|
|
883
|
+
}
|
|
884
|
+
interface RouteContextOptions<in out TParentRoute extends AnyRoute, in out TParams, in out TRouterContext, in out TLoaderDeps, in out TRouteId> extends ContextOptions<TParentRoute, TParams, TRouteId> {
|
|
885
|
+
deps: TLoaderDeps;
|
|
886
|
+
context: Expand<RouteContextParameter<TParentRoute, TRouterContext>>;
|
|
887
|
+
}
|
|
888
|
+
interface SsrContextOptions<in out TParentRoute extends AnyRoute, in out TSearchValidator, in out TParams> {
|
|
889
|
+
params: {
|
|
890
|
+
status: 'success';
|
|
891
|
+
value: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>;
|
|
892
|
+
} | {
|
|
893
|
+
status: 'error';
|
|
894
|
+
error: unknown;
|
|
895
|
+
};
|
|
896
|
+
search: {
|
|
897
|
+
status: 'success';
|
|
898
|
+
value: Expand<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>;
|
|
899
|
+
} | {
|
|
900
|
+
status: 'error';
|
|
901
|
+
error: unknown;
|
|
902
|
+
};
|
|
903
|
+
location: ParsedLocation;
|
|
904
|
+
matches: Array<MakePreValidationErrorHandlingRouteMatchUnion>;
|
|
905
|
+
}
|
|
906
|
+
interface BeforeLoadContextOptions<in out TRegister, in out TParentRoute extends AnyRoute, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TRouteId, in out TServerMiddlewares, in out THandlers> extends ContextOptions<TParentRoute, TParams, TRouteId>, FullSearchSchemaOption<TParentRoute, TSearchValidator> {
|
|
907
|
+
context: Expand<BeforeLoadContextParameter<TParentRoute, TRouterContext, TRouteContextFn>>;
|
|
908
|
+
}
|
|
909
|
+
type AssetFnContextOptions<in out TRouteId, in out TFullPath, in out TParentRoute extends AnyRoute, in out TParams, in out TSearchValidator, in out TLoaderFn, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps> = {
|
|
910
|
+
ssr?: {
|
|
911
|
+
nonce?: string;
|
|
912
|
+
};
|
|
913
|
+
matches: Array<RouteMatch$1<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>>;
|
|
914
|
+
match: RouteMatch$1<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>;
|
|
915
|
+
params: ResolveAllParamsFromParent<TParentRoute, TParams>;
|
|
916
|
+
loaderData?: ResolveLoaderData<TLoaderFn>;
|
|
917
|
+
};
|
|
918
|
+
interface DefaultUpdatableRouteOptionsExtensions {
|
|
919
|
+
component?: unknown;
|
|
920
|
+
errorComponent?: unknown;
|
|
921
|
+
notFoundComponent?: unknown;
|
|
922
|
+
pendingComponent?: unknown;
|
|
923
|
+
}
|
|
924
|
+
interface UpdatableRouteOptionsExtensions extends DefaultUpdatableRouteOptionsExtensions {}
|
|
925
|
+
interface UpdatableRouteOptions<in out TParentRoute extends AnyRoute, in out TRouteId, in out TFullPath, in out TParams, in out TSearchValidator, in out TLoaderFn, in out TLoaderDeps, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn> extends UpdatableStaticRouteOption, UpdatableRouteOptionsExtensions {
|
|
926
|
+
/**
|
|
927
|
+
* If true, this route will be matched as case-sensitive
|
|
928
|
+
*
|
|
929
|
+
* @default false
|
|
930
|
+
*/
|
|
931
|
+
caseSensitive?: boolean;
|
|
932
|
+
/**
|
|
933
|
+
* If true, this route will be forcefully wrapped in a suspense boundary
|
|
934
|
+
*/
|
|
935
|
+
wrapInSuspense?: boolean;
|
|
936
|
+
pendingMs?: number;
|
|
937
|
+
pendingMinMs?: number;
|
|
938
|
+
staleTime?: number;
|
|
939
|
+
gcTime?: number;
|
|
940
|
+
preload?: boolean;
|
|
941
|
+
preloadStaleTime?: number;
|
|
942
|
+
preloadGcTime?: number;
|
|
943
|
+
search?: {
|
|
944
|
+
middlewares?: Array<SearchMiddleware<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>>;
|
|
945
|
+
};
|
|
946
|
+
/**
|
|
947
|
+
@deprecated Use search.middlewares instead
|
|
948
|
+
*/
|
|
949
|
+
preSearchFilters?: Array<SearchFilter<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>>;
|
|
950
|
+
/**
|
|
951
|
+
@deprecated Use search.middlewares instead
|
|
952
|
+
*/
|
|
953
|
+
postSearchFilters?: Array<SearchFilter<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>>;
|
|
954
|
+
onCatch?: (error: ErrorBoundaryTypes['error']) => void;
|
|
955
|
+
onError?: (err: any) => void;
|
|
956
|
+
onEnter?: (match: RouteMatch$1<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
|
|
957
|
+
onStay?: (match: RouteMatch$1<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
|
|
958
|
+
onLeave?: (match: RouteMatch$1<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
|
|
959
|
+
headers?: (ctx: AssetFnContextOptions<TRouteId, TFullPath, TParentRoute, TParams, TSearchValidator, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps>) => Awaitable<Record<string, string> | undefined>;
|
|
960
|
+
head?: (ctx: AssetFnContextOptions<TRouteId, TFullPath, TParentRoute, TParams, TSearchValidator, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps>) => Awaitable<{
|
|
961
|
+
links?: AnyRouteMatch['links'];
|
|
962
|
+
scripts?: AnyRouteMatch['headScripts'];
|
|
963
|
+
meta?: AnyRouteMatch['meta'];
|
|
964
|
+
styles?: AnyRouteMatch['styles'];
|
|
965
|
+
}>;
|
|
966
|
+
scripts?: (ctx: AssetFnContextOptions<TRouteId, TFullPath, TParentRoute, TParams, TSearchValidator, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps>) => Awaitable<AnyRouteMatch['scripts']>;
|
|
967
|
+
codeSplitGroupings?: Array<Array<'loader' | 'component' | 'pendingComponent' | 'notFoundComponent' | 'errorComponent'>>;
|
|
968
|
+
}
|
|
969
|
+
type RouteLoaderFn<in out TRegister, in out TParentRoute extends AnyRoute = AnyRoute, in out TId extends string = string, in out TParams = {}, in out TLoaderDeps = {}, in out TRouterContext = {}, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TServerMiddlewares = unknown, in out THandlers = undefined> = (match: LoaderFnContext<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers>) => any;
|
|
970
|
+
type LoaderStaleReloadMode = 'background' | 'blocking';
|
|
971
|
+
interface LoaderFnContext<in out TRegister = unknown, in out TParentRoute extends AnyRoute = AnyRoute, in out TId extends string = string, in out TParams = {}, in out TLoaderDeps = {}, in out TRouterContext = {}, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TServerMiddlewares = unknown, in out THandlers = undefined> {
|
|
972
|
+
abortController: AbortController;
|
|
973
|
+
preload: boolean;
|
|
974
|
+
params: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>;
|
|
975
|
+
deps: TLoaderDeps;
|
|
976
|
+
context: Expand<ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>>;
|
|
977
|
+
location: ParsedLocation;
|
|
978
|
+
/**
|
|
979
|
+
* @deprecated Use `throw redirect({ to: '/somewhere' })` instead
|
|
980
|
+
**/
|
|
981
|
+
navigate: (opts: NavigateOptions<AnyRouter>) => Promise<void> | void;
|
|
982
|
+
parentMatchPromise: TId extends RootRouteId ? never : Promise<MakeRouteMatchFromRoute<TParentRoute>>;
|
|
983
|
+
cause: 'preload' | 'enter' | 'stay';
|
|
984
|
+
route: AnyRoute;
|
|
985
|
+
}
|
|
986
|
+
type RouteMask<TRouteTree extends AnyRoute> = {
|
|
987
|
+
routeTree: TRouteTree;
|
|
988
|
+
from: RoutePaths<TRouteTree>;
|
|
989
|
+
to?: any;
|
|
990
|
+
params?: any;
|
|
991
|
+
search?: any;
|
|
992
|
+
hash?: any;
|
|
993
|
+
state?: any;
|
|
994
|
+
unmaskOnReload?: boolean;
|
|
995
|
+
};
|
|
996
|
+
interface DefaultErrorBoundaryTypes {
|
|
997
|
+
error: unknown;
|
|
998
|
+
}
|
|
999
|
+
/** Frameworks can specialize the error exposed by boundary components and callbacks. */
|
|
1000
|
+
interface ErrorBoundaryTypes extends DefaultErrorBoundaryTypes {}
|
|
1001
|
+
//#endregion
|
|
1002
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/path.d.ts
|
|
1003
|
+
type InterpolationSegment = string | DynamicPathSegment;
|
|
1004
|
+
type RouteInterpolation = Array<InterpolationSegment> & {
|
|
1005
|
+
names?: Array<string>;
|
|
1006
|
+
};
|
|
1007
|
+
//#endregion
|
|
1008
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.d.ts
|
|
1009
|
+
declare const SEGMENT_TYPE_PATHNAME = 0;
|
|
1010
|
+
declare const SEGMENT_TYPE_PARAM = 1;
|
|
1011
|
+
declare const SEGMENT_TYPE_WILDCARD = 2;
|
|
1012
|
+
declare const SEGMENT_TYPE_OPTIONAL_PARAM = 3;
|
|
1013
|
+
declare const SEGMENT_TYPE_INDEX = 4;
|
|
1014
|
+
declare const SEGMENT_TYPE_PATHLESS = 5;
|
|
1015
|
+
/**
|
|
1016
|
+
* All the kinds of segments that can be present in a route path.
|
|
1017
|
+
*/
|
|
1018
|
+
type SegmentKind = typeof SEGMENT_TYPE_PATHNAME | typeof SEGMENT_TYPE_PARAM | typeof SEGMENT_TYPE_WILDCARD | typeof SEGMENT_TYPE_OPTIONAL_PARAM;
|
|
1019
|
+
/**
|
|
1020
|
+
* All the kinds of segments that can be present in the segment tree.
|
|
1021
|
+
*/
|
|
1022
|
+
type ExtendedSegmentKind = SegmentKind | typeof SEGMENT_TYPE_INDEX | typeof SEGMENT_TYPE_PATHLESS;
|
|
1023
|
+
type DynamicPathSegment = [kind: Exclude<SegmentKind, typeof SEGMENT_TYPE_PATHNAME>, key: string, prefix: string,
|
|
1024
|
+
/** Undefined marks a bare splat, which discards the remaining template. */
|
|
1025
|
+
suffix: string | undefined];
|
|
1026
|
+
type StaticSegmentNode<T extends RouteLike> = SegmentNode<T> & {
|
|
1027
|
+
kind: typeof SEGMENT_TYPE_PATHNAME | typeof SEGMENT_TYPE_PATHLESS | typeof SEGMENT_TYPE_INDEX;
|
|
1028
|
+
};
|
|
1029
|
+
type DynamicSegmentNode<T extends RouteLike> = SegmentNode<T> & {
|
|
1030
|
+
kind: typeof SEGMENT_TYPE_PARAM | typeof SEGMENT_TYPE_WILDCARD | typeof SEGMENT_TYPE_OPTIONAL_PARAM;
|
|
1031
|
+
prefix: string;
|
|
1032
|
+
suffix: string;
|
|
1033
|
+
caseSensitive: boolean;
|
|
1034
|
+
};
|
|
1035
|
+
type AnySegmentNode<T extends RouteLike> = StaticSegmentNode<T> | DynamicSegmentNode<T>;
|
|
1036
|
+
type SegmentNode<T extends RouteLike> = {
|
|
1037
|
+
kind: ExtendedSegmentKind;
|
|
1038
|
+
prefix?: string;
|
|
1039
|
+
suffix?: string;
|
|
1040
|
+
caseSensitive?: boolean;
|
|
1041
|
+
pathless: Array<StaticSegmentNode<T>> | null;
|
|
1042
|
+
/** Exact index segment (highest priority) */
|
|
1043
|
+
index: StaticSegmentNode<T> | null;
|
|
1044
|
+
/** Static segments (2nd priority) */
|
|
1045
|
+
static: Map<string, StaticSegmentNode<T>> | null;
|
|
1046
|
+
/** Case insensitive static segments (3rd highest priority) */
|
|
1047
|
+
staticInsensitive: Map<string, StaticSegmentNode<T>> | null;
|
|
1048
|
+
/** Dynamic segments ($param) */
|
|
1049
|
+
dynamic: Array<DynamicSegmentNode<T>> | null;
|
|
1050
|
+
/** Optional dynamic segments ({-$param}) */
|
|
1051
|
+
optional: Array<DynamicSegmentNode<T>> | null;
|
|
1052
|
+
/** Wildcard segments ($ - lowest priority) */
|
|
1053
|
+
wildcard: Array<DynamicSegmentNode<T>> | null;
|
|
1054
|
+
/** Terminal route (if this path can end here) */
|
|
1055
|
+
route: T | null;
|
|
1056
|
+
/** Original template data for this candidate or parse gate. */
|
|
1057
|
+
data: RouteInterpolation | undefined;
|
|
1058
|
+
parent: AnySegmentNode<T> | undefined;
|
|
1059
|
+
depth: number;
|
|
1060
|
+
/** route.options.params.parse function, set on the last node of the route */
|
|
1061
|
+
parse: null | ((params: Record<string, string>) => unknown);
|
|
1062
|
+
/** route.options.params.priority ?? 0 */
|
|
1063
|
+
priority: number;
|
|
1064
|
+
};
|
|
1065
|
+
type RouteLike = {
|
|
1066
|
+
_interpolation?: RouteInterpolation;
|
|
1067
|
+
id?: string;
|
|
1068
|
+
path?: string;
|
|
1069
|
+
children?: Array<RouteLike>;
|
|
1070
|
+
parentRoute?: RouteLike;
|
|
1071
|
+
isRoot?: boolean;
|
|
1072
|
+
options?: {
|
|
1073
|
+
caseSensitive?: boolean;
|
|
1074
|
+
parseParams?: (params: Record<string, string>) => unknown;
|
|
1075
|
+
params?: {
|
|
1076
|
+
parse?: (params: Record<string, string>) => unknown;
|
|
1077
|
+
priority?: number;
|
|
1078
|
+
};
|
|
1079
|
+
};
|
|
1080
|
+
} & ({
|
|
1081
|
+
fullPath: string;
|
|
1082
|
+
from?: never;
|
|
1083
|
+
} | {
|
|
1084
|
+
fullPath?: never;
|
|
1085
|
+
from: string;
|
|
1086
|
+
});
|
|
1087
|
+
type ProcessedTree<TTree extends Extract<RouteLike, {
|
|
1088
|
+
fullPath: string;
|
|
1089
|
+
}>, TFlat extends Extract<RouteLike, {
|
|
1090
|
+
from: string;
|
|
1091
|
+
}>, TSingle extends Extract<RouteLike, {
|
|
1092
|
+
from: string;
|
|
1093
|
+
}>> = {
|
|
1094
|
+
/** a representation of the `routeTree` as a segment tree */
|
|
1095
|
+
segmentTree: AnySegmentNode<TTree>;
|
|
1096
|
+
/** a mini route tree generated from the flat `routeMasks` list */
|
|
1097
|
+
masksTree: AnySegmentNode<TFlat> | null;
|
|
1098
|
+
/** @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree */
|
|
1099
|
+
singleCache: SieveCache<string, AnySegmentNode<TSingle>>;
|
|
1100
|
+
/** a cache of route matches from the `segmentTree` */
|
|
1101
|
+
matchCache: SieveCache<string, RouteMatch<TTree> | null>;
|
|
1102
|
+
/** a cache of route matches from the `masksTree` */
|
|
1103
|
+
flatCache: SieveCache<string, ReturnType<typeof findMatch<TFlat>>> | null;
|
|
1104
|
+
};
|
|
1105
|
+
type RouteMatch<T extends Extract<RouteLike, {
|
|
1106
|
+
fullPath: string;
|
|
1107
|
+
}>> = {
|
|
1108
|
+
route: T;
|
|
1109
|
+
rawParams: Record<string, string>;
|
|
1110
|
+
branch: ReadonlyArray<T>;
|
|
1111
|
+
};
|
|
1112
|
+
interface ProcessRouteTreeResult<TRouteLike extends Extract<RouteLike, {
|
|
1113
|
+
fullPath: string;
|
|
1114
|
+
}> & {
|
|
1115
|
+
id: string;
|
|
1116
|
+
}> {
|
|
1117
|
+
/** Should be considered a black box, needs to be provided to all matching functions in this module. */
|
|
1118
|
+
processedTree: ProcessedTree<TRouteLike, any, any>;
|
|
1119
|
+
/** A lookup map of routes by their unique IDs. */
|
|
1120
|
+
routesById: Record<string, TRouteLike>;
|
|
1121
|
+
/** A lookup map of routes by their trimmed full paths. */
|
|
1122
|
+
routesByPath: Record<string, TRouteLike>;
|
|
1123
|
+
}
|
|
1124
|
+
declare function findMatch<T extends RouteLike>(path: string, segmentTree: AnySegmentNode<T>, fuzzy?: boolean): {
|
|
1125
|
+
route: T;
|
|
1126
|
+
/**
|
|
1127
|
+
* The raw (unparsed) params extracted from the path.
|
|
1128
|
+
* This will be the exhaustive list of all params defined in the route's path.
|
|
1129
|
+
*/
|
|
1130
|
+
rawParams: Record<string, string>;
|
|
1131
|
+
} | null;
|
|
1132
|
+
//#endregion
|
|
1133
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/searchParams.d.ts
|
|
1134
|
+
type SearchSerializer = (searchObj: Record<string, any>) => string;
|
|
1135
|
+
type SearchParser = (searchStr: string) => Record<string, any>;
|
|
1136
|
+
//#endregion
|
|
1137
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/ssr/constants.d.ts
|
|
1138
|
+
declare const GLOBAL_TSR = "$_TSR";
|
|
1139
|
+
declare const GLOBAL_SEROVAL: '$R';
|
|
1140
|
+
//#endregion
|
|
1141
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts
|
|
1142
|
+
type AssetCrossOrigin = 'anonymous' | 'use-credentials';
|
|
1143
|
+
type ScriptFormat = 'module' | 'iife';
|
|
1144
|
+
declare const DEV_STYLES_ATTR = "data-tanstack-router-dev-styles";
|
|
1145
|
+
type ManifestAssetLink = string | {
|
|
1146
|
+
href: string;
|
|
1147
|
+
crossOrigin?: AssetCrossOrigin;
|
|
1148
|
+
};
|
|
1149
|
+
type Manifest = {
|
|
1150
|
+
scriptFormat?: ScriptFormat;
|
|
1151
|
+
inlineStyle?: ManifestInlineCss;
|
|
1152
|
+
routes: Record<string, ManifestRoute>;
|
|
1153
|
+
};
|
|
1154
|
+
type ManifestRoute = {
|
|
1155
|
+
filePath?: string;
|
|
1156
|
+
preloads?: Array<ManifestAssetLink>;
|
|
1157
|
+
scripts?: Array<ManifestScript>;
|
|
1158
|
+
css?: Array<ManifestCssLink>;
|
|
1159
|
+
};
|
|
1160
|
+
type ManifestRouteAssets = Pick<ManifestRoute, 'preloads' | 'scripts' | 'css'>;
|
|
1161
|
+
type RouterManagedTitleTag = {
|
|
1162
|
+
tag: 'title';
|
|
1163
|
+
attrs?: Record<string, any>;
|
|
1164
|
+
children: string;
|
|
1165
|
+
};
|
|
1166
|
+
type RouterManagedMetaTag = {
|
|
1167
|
+
tag: 'meta';
|
|
1168
|
+
attrs?: Record<string, any>;
|
|
1169
|
+
children?: never;
|
|
1170
|
+
};
|
|
1171
|
+
type RouterManagedLinkTag = {
|
|
1172
|
+
tag: 'link';
|
|
1173
|
+
attrs?: Record<string, any>;
|
|
1174
|
+
children?: never;
|
|
1175
|
+
};
|
|
1176
|
+
type RouterManagedScriptTag = {
|
|
1177
|
+
tag: 'script';
|
|
1178
|
+
attrs?: Record<string, any>;
|
|
1179
|
+
children?: string;
|
|
1180
|
+
};
|
|
1181
|
+
type ManifestScript = Omit<RouterManagedScriptTag, 'tag'>;
|
|
1182
|
+
type RouterManagedStyleTag = {
|
|
1183
|
+
tag: 'style';
|
|
1184
|
+
attrs?: Record<string, any>;
|
|
1185
|
+
children?: string;
|
|
1186
|
+
inlineCss?: true;
|
|
1187
|
+
};
|
|
1188
|
+
type RouterManagedTag = RouterManagedTitleTag | RouterManagedMetaTag | RouterManagedLinkTag | RouterManagedScriptTag | RouterManagedStyleTag;
|
|
1189
|
+
type ManifestCssLink = string | {
|
|
1190
|
+
href: string;
|
|
1191
|
+
crossOrigin?: AssetCrossOrigin;
|
|
1192
|
+
[DEV_STYLES_ATTR]?: true;
|
|
1193
|
+
};
|
|
1194
|
+
type ManifestInlineCss = {
|
|
1195
|
+
attrs?: Record<string, any>;
|
|
1196
|
+
children?: string;
|
|
1197
|
+
};
|
|
1198
|
+
//#endregion
|
|
1199
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/ssr/types.d.ts
|
|
1200
|
+
interface DehydratedMatch {
|
|
1201
|
+
i: MakeRouteMatch['id'];
|
|
1202
|
+
l?: MakeRouteMatch['loaderData'];
|
|
1203
|
+
e?: MakeRouteMatch['error'];
|
|
1204
|
+
u: MakeRouteMatch['updatedAt'];
|
|
1205
|
+
s: MakeRouteMatch['status'];
|
|
1206
|
+
ssr?: MakeRouteMatch['ssr'];
|
|
1207
|
+
g?: true;
|
|
1208
|
+
}
|
|
1209
|
+
interface DehydratedRouter {
|
|
1210
|
+
manifest: Manifest | undefined;
|
|
1211
|
+
dehydratedData?: any;
|
|
1212
|
+
matches: Array<DehydratedMatch>;
|
|
1213
|
+
}
|
|
1214
|
+
interface TsrSsrGlobal {
|
|
1215
|
+
router?: DehydratedRouter;
|
|
1216
|
+
h: () => void;
|
|
1217
|
+
e: () => void;
|
|
1218
|
+
c: () => void;
|
|
1219
|
+
p: (script: () => void) => void;
|
|
1220
|
+
buffer: Array<() => void>;
|
|
1221
|
+
t?: Map<string, (value: any) => any>;
|
|
1222
|
+
initialized?: boolean;
|
|
1223
|
+
hydrated?: boolean;
|
|
1224
|
+
streamEnded?: boolean;
|
|
1225
|
+
}
|
|
1226
|
+
//#endregion
|
|
1227
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/load-client.d.ts
|
|
1228
|
+
declare const SUCCESS = 0;
|
|
1229
|
+
declare const ERROR = 1;
|
|
1230
|
+
declare const NOT_FOUND = 2;
|
|
1231
|
+
declare const REDIRECTED = 3;
|
|
1232
|
+
declare const CANCELED = 4;
|
|
1233
|
+
type NonRedirectOutcome = [kind: typeof SUCCESS, data: unknown] | [kind: typeof ERROR, error: unknown] | [kind: typeof NOT_FOUND, error: NotFoundError] | [kind: typeof CANCELED];
|
|
1234
|
+
type RawLoaderOutcome = NonRedirectOutcome | [kind: typeof REDIRECTED, redirect: AnyRedirect];
|
|
1235
|
+
type LoaderFlight = [outcome: Promise<RawLoaderOutcome>, controller: AbortController, leases: number];
|
|
1236
|
+
type LoadTransaction = [controller: AbortController, redirects: number, location: ParsedLocation, matches: Array<AnyRouteMatch>, startedAt: number, done: Promise<void>,
|
|
1237
|
+
/**
|
|
1238
|
+
* Dev-only HMR refresh mode. Presence forces successor rematerialization
|
|
1239
|
+
* until this publication is acknowledged. The optional hydration handoff is
|
|
1240
|
+
* retired when the refresh publishes.
|
|
1241
|
+
*/
|
|
1242
|
+
refresh?: [handoff: NonNullable<AnyRouter['_handoff']> | undefined]];
|
|
1243
|
+
type PendingSession = [generation: LoadTransaction, boundaryId: string,
|
|
1244
|
+
/** Pending reveal time until acknowledged, then minimum-visible-until time. */
|
|
1245
|
+
deadline: number, revealTimer?: ReturnType<typeof setTimeout>, ack?: Promise<boolean> | true, component?: unknown];
|
|
1246
|
+
declare global {
|
|
1247
|
+
interface Window {
|
|
1248
|
+
[GLOBAL_TSR]?: TsrSsrGlobal;
|
|
1249
|
+
[GLOBAL_SEROVAL]?: any;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
//#endregion
|
|
1253
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/load-server.d.ts
|
|
1254
|
+
type ServerLoadResult = {
|
|
1255
|
+
type: 'render';
|
|
1256
|
+
status: 200 | 404 | 500;
|
|
1257
|
+
matches: Array<AnyRouteMatch>;
|
|
1258
|
+
} | {
|
|
1259
|
+
type: 'redirect';
|
|
1260
|
+
redirect: AnyRedirect;
|
|
1261
|
+
};
|
|
1262
|
+
//#endregion
|
|
1263
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/ssr/hydrationScripts.d.ts
|
|
1264
|
+
/** The one-time initial `<Scripts>` take: hydration tags plus the boundary. */
|
|
1265
|
+
type InitialHydrationScriptTags = {
|
|
1266
|
+
before: Array<RouterManagedTag>;
|
|
1267
|
+
boundary: RouterManagedTag;
|
|
1268
|
+
};
|
|
1269
|
+
//#endregion
|
|
1270
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/stores.d.ts
|
|
1271
|
+
interface RouterReadableStore<TValue> {
|
|
1272
|
+
get: () => TValue;
|
|
1273
|
+
}
|
|
1274
|
+
interface RouterWritableStore<TValue> extends RouterReadableStore<TValue> {
|
|
1275
|
+
set: ((updater: (prev: TValue) => TValue) => void) & ((value: TValue) => void);
|
|
1276
|
+
}
|
|
1277
|
+
type RouterBatchFn = (fn: () => void) => void;
|
|
1278
|
+
type MutableStoreFactory = <TValue>(initialValue: TValue) => RouterWritableStore<TValue>;
|
|
1279
|
+
type ReadonlyStoreFactory = <TValue>(read: () => TValue) => RouterReadableStore<TValue>;
|
|
1280
|
+
type GetStoreConfig = (opts: {
|
|
1281
|
+
isServer?: boolean;
|
|
1282
|
+
}) => StoreConfig;
|
|
1283
|
+
type StoreConfig = {
|
|
1284
|
+
createMutableStore: MutableStoreFactory;
|
|
1285
|
+
createReadonlyStore: ReadonlyStoreFactory;
|
|
1286
|
+
batch: RouterBatchFn;
|
|
1287
|
+
};
|
|
1288
|
+
type MatchStore = RouterWritableStore<AnyRouteMatch | undefined>;
|
|
1289
|
+
type ReadableStore<TValue> = RouterReadableStore<TValue>;
|
|
1290
|
+
interface RouterStores<in out TRouteTree extends AnyRoute> {
|
|
1291
|
+
status: RouterWritableStore<RouterState<TRouteTree>['status']>;
|
|
1292
|
+
location: RouterWritableStore<ParsedLocation<FullSearchSchema<TRouteTree>>>;
|
|
1293
|
+
resolvedLocation: RouterWritableStore<ParsedLocation<FullSearchSchema<TRouteTree>> | undefined>;
|
|
1294
|
+
ids: RouterWritableStore<Array<string>>;
|
|
1295
|
+
matches: ReadableStore<Array<AnyRouteMatch>>;
|
|
1296
|
+
__store: RouterReadableStore<RouterState<TRouteTree>>;
|
|
1297
|
+
byRoute: Map<string, MatchStore>;
|
|
1298
|
+
/**
|
|
1299
|
+
* Get the stable atom for a route's presented match. The atom remains in the
|
|
1300
|
+
* pool when the route leaves and contains `undefined` until it re-enters.
|
|
1301
|
+
*/
|
|
1302
|
+
getMatchStore: (routeId: string) => RouterReadableStore<AnyRouteMatch | undefined>;
|
|
1303
|
+
setMatches: (nextMatches: Array<AnyRouteMatch>) => void;
|
|
1304
|
+
}
|
|
1305
|
+
//#endregion
|
|
1306
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/router.d.ts
|
|
1307
|
+
interface Register {}
|
|
1308
|
+
type RegisteredSsr<TRegister = Register> = TRegister extends {
|
|
1309
|
+
ssr: infer TSSR;
|
|
1310
|
+
} ? TSSR : false;
|
|
1311
|
+
type RegisteredRouter<TRegister = Register> = TRegister extends {
|
|
1312
|
+
router: infer TRouter;
|
|
1313
|
+
} ? TRouter : AnyRouter;
|
|
1314
|
+
type RegisteredConfigType<TRegister, TKey> = TRegister extends {
|
|
1315
|
+
config: infer TConfig;
|
|
1316
|
+
} ? TConfig extends {
|
|
1317
|
+
'~types': infer TTypes;
|
|
1318
|
+
} ? TKey extends keyof TTypes ? TTypes[TKey] : unknown : unknown : unknown;
|
|
1319
|
+
type DefaultRemountDepsFn<TRouteTree extends AnyRoute> = (opts: MakeRemountDepsOptionsUnion<TRouteTree>) => any;
|
|
1320
|
+
interface DefaultRouterOptionsExtensions {}
|
|
1321
|
+
interface RouterOptionsExtensions extends DefaultRouterOptionsExtensions {}
|
|
1322
|
+
type SSROption = boolean | 'data-only';
|
|
1323
|
+
interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TDefaultStructuralSharingOption extends boolean = false, TRouterHistory extends RouterHistory = RouterHistory, TDehydrated = undefined> extends RouterOptionsExtensions {
|
|
1324
|
+
/**
|
|
1325
|
+
* The history object that will be used to manage the browser history.
|
|
1326
|
+
*
|
|
1327
|
+
* If not provided, a new createBrowserHistory instance will be created and used.
|
|
1328
|
+
*
|
|
1329
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#history-property)
|
|
1330
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/history-types)
|
|
1331
|
+
*/
|
|
1332
|
+
history?: TRouterHistory;
|
|
1333
|
+
/**
|
|
1334
|
+
* A function that will be used to stringify search params when generating links.
|
|
1335
|
+
*
|
|
1336
|
+
* @default defaultStringifySearch
|
|
1337
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#stringifysearch-method)
|
|
1338
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization)
|
|
1339
|
+
*/
|
|
1340
|
+
stringifySearch?: SearchSerializer;
|
|
1341
|
+
/**
|
|
1342
|
+
* A function that will be used to parse search params when parsing the current location.
|
|
1343
|
+
*
|
|
1344
|
+
* @default defaultParseSearch
|
|
1345
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#parsesearch-method)
|
|
1346
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization)
|
|
1347
|
+
*/
|
|
1348
|
+
parseSearch?: SearchParser;
|
|
1349
|
+
/**
|
|
1350
|
+
* If `false`, routes will not be preloaded by default in any way.
|
|
1351
|
+
*
|
|
1352
|
+
* If `'intent'`, routes will be preloaded by default when the user hovers over a link or a `touchstart` event is detected on a `<Link>`.
|
|
1353
|
+
*
|
|
1354
|
+
* If `'viewport'`, routes will be preloaded by default when they are within the viewport.
|
|
1355
|
+
*
|
|
1356
|
+
* @default false
|
|
1357
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreload-property)
|
|
1358
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
|
|
1359
|
+
*/
|
|
1360
|
+
defaultPreload?: false | 'intent' | 'viewport' | 'render';
|
|
1361
|
+
/**
|
|
1362
|
+
* The delay in milliseconds before intent focus/hover and viewport preloading.
|
|
1363
|
+
* Touch intent preloads immediately.
|
|
1364
|
+
*
|
|
1365
|
+
* @default 50
|
|
1366
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloaddelay-property)
|
|
1367
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading#preload-delay)
|
|
1368
|
+
*/
|
|
1369
|
+
defaultPreloadDelay?: number;
|
|
1370
|
+
/**
|
|
1371
|
+
* The default `preloadIntentProximity` a route should use if no preloadIntentProximity is provided.
|
|
1372
|
+
*
|
|
1373
|
+
* @default 0
|
|
1374
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadintentproximity-property)
|
|
1375
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading#preload-intent-proximity)
|
|
1376
|
+
*/
|
|
1377
|
+
defaultPreloadIntentProximity?: number;
|
|
1378
|
+
/**
|
|
1379
|
+
* The default `pendingMs` a route should use if no pendingMs is provided.
|
|
1380
|
+
*
|
|
1381
|
+
* @default 1000
|
|
1382
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingms-property)
|
|
1383
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#avoiding-pending-component-flash)
|
|
1384
|
+
*/
|
|
1385
|
+
defaultPendingMs?: number;
|
|
1386
|
+
/**
|
|
1387
|
+
* The default `pendingMinMs` a route should use if no pendingMinMs is provided.
|
|
1388
|
+
*
|
|
1389
|
+
* @default 500
|
|
1390
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingminms-property)
|
|
1391
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#avoiding-pending-component-flash)
|
|
1392
|
+
*/
|
|
1393
|
+
defaultPendingMinMs?: number;
|
|
1394
|
+
/**
|
|
1395
|
+
* The default `staleTime` a route should use if no staleTime is provided. This is the time in milliseconds that a route will be considered fresh.
|
|
1396
|
+
*
|
|
1397
|
+
* @default 0
|
|
1398
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultstaletime-property)
|
|
1399
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options)
|
|
1400
|
+
*/
|
|
1401
|
+
defaultStaleTime?: number;
|
|
1402
|
+
/**
|
|
1403
|
+
* The default stale reload mode a route loader should use if no `loader.staleReloadMode` is provided.
|
|
1404
|
+
*
|
|
1405
|
+
* `'background'` preserves the current stale-while-revalidate behavior.
|
|
1406
|
+
* `'blocking'` waits for stale loader reloads to complete before resolving navigation.
|
|
1407
|
+
*
|
|
1408
|
+
* @default 'background'
|
|
1409
|
+
*/
|
|
1410
|
+
defaultStaleReloadMode?: LoaderStaleReloadMode;
|
|
1411
|
+
/**
|
|
1412
|
+
* The default `preloadStaleTime` a route should use if no preloadStaleTime is provided.
|
|
1413
|
+
*
|
|
1414
|
+
* @default 30_000 `(30 seconds)`
|
|
1415
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadstaletime-property)
|
|
1416
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
|
|
1417
|
+
*/
|
|
1418
|
+
defaultPreloadStaleTime?: number;
|
|
1419
|
+
/**
|
|
1420
|
+
* The default `preloadGcTime` a route should use if none is provided.
|
|
1421
|
+
*
|
|
1422
|
+
* @default 300_000 `(5 minutes)`
|
|
1423
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadgctime-property)
|
|
1424
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
|
|
1425
|
+
*/
|
|
1426
|
+
defaultPreloadGcTime?: number;
|
|
1427
|
+
/**
|
|
1428
|
+
* If `true`, route navigations will called using `document.startViewTransition()`.
|
|
1429
|
+
*
|
|
1430
|
+
* If the browser does not support this api, this option will be ignored.
|
|
1431
|
+
*
|
|
1432
|
+
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for more information on how this function works.
|
|
1433
|
+
*
|
|
1434
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultviewtransition-property)
|
|
1435
|
+
*/
|
|
1436
|
+
defaultViewTransition?: boolean | ViewTransitionOptions;
|
|
1437
|
+
/**
|
|
1438
|
+
* The default `hashScrollIntoView` a route should use if no hashScrollIntoView is provided while navigating
|
|
1439
|
+
*
|
|
1440
|
+
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) for more information on `ScrollIntoViewOptions`.
|
|
1441
|
+
*
|
|
1442
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulthashscrollintoview-property)
|
|
1443
|
+
*/
|
|
1444
|
+
defaultHashScrollIntoView?: boolean | ScrollIntoViewOptions;
|
|
1445
|
+
/**
|
|
1446
|
+
* @default 'fuzzy'
|
|
1447
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#notfoundmode-property)
|
|
1448
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#the-notfoundmode-option)
|
|
1449
|
+
*/
|
|
1450
|
+
notFoundMode?: 'root' | 'fuzzy';
|
|
1451
|
+
/**
|
|
1452
|
+
* The default `gcTime` a route should use if no gcTime is provided.
|
|
1453
|
+
*
|
|
1454
|
+
* @default 300_000 `(5 minutes)`
|
|
1455
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultgctime-property)
|
|
1456
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options)
|
|
1457
|
+
*/
|
|
1458
|
+
defaultGcTime?: number;
|
|
1459
|
+
/**
|
|
1460
|
+
* If `true`, all routes will be matched as case-sensitive.
|
|
1461
|
+
*
|
|
1462
|
+
* @default false
|
|
1463
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#casesensitive-property)
|
|
1464
|
+
*/
|
|
1465
|
+
caseSensitive?: boolean;
|
|
1466
|
+
/**
|
|
1467
|
+
*
|
|
1468
|
+
* The route tree that will be used to configure the router instance.
|
|
1469
|
+
*
|
|
1470
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#routetree-property)
|
|
1471
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/routing/route-trees)
|
|
1472
|
+
*/
|
|
1473
|
+
routeTree?: TRouteTree;
|
|
1474
|
+
/**
|
|
1475
|
+
* The basepath for then entire router. This is useful for mounting a router instance at a subpath.
|
|
1476
|
+
* ```
|
|
1477
|
+
* @default '/'
|
|
1478
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#basepath-property)
|
|
1479
|
+
*/
|
|
1480
|
+
basepath?: string;
|
|
1481
|
+
/**
|
|
1482
|
+
* The root context that will be provided to all routes in the route tree.
|
|
1483
|
+
*
|
|
1484
|
+
* This can be used to provide a context to all routes in the tree without having to provide it to each route individually.
|
|
1485
|
+
*
|
|
1486
|
+
* Optional or required if the root route was created with [`createRootRouteWithContext()`](https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction).
|
|
1487
|
+
*
|
|
1488
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#context-property)
|
|
1489
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/router-context)
|
|
1490
|
+
*/
|
|
1491
|
+
context?: InferRouterContext<TRouteTree>;
|
|
1492
|
+
additionalContext?: any;
|
|
1493
|
+
/**
|
|
1494
|
+
* A function that will be called when the router is dehydrated.
|
|
1495
|
+
*
|
|
1496
|
+
* The return value of this function will be serialized and stored in the router's dehydrated state.
|
|
1497
|
+
*
|
|
1498
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#dehydrate-method)
|
|
1499
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)
|
|
1500
|
+
*/
|
|
1501
|
+
dehydrate?: () => Awaitable<Constrain<TDehydrated, ValidateSerializableInput<Register, TDehydrated>>>;
|
|
1502
|
+
/**
|
|
1503
|
+
* A function that will be called when the router is hydrated.
|
|
1504
|
+
*
|
|
1505
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#hydrate-method)
|
|
1506
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)
|
|
1507
|
+
*/
|
|
1508
|
+
hydrate?: (dehydrated: TDehydrated) => Awaitable<void>;
|
|
1509
|
+
/**
|
|
1510
|
+
* An array of route masks that will be used to mask routes in the route tree.
|
|
1511
|
+
*
|
|
1512
|
+
* Route masking is when you display a route at a different path than the one it is configured to match, like a modal popup that when shared will unmask to the modal's content instead of the modal's context.
|
|
1513
|
+
*
|
|
1514
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#routemasks-property)
|
|
1515
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-masking)
|
|
1516
|
+
*/
|
|
1517
|
+
routeMasks?: Array<RouteMask<TRouteTree>>;
|
|
1518
|
+
/**
|
|
1519
|
+
* If `true`, route masks will, by default, be removed when the page is reloaded.
|
|
1520
|
+
*
|
|
1521
|
+
* This can be overridden on a per-mask basis by setting the `unmaskOnReload` option on the mask, or on a per-navigation basis by setting the `unmaskOnReload` option in the `Navigate` options.
|
|
1522
|
+
*
|
|
1523
|
+
* @default false
|
|
1524
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#unmaskonreload-property)
|
|
1525
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-masking#unmasking-on-page-reload)
|
|
1526
|
+
*/
|
|
1527
|
+
unmaskOnReload?: boolean;
|
|
1528
|
+
/**
|
|
1529
|
+
* Use `notFoundComponent` instead.
|
|
1530
|
+
*
|
|
1531
|
+
* @deprecated
|
|
1532
|
+
* See https://tanstack.com/router/v1/docs/guide/not-found-errors#migrating-from-notfoundroute for more info.
|
|
1533
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#notfoundroute-property)
|
|
1534
|
+
*/
|
|
1535
|
+
notFoundRoute?: AnyRoute;
|
|
1536
|
+
/**
|
|
1537
|
+
* Configures how trailing slashes are treated.
|
|
1538
|
+
*
|
|
1539
|
+
* - `'always'` will add a trailing slash if not present
|
|
1540
|
+
* - `'never'` will remove the trailing slash if present
|
|
1541
|
+
* - `'preserve'` will not modify the trailing slash.
|
|
1542
|
+
*
|
|
1543
|
+
* @default 'never'
|
|
1544
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#trailingslash-property)
|
|
1545
|
+
*/
|
|
1546
|
+
trailingSlash?: TTrailingSlashOption;
|
|
1547
|
+
/**
|
|
1548
|
+
* While usually automatic, sometimes it can be useful to force the router into a server-side state, e.g. when using the router in a non-browser environment that has access to a global.document object.
|
|
1549
|
+
*
|
|
1550
|
+
* @default typeof document !== 'undefined'
|
|
1551
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#isserver-property)
|
|
1552
|
+
*/
|
|
1553
|
+
isServer?: boolean;
|
|
1554
|
+
/**
|
|
1555
|
+
* @default false
|
|
1556
|
+
*/
|
|
1557
|
+
isShell?: boolean;
|
|
1558
|
+
/**
|
|
1559
|
+
* @default false
|
|
1560
|
+
*/
|
|
1561
|
+
isPrerendering?: boolean;
|
|
1562
|
+
/**
|
|
1563
|
+
* The default `ssr` a route should use if no `ssr` is provided.
|
|
1564
|
+
*
|
|
1565
|
+
* @default true
|
|
1566
|
+
*/
|
|
1567
|
+
defaultSsr?: SSROption;
|
|
1568
|
+
search?: {
|
|
1569
|
+
/**
|
|
1570
|
+
* Configures how unknown search params (= not returned by any `validateSearch`) are treated.
|
|
1571
|
+
*
|
|
1572
|
+
* @default false
|
|
1573
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#search.strict-property)
|
|
1574
|
+
*/
|
|
1575
|
+
strict?: boolean;
|
|
1576
|
+
};
|
|
1577
|
+
/**
|
|
1578
|
+
* Configures whether structural sharing is enabled by default for fine-grained selectors.
|
|
1579
|
+
*
|
|
1580
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultstructuralsharing-property)
|
|
1581
|
+
*/
|
|
1582
|
+
defaultStructuralSharing?: TDefaultStructuralSharingOption;
|
|
1583
|
+
/**
|
|
1584
|
+
* Configures which URI characters are allowed in path params that would ordinarily be escaped by encodeURIComponent.
|
|
1585
|
+
* This is read only during initialization. Create a new router to change it.
|
|
1586
|
+
*
|
|
1587
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#pathparamsallowedcharacters-property)
|
|
1588
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/path-params#allowed-characters)
|
|
1589
|
+
*/
|
|
1590
|
+
readonly pathParamsAllowedCharacters?: ReadonlyArray<';' | ':' | '@' | '&' | '=' | '+' | '$' | ','>;
|
|
1591
|
+
defaultRemountDeps?: DefaultRemountDepsFn<TRouteTree>;
|
|
1592
|
+
/**
|
|
1593
|
+
* If `true`, scroll restoration will be enabled
|
|
1594
|
+
*
|
|
1595
|
+
* @default false
|
|
1596
|
+
*/
|
|
1597
|
+
scrollRestoration?: boolean | ((opts: {
|
|
1598
|
+
location: ParsedLocation;
|
|
1599
|
+
}) => boolean);
|
|
1600
|
+
/**
|
|
1601
|
+
* A function that will be called to get the key for the scroll restoration cache.
|
|
1602
|
+
*
|
|
1603
|
+
* @default (location) => location.href
|
|
1604
|
+
*/
|
|
1605
|
+
getScrollRestorationKey?: (location: ParsedLocation) => string;
|
|
1606
|
+
/**
|
|
1607
|
+
* The default behavior for scroll restoration.
|
|
1608
|
+
*
|
|
1609
|
+
* @default 'auto'
|
|
1610
|
+
*/
|
|
1611
|
+
scrollRestorationBehavior?: ScrollBehavior;
|
|
1612
|
+
/**
|
|
1613
|
+
* An array of selectors that will be used to scroll to the top of the page in addition to `window`
|
|
1614
|
+
*
|
|
1615
|
+
* @default ['window']
|
|
1616
|
+
*/
|
|
1617
|
+
scrollToTopSelectors?: Array<string | (() => Element | null | undefined)>;
|
|
1618
|
+
/**
|
|
1619
|
+
* When `true`, disables the global catch boundary that normally wraps all route matches.
|
|
1620
|
+
* This allows unhandled errors to bubble up to top-level error handlers in the browser.
|
|
1621
|
+
*
|
|
1622
|
+
* Useful for testing tools (like Storybook Test Runner), error reporting services,
|
|
1623
|
+
* and debugging scenarios where you want errors to reach the browser's global error handlers.
|
|
1624
|
+
*
|
|
1625
|
+
* @default false
|
|
1626
|
+
*/
|
|
1627
|
+
disableGlobalCatchBoundary?: boolean;
|
|
1628
|
+
/**
|
|
1629
|
+
* An array of URL protocols to allow in links, redirects, and navigation.
|
|
1630
|
+
* Absolute URLs with protocols not in this list will be rejected.
|
|
1631
|
+
*
|
|
1632
|
+
* @default DEFAULT_PROTOCOL_ALLOWLIST (http:, https:, mailto:, tel:)
|
|
1633
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#protocolallowlist-property)
|
|
1634
|
+
*/
|
|
1635
|
+
protocolAllowlist?: Array<string>;
|
|
1636
|
+
serializationAdapters?: ReadonlyArray<AnySerializationAdapter>;
|
|
1637
|
+
/**
|
|
1638
|
+
* Configures how the router will rewrite the location between the actual href and the internal href of the router.
|
|
1639
|
+
*
|
|
1640
|
+
* @default undefined
|
|
1641
|
+
* @description You can provide a custom rewrite pair (in/out).
|
|
1642
|
+
* This is useful for shifting data from the origin to the path (for things like subdomain routing), or other advanced use cases.
|
|
1643
|
+
*/
|
|
1644
|
+
rewrite?: LocationRewrite;
|
|
1645
|
+
/**
|
|
1646
|
+
* The origin used to resolve URLs. Pass a normalized origin, such as
|
|
1647
|
+
* `https://example.com` or `http://localhost:3000`, without a path or trailing slash.
|
|
1648
|
+
* Defaults to the browser origin, or `http://localhost` on the server.
|
|
1649
|
+
*/
|
|
1650
|
+
origin?: string;
|
|
1651
|
+
ssr?: {
|
|
1652
|
+
nonce?: string;
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
type LocationRewrite = {
|
|
1656
|
+
/**
|
|
1657
|
+
* A function that will be called to rewrite the URL before it is interpreted by the router from the history instance.
|
|
1658
|
+
*
|
|
1659
|
+
* @default undefined
|
|
1660
|
+
*/
|
|
1661
|
+
input?: LocationRewriteFunction;
|
|
1662
|
+
/**
|
|
1663
|
+
* A function that will be called to rewrite the URL before it is committed to the actual history instance from the router.
|
|
1664
|
+
*
|
|
1665
|
+
* @default undefined
|
|
1666
|
+
*/
|
|
1667
|
+
output?: LocationRewriteFunction;
|
|
1668
|
+
};
|
|
1669
|
+
/**
|
|
1670
|
+
* A function that will be called to rewrite the URL.
|
|
1671
|
+
*
|
|
1672
|
+
* @param url The URL to rewrite.
|
|
1673
|
+
* @returns The rewritten URL (as a URL instance or full href string) or undefined if no rewrite is needed.
|
|
1674
|
+
*/
|
|
1675
|
+
type LocationRewriteFunction = ({ url }: {
|
|
1676
|
+
url: URL;
|
|
1677
|
+
}) => undefined | string | URL;
|
|
1678
|
+
interface RouterState<in out TRouteTree extends AnyRoute = AnyRoute, in out TRouteMatch = MakeRouteMatchUnion> {
|
|
1679
|
+
status: 'pending' | 'idle';
|
|
1680
|
+
isLoading: boolean;
|
|
1681
|
+
matches: Array<TRouteMatch>;
|
|
1682
|
+
location: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1683
|
+
resolvedLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1684
|
+
}
|
|
1685
|
+
interface BuildNextOptions {
|
|
1686
|
+
to?: string | number | null;
|
|
1687
|
+
params?: true | Updater<unknown>;
|
|
1688
|
+
search?: true | Updater<unknown>;
|
|
1689
|
+
hash?: true | Updater<string>;
|
|
1690
|
+
state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>;
|
|
1691
|
+
mask?: {
|
|
1692
|
+
to?: string | number | null;
|
|
1693
|
+
params?: true | Updater<unknown>;
|
|
1694
|
+
search?: true | Updater<unknown>;
|
|
1695
|
+
hash?: true | Updater<string>;
|
|
1696
|
+
state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>;
|
|
1697
|
+
unmaskOnReload?: boolean;
|
|
1698
|
+
};
|
|
1699
|
+
from?: string;
|
|
1700
|
+
href?: string;
|
|
1701
|
+
_fromLocation?: ParsedLocation;
|
|
1702
|
+
unsafeRelative?: 'path';
|
|
1703
|
+
_isNavigate?: boolean;
|
|
1704
|
+
}
|
|
1705
|
+
type NavigationEventInfo = {
|
|
1706
|
+
fromLocation?: ParsedLocation;
|
|
1707
|
+
toLocation: ParsedLocation;
|
|
1708
|
+
pathChanged: boolean;
|
|
1709
|
+
hrefChanged: boolean;
|
|
1710
|
+
hashChanged: boolean;
|
|
1711
|
+
};
|
|
1712
|
+
interface RouterEvents {
|
|
1713
|
+
onBeforeNavigate: {
|
|
1714
|
+
type: 'onBeforeNavigate';
|
|
1715
|
+
} & NavigationEventInfo;
|
|
1716
|
+
onBeforeLoad: {
|
|
1717
|
+
type: 'onBeforeLoad';
|
|
1718
|
+
} & NavigationEventInfo;
|
|
1719
|
+
onLoad: {
|
|
1720
|
+
type: 'onLoad';
|
|
1721
|
+
} & NavigationEventInfo;
|
|
1722
|
+
onResolved: {
|
|
1723
|
+
type: 'onResolved';
|
|
1724
|
+
} & NavigationEventInfo;
|
|
1725
|
+
onBeforeRouteMount: {
|
|
1726
|
+
type: 'onBeforeRouteMount';
|
|
1727
|
+
} & NavigationEventInfo;
|
|
1728
|
+
onRendered: {
|
|
1729
|
+
type: 'onRendered';
|
|
1730
|
+
} & NavigationEventInfo;
|
|
1731
|
+
}
|
|
1732
|
+
type RouterEvent = RouterEvents[keyof RouterEvents];
|
|
1733
|
+
type ListenerFn<TEvent extends RouterEvent> = (event: TEvent) => void;
|
|
1734
|
+
type RouterListener<TRouterEvent extends RouterEvent> = {
|
|
1735
|
+
eventType: TRouterEvent['type'];
|
|
1736
|
+
fn: ListenerFn<TRouterEvent>;
|
|
1737
|
+
};
|
|
1738
|
+
type SubscribeFn = <TType extends keyof RouterEvents>(eventType: TType, fn: ListenerFn<RouterEvents[TType]>) => () => void;
|
|
1739
|
+
interface MatchRoutesOpts {
|
|
1740
|
+
throwOnError?: boolean;
|
|
1741
|
+
}
|
|
1742
|
+
type InferRouterContext<TRouteTree extends AnyRoute> = TRouteTree['types']['routerContext'];
|
|
1743
|
+
type RouterContextOptions<TRouteTree extends AnyRoute> = AnyContext extends InferRouterContext<TRouteTree> ? {
|
|
1744
|
+
context?: InferRouterContext<TRouteTree>;
|
|
1745
|
+
} : {
|
|
1746
|
+
context: InferRouterContext<TRouteTree>;
|
|
1747
|
+
};
|
|
1748
|
+
type RouterConstructorOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TDefaultStructuralSharingOption extends boolean, TRouterHistory extends RouterHistory, TDehydrated extends Record<string, any>> = Omit<RouterOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>, 'context' | 'serializationAdapters' | 'defaultSsr'> & RouterContextOptions<TRouteTree>;
|
|
1749
|
+
type PreloadRouteFn<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TDefaultStructuralSharingOption extends boolean, TRouterHistory extends RouterHistory, TDehydrated extends Record<string, any> = Record<string, any>> = <TFrom extends RoutePaths<TRouteTree> | string = string, TTo extends string | undefined = undefined, TMaskFrom extends RoutePaths<TRouteTree> | string = TFrom, TMaskTo extends string = ''>(opts: NavigateOptions<RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>, TFrom, TTo, TMaskFrom, TMaskTo>) => Promise<Array<AnyRouteMatch> | undefined>;
|
|
1750
|
+
type MatchRouteFn<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TDefaultStructuralSharingOption extends boolean, TRouterHistory extends RouterHistory> = <TFrom extends RoutePaths<TRouteTree> = '/', TTo extends string | undefined = undefined, TResolved = ResolveRelativePath<TFrom, NoInfer<TTo>>>(location: ToOptions<RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory>, TFrom, TTo>, opts?: MatchRouteOptions) => false | RouteById<TRouteTree, TResolved>['types']['allParams'];
|
|
1751
|
+
type UpdateFn<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TDefaultStructuralSharingOption extends boolean, TRouterHistory extends RouterHistory, TDehydrated extends Record<string, any>> = (newOptions: Omit<RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>, 'pathParamsAllowedCharacters'>) => void;
|
|
1752
|
+
type InvalidateFn<TRouter extends AnyRouter> = (opts?: {
|
|
1753
|
+
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
1754
|
+
sync?: boolean;
|
|
1755
|
+
forcePending?: boolean;
|
|
1756
|
+
}) => Promise<void>;
|
|
1757
|
+
type ParseLocationFn<TRouteTree extends AnyRoute> = (locationToParse: HistoryLocation, previousLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>) => ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1758
|
+
type GetMatchRoutesFn = (pathname: string) => [matchedRoutes: ReadonlyArray<AnyRoute>,
|
|
1759
|
+
/** exhaustive params, still in their string form */
|
|
1760
|
+
rawParams: Record<string, string>, foundRoute: AnyRoute | undefined];
|
|
1761
|
+
type EmitFn = (routerEvent: RouterEvent) => void;
|
|
1762
|
+
type LoadFn = (opts?: {
|
|
1763
|
+
sync?: boolean;
|
|
1764
|
+
action?: {
|
|
1765
|
+
type: HistoryAction;
|
|
1766
|
+
};
|
|
1767
|
+
_signal?: AbortSignal;
|
|
1768
|
+
}) => Promise<void>;
|
|
1769
|
+
type CommitLocationFn = ({ viewTransition, ignoreBlocker, ...next }: ParsedLocation & CommitLocationOptions) => Promise<void>;
|
|
1770
|
+
type StartTransitionFn = (fn: () => void, expected: Array<AnyRouteMatch>) => Promise<boolean>;
|
|
1771
|
+
interface MatchRoutesFn {
|
|
1772
|
+
(pathname: string, locationSearch?: AnySchema, opts?: MatchRoutesOpts): Array<MakeRouteMatchUnion>;
|
|
1773
|
+
/**
|
|
1774
|
+
* @deprecated use the following signature instead
|
|
1775
|
+
*/
|
|
1776
|
+
(next: ParsedLocation, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
|
|
1777
|
+
(pathnameOrNext: string | ParsedLocation, locationSearchOrOpts?: AnySchema | MatchRoutesOpts, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
|
|
1778
|
+
}
|
|
1779
|
+
type ClearCacheFn<TRouter extends AnyRouter> = (opts?: {
|
|
1780
|
+
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
1781
|
+
}) => void;
|
|
1782
|
+
/**
|
|
1783
|
+
* Server-side SSR request contract.
|
|
1784
|
+
*
|
|
1785
|
+
* Tiering rule: the flat methods are the adapter/framework contract;
|
|
1786
|
+
* `hydrationScripts` is transport for the core SSR stream merger only.
|
|
1787
|
+
* New members must land on the matching tier.
|
|
1788
|
+
*/
|
|
1789
|
+
interface ServerSsr {
|
|
1790
|
+
/** Framework-only. */
|
|
1791
|
+
onRenderFinished: (listener: () => void) => void;
|
|
1792
|
+
/** Framework-only. */
|
|
1793
|
+
setRenderFinished: () => void;
|
|
1794
|
+
/** Framework-only. */
|
|
1795
|
+
cleanup: () => void;
|
|
1796
|
+
/**
|
|
1797
|
+
* Register a listener invoked when the SSR request lifecycle ends (success,
|
|
1798
|
+
* error, abort, or stream lifetime expiry). Use to tear down per-request
|
|
1799
|
+
* resources whose references would otherwise pin the router (e.g. query
|
|
1800
|
+
* cache subscriptions, gcTime timers, abort controllers).
|
|
1801
|
+
*
|
|
1802
|
+
* `settled` is true when every value the router dehydrated has settled, so
|
|
1803
|
+
* no loader work can still be pending. It is false when the response ended
|
|
1804
|
+
* early (abort, cancellation, timeout) or never consumed the loader data.
|
|
1805
|
+
*
|
|
1806
|
+
* Listeners run synchronously and exactly once. Errors are caught and logged.
|
|
1807
|
+
* A listener registered after cleanup already ran is invoked immediately.
|
|
1808
|
+
*/
|
|
1809
|
+
onCleanup: (listener: (settled: boolean) => void) => void;
|
|
1810
|
+
/** Framework-only. */
|
|
1811
|
+
dehydrate: (opts?: {
|
|
1812
|
+
requestAssets?: ManifestRouteAssets;
|
|
1813
|
+
signal?: AbortSignal;
|
|
1814
|
+
}) => Promise<void>;
|
|
1815
|
+
/**
|
|
1816
|
+
* Framework-only: opt this request out of hydration output entirely (for
|
|
1817
|
+
* example a `hydrate: false` page). Call instead of `dehydrate()`, before
|
|
1818
|
+
* rendering starts. No hydration scripts are emitted, `<Scripts>` renders
|
|
1819
|
+
* no boundary, and the response takes the pass-through stream path.
|
|
1820
|
+
*/
|
|
1821
|
+
disableHydration: () => void;
|
|
1822
|
+
/** Framework-only. */
|
|
1823
|
+
takeInitialHydrationScriptTags: () => InitialHydrationScriptTags | undefined;
|
|
1824
|
+
}
|
|
1825
|
+
interface RouterSsrLifecycle {
|
|
1826
|
+
onServerSsrAttach?: Array<(serverSsr: ServerSsr) => void>;
|
|
1827
|
+
}
|
|
1828
|
+
type AnyRouter = RouterCore<any, any, any, any, any>;
|
|
1829
|
+
interface ViewTransitionOptions {
|
|
1830
|
+
types: Array<string> | ((locationChangeInfo: {
|
|
1831
|
+
fromLocation?: ParsedLocation;
|
|
1832
|
+
toLocation: ParsedLocation;
|
|
1833
|
+
pathChanged: boolean;
|
|
1834
|
+
hrefChanged: boolean;
|
|
1835
|
+
hashChanged: boolean;
|
|
1836
|
+
}) => Array<string> | false);
|
|
1837
|
+
}
|
|
1838
|
+
/** Options for configuring trailing-slash behavior. */
|
|
1839
|
+
declare const trailingSlashOptions: {
|
|
1840
|
+
readonly always: "always";
|
|
1841
|
+
readonly never: "never";
|
|
1842
|
+
readonly preserve: "preserve";
|
|
1843
|
+
};
|
|
1844
|
+
type TrailingSlashOption = (typeof trailingSlashOptions)[keyof typeof trailingSlashOptions];
|
|
1845
|
+
/** Indexes and caches rebuilt together when the route tree changes. */
|
|
1846
|
+
type RouteTreeCaches<TRouteTree extends AnyRoute> = ProcessRouteTreeResult<TRouteTree> & {
|
|
1847
|
+
resolvePathCache: SieveCache<string, string>;
|
|
1848
|
+
};
|
|
1849
|
+
declare global {
|
|
1850
|
+
var __TSR_CACHE__: {
|
|
1851
|
+
routeTree: AnyRoute;
|
|
1852
|
+
caseSensitive: boolean | undefined;
|
|
1853
|
+
processRouteTreeResult: RouteTreeCaches<AnyRoute>;
|
|
1854
|
+
} | undefined;
|
|
1855
|
+
}
|
|
1856
|
+
interface RouterCore<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption, in out TDefaultStructuralSharingOption extends boolean, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>> {
|
|
1857
|
+
shouldViewTransition?: boolean | ViewTransitionOptions;
|
|
1858
|
+
/**
|
|
1859
|
+
* Foreground lifecycle boundary survives invalidation/background statuses.
|
|
1860
|
+
* Zero or undefined means the whole branch participates.
|
|
1861
|
+
*/
|
|
1862
|
+
_lifecycleEnd?: number;
|
|
1863
|
+
/** Current client load transaction and owner of navigation writes. */
|
|
1864
|
+
_tx?: LoadTransaction;
|
|
1865
|
+
/** Joinable in-flight loader generations keyed by match ID. */
|
|
1866
|
+
_flights?: Map<string, LoaderFlight>;
|
|
1867
|
+
/** Active speculative lanes retained for cancellation, invalidation, and cache clearing. */
|
|
1868
|
+
_preloads?: Map<AbortController, Array<AnyRouteMatch>>;
|
|
1869
|
+
/** Owns cancellable work before a client transaction publishes. */
|
|
1870
|
+
_preflight?: AbortController;
|
|
1871
|
+
/** Transfers one reconstructed SSR prefix into its initial client load. */
|
|
1872
|
+
_handoff?: HydrationHandoff;
|
|
1873
|
+
/** Pending-boundary reveal and minimum-visible timing state. */
|
|
1874
|
+
_pending?: PendingSession;
|
|
1875
|
+
/** Result of the latest server load, used to render or redirect. */
|
|
1876
|
+
_serverResult?: ServerLoadResult;
|
|
1877
|
+
/** Framework publication waiting for an exact render acknowledgement. */
|
|
1878
|
+
_rendered?: [offered?: Array<AnyRouteMatch>, settle?: (rendered: boolean) => void];
|
|
1879
|
+
/** Development-only HMR reload for a route and its descendants. */
|
|
1880
|
+
_refreshRoute: (() => Promise<void>) | undefined;
|
|
1881
|
+
/** Development-only replacement for a route's lazy chunk owner. */
|
|
1882
|
+
_replaceRouteChunk: ((route: AnyRoute, lazyFn: AnyRoute['lazyFn']) => void) | undefined;
|
|
1883
|
+
}
|
|
1884
|
+
type HydrationHandoff = [claim: () => AbortController | undefined, finish: (matches?: Array<AnyRouteMatch>) => number | undefined];
|
|
1885
|
+
/**
|
|
1886
|
+
* Core, framework-agnostic router engine that powers TanStack Router.
|
|
1887
|
+
*
|
|
1888
|
+
* Provides navigation, matching, loading, preloading, caching and event APIs
|
|
1889
|
+
* used by framework adapters (React/Solid). Prefer framework helpers like
|
|
1890
|
+
* `createRouter` in app code.
|
|
1891
|
+
*
|
|
1892
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType
|
|
1893
|
+
*/
|
|
1894
|
+
declare class RouterCore<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption, in out TDefaultStructuralSharingOption extends boolean, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>> {
|
|
1895
|
+
tempLocationKey: string | undefined;
|
|
1896
|
+
_scroll: {
|
|
1897
|
+
n: boolean;
|
|
1898
|
+
h?: boolean;
|
|
1899
|
+
e?: boolean;
|
|
1900
|
+
s?: boolean;
|
|
1901
|
+
r?: boolean;
|
|
1902
|
+
};
|
|
1903
|
+
subscribers: Set<RouterListener<RouterEvent>>;
|
|
1904
|
+
/** Accepted off-screen loader generations keyed by match ID. */
|
|
1905
|
+
_cache: Map<string, AnyRouteMatch>;
|
|
1906
|
+
/** Accepted semantic lane, excluding temporary pending presentation. */
|
|
1907
|
+
_committed: Array<AnyRouteMatch>;
|
|
1908
|
+
stores: RouterStores<TRouteTree>;
|
|
1909
|
+
private getStoreConfig;
|
|
1910
|
+
batch: (fn: () => void) => void;
|
|
1911
|
+
options: PickAsRequired<RouterOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>, 'stringifySearch' | 'parseSearch' | 'context'>;
|
|
1912
|
+
history: TRouterHistory;
|
|
1913
|
+
rewrite?: LocationRewrite;
|
|
1914
|
+
origin: string;
|
|
1915
|
+
latestLocation: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1916
|
+
_pendingLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1917
|
+
basepath: string;
|
|
1918
|
+
routeTree: TRouteTree;
|
|
1919
|
+
routesById: RoutesById<TRouteTree>;
|
|
1920
|
+
routesByPath: RoutesByPath<TRouteTree>;
|
|
1921
|
+
processedTree: ProcessedTree<TRouteTree, any, any>;
|
|
1922
|
+
resolvePathCache: SieveCache<string, string>;
|
|
1923
|
+
private lightweightCache;
|
|
1924
|
+
private staticLocations;
|
|
1925
|
+
isServer: boolean;
|
|
1926
|
+
readonly pathParamsDecoder?: (encoded: string) => string;
|
|
1927
|
+
protocolAllowlist: Set<string>;
|
|
1928
|
+
/**
|
|
1929
|
+
* @deprecated Use the `createRouter` function instead
|
|
1930
|
+
*/
|
|
1931
|
+
constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>, getStoreConfig: GetStoreConfig);
|
|
1932
|
+
startTransition: StartTransitionFn;
|
|
1933
|
+
isShell(): boolean;
|
|
1934
|
+
update: UpdateFn<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>;
|
|
1935
|
+
get state(): RouterState<TRouteTree>;
|
|
1936
|
+
updateLatestLocation: () => void;
|
|
1937
|
+
buildRouteTree: () => RouteTreeCaches<TRouteTree>;
|
|
1938
|
+
setRoutes(caches: RouteTreeCaches<TRouteTree>): void;
|
|
1939
|
+
/**
|
|
1940
|
+
* Subscribe to router lifecycle events like `onBeforeNavigate`, `onLoad`,
|
|
1941
|
+
* `onResolved`, etc. Returns an unsubscribe function.
|
|
1942
|
+
*
|
|
1943
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterEventsType
|
|
1944
|
+
*/
|
|
1945
|
+
subscribe: SubscribeFn;
|
|
1946
|
+
emit: EmitFn;
|
|
1947
|
+
/**
|
|
1948
|
+
* Parse a HistoryLocation into a strongly-typed ParsedLocation using the
|
|
1949
|
+
* current router options, rewrite rules and search parser/stringifier.
|
|
1950
|
+
*/
|
|
1951
|
+
parseLocation: ParseLocationFn<TRouteTree>;
|
|
1952
|
+
matchRoutes: MatchRoutesFn;
|
|
1953
|
+
private matchRoutesInternal;
|
|
1954
|
+
getMatchedRoutes: GetMatchRoutesFn;
|
|
1955
|
+
/**
|
|
1956
|
+
* Lightweight route matching for buildLocation.
|
|
1957
|
+
* Only computes fullPath, accumulated search, and params - skipping expensive
|
|
1958
|
+
* operations like AbortController, loaderDeps, and full match objects.
|
|
1959
|
+
*/
|
|
1960
|
+
private matchRoutesLightweight;
|
|
1961
|
+
/**
|
|
1962
|
+
* Build the next ParsedLocation from navigation options without committing.
|
|
1963
|
+
* Resolves `to`/`from`, params/search/hash/state, applies search validation
|
|
1964
|
+
* and middlewares, and returns a stringified location object. The built
|
|
1965
|
+
* `search` and `state` are not structurally shared with the current
|
|
1966
|
+
* location; `parseLocation` stabilizes them once the location is committed.
|
|
1967
|
+
*
|
|
1968
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType#buildlocation-method
|
|
1969
|
+
*/
|
|
1970
|
+
buildLocation: BuildLocationFn;
|
|
1971
|
+
_commitPromise: (Promise<void> & {
|
|
1972
|
+
resolve: () => void;
|
|
1973
|
+
}) | undefined;
|
|
1974
|
+
/**
|
|
1975
|
+
* Commit a previously built location to history (push/replace), optionally
|
|
1976
|
+
* using view transitions and scroll restoration options.
|
|
1977
|
+
*/
|
|
1978
|
+
commitLocation: CommitLocationFn;
|
|
1979
|
+
/** Convenience helper: build a location from options, then commit it. */
|
|
1980
|
+
buildAndCommitLocation: ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, ...rest }?: BuildNextOptions & CommitLocationOptions) => Promise<void>;
|
|
1981
|
+
/**
|
|
1982
|
+
* Imperatively navigate using standard `NavigateOptions`. When `reloadDocument`
|
|
1983
|
+
* or an absolute `href` is provided, performs a full document navigation.
|
|
1984
|
+
* Otherwise, builds and commits a client-side location.
|
|
1985
|
+
*
|
|
1986
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType
|
|
1987
|
+
*/
|
|
1988
|
+
navigate: NavigateFn;
|
|
1989
|
+
load: LoadFn;
|
|
1990
|
+
startViewTransition: (fn: () => Promise<void>) => any;
|
|
1991
|
+
/**
|
|
1992
|
+
* Invalidate selected match generations and optionally force current matches
|
|
1993
|
+
* back into a pending state.
|
|
1994
|
+
*
|
|
1995
|
+
* - Marks committed and cached matches whose IDs are selected as invalid.
|
|
1996
|
+
* - Retires selected active preloads so older work cannot publish fresh data.
|
|
1997
|
+
*
|
|
1998
|
+
* The next load decides when to publish pending UI, so invalidation does not
|
|
1999
|
+
* mutate the currently rendered status.
|
|
2000
|
+
*/
|
|
2001
|
+
invalidate: InvalidateFn<RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>>;
|
|
2002
|
+
resolveRedirect: (redirect: AnyRedirect) => AnyRedirect;
|
|
2003
|
+
clearCache: ClearCacheFn<this>;
|
|
2004
|
+
loadRouteChunk: (route: AnyRoute, componentType?: 'errorComponent' | 'notFoundComponent' | false) => Promise<void> | undefined;
|
|
2005
|
+
preloadRoute: PreloadRouteFn<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>;
|
|
2006
|
+
matchRoute: MatchRouteFn<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory>;
|
|
2007
|
+
ssr?: {
|
|
2008
|
+
manifest: Manifest | undefined;
|
|
2009
|
+
};
|
|
2010
|
+
serverSsr?: ServerSsr;
|
|
2011
|
+
serverSsrLifecycle?: RouterSsrLifecycle;
|
|
2012
|
+
}
|
|
2013
|
+
//#endregion
|
|
2014
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.34/node_modules/@tanstack/router-core/dist/esm/global.d.ts
|
|
2015
|
+
declare global {
|
|
2016
|
+
interface Window {
|
|
2017
|
+
__TSR_ROUTER__?: AnyRouter;
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
//#endregion
|
|
2021
|
+
export { ResolveParams as n, Route as r, AnyContext as t };
|
|
2022
|
+
export {};
|
|
2023
|
+
//# sourceMappingURL=index-PjlUqG36.d.ts.map
|