autotel-tanstack 1.14.5 → 2.0.0
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/README.md +13 -9
- package/dist/auto.d.ts +5 -5
- package/dist/browser/context.d.ts +11 -12
- package/dist/browser/debug-headers.d.ts +2 -3
- package/dist/browser/error-reporting.d.ts +7 -8
- package/dist/browser/handlers.d.ts +4 -5
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/loaders.d.ts +10 -11
- package/dist/browser/loaders.js +11 -11
- package/dist/browser/metrics.d.ts +8 -9
- package/dist/browser/middleware.d.ts +7 -8
- package/dist/browser/server-functions.d.ts +4 -5
- package/dist/browser/testing.d.ts +9 -10
- package/dist/browser/types.d.ts +1 -1
- package/dist/context.d.ts +11 -12
- package/dist/debug-headers.d.ts +3 -4
- package/dist/debug-headers.js +1 -1
- package/dist/{env-BpFWNnpL.js → env-rT3_WobG.js} +2 -2
- package/dist/error-reporting.d.ts +6 -7
- package/dist/handlers.d.ts +4 -5
- package/dist/index.d.ts +6 -6
- package/dist/index.js +1 -1
- package/dist/{loaders-CTK-UHdg.d.ts → loaders-CzjfY7s6.d.ts} +475 -383
- package/dist/loaders.d.ts +1 -1
- package/dist/loaders.js +93 -177
- package/dist/metrics.d.ts +5 -6
- package/dist/middleware.d.ts +7 -8
- package/dist/middleware.js +1 -1
- package/dist/server-functions.d.ts +4 -5
- package/dist/server-functions.js +1 -1
- package/dist/testing.d.ts +8 -9
- package/dist/{types-CrBF_-MC.d.ts → types-CjDnjt3Q.d.ts} +17 -17
- package/dist/{types-BZNf5yHJ.d.ts → types-DD1_xVG9.d.ts} +17 -17
- package/package.json +14 -14
|
@@ -1,7 +1,77 @@
|
|
|
1
|
-
import { i as TraceLoaderConfig } from "./types-
|
|
1
|
+
import { i as TraceLoaderConfig } from "./types-DD1_xVG9.js";
|
|
2
2
|
import * as React$2 from "react";
|
|
3
3
|
import React$1 from "react";
|
|
4
|
-
//#region ../../node_modules/.pnpm/@tanstack+
|
|
4
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/sieve-cache.d.ts
|
|
5
|
+
type SieveCache<TKey, TValue> = {
|
|
6
|
+
get: (key: TKey) => TValue | undefined;
|
|
7
|
+
set: (key: TKey, value: TValue) => void;
|
|
8
|
+
clear: () => void;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/validators.d.ts
|
|
12
|
+
interface StandardSchemaValidatorProps<TInput, TOutput> {
|
|
13
|
+
readonly types?: StandardSchemaValidatorTypes<TInput, TOutput> | undefined;
|
|
14
|
+
readonly validate: AnyStandardSchemaValidate;
|
|
15
|
+
}
|
|
16
|
+
interface StandardSchemaValidator<TInput, TOutput> {
|
|
17
|
+
readonly '~standard': StandardSchemaValidatorProps<TInput, TOutput>;
|
|
18
|
+
}
|
|
19
|
+
type AnyStandardSchemaValidator = StandardSchemaValidator<any, any>;
|
|
20
|
+
interface StandardSchemaValidatorTypes<TInput, TOutput> {
|
|
21
|
+
readonly input: TInput;
|
|
22
|
+
readonly output: TOutput;
|
|
23
|
+
}
|
|
24
|
+
interface AnyStandardSchemaValidateSuccess {
|
|
25
|
+
readonly value: any;
|
|
26
|
+
readonly issues?: undefined;
|
|
27
|
+
}
|
|
28
|
+
interface AnyStandardSchemaValidateFailure {
|
|
29
|
+
readonly issues: ReadonlyArray<AnyStandardSchemaValidateIssue>;
|
|
30
|
+
}
|
|
31
|
+
interface AnyStandardSchemaValidateIssue {
|
|
32
|
+
readonly message: string;
|
|
33
|
+
}
|
|
34
|
+
type AnyStandardSchemaValidate = (value: unknown) => (AnyStandardSchemaValidateSuccess | AnyStandardSchemaValidateFailure) | Promise<AnyStandardSchemaValidateSuccess | AnyStandardSchemaValidateFailure>;
|
|
35
|
+
interface ValidatorObj<TInput, TOutput> {
|
|
36
|
+
parse: ValidatorFn<TInput, TOutput>;
|
|
37
|
+
}
|
|
38
|
+
type AnyValidatorObj = ValidatorObj<any, any>;
|
|
39
|
+
interface ValidatorAdapter<TInput, TOutput> {
|
|
40
|
+
types: {
|
|
41
|
+
input: TInput;
|
|
42
|
+
output: TOutput;
|
|
43
|
+
};
|
|
44
|
+
parse: (input: unknown) => TOutput;
|
|
45
|
+
}
|
|
46
|
+
type AnyValidatorAdapter = ValidatorAdapter<any, any>;
|
|
47
|
+
type ValidatorFn<TInput, TOutput> = (input: TInput) => TOutput;
|
|
48
|
+
type Validator<TInput, TOutput> = ValidatorObj<TInput, TOutput> | ValidatorFn<TInput, TOutput> | ValidatorAdapter<TInput, TOutput> | StandardSchemaValidator<TInput, TOutput> | undefined;
|
|
49
|
+
type AnyValidator = Validator<any, any>;
|
|
50
|
+
type AnySchema = {};
|
|
51
|
+
type DefaultValidator = Validator<Record<string, unknown>, AnySchema>;
|
|
52
|
+
type ResolveSearchValidatorInputFn<TValidator> = TValidator extends ((input: infer TSchemaInput) => any) ? TSchemaInput extends SearchSchemaInput ? Omit<TSchemaInput, keyof SearchSchemaInput> : ResolveValidatorOutputFn<TValidator> : AnySchema;
|
|
53
|
+
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>;
|
|
54
|
+
type ResolveValidatorOutputFn<TValidator> = TValidator extends ((...args: any) => infer TSchema) ? TSchema : AnySchema;
|
|
55
|
+
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>;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/fileRoute.d.ts
|
|
58
|
+
interface FileRouteTypes {
|
|
59
|
+
fileRoutesByFullPath: any;
|
|
60
|
+
fullPaths: any;
|
|
61
|
+
to: any;
|
|
62
|
+
fileRoutesByTo: any;
|
|
63
|
+
id: any;
|
|
64
|
+
fileRoutesById: any;
|
|
65
|
+
}
|
|
66
|
+
type InferFileRouteTypes<TRouteTree extends AnyRoute> = unknown extends TRouteTree['types']['fileRouteTypes'] ? never : TRouteTree['types']['fileRouteTypes'] extends FileRouteTypes ? TRouteTree['types']['fileRouteTypes'] : never;
|
|
67
|
+
type LazyRouteOptions = Pick<UpdatableRouteOptions<AnyRoute, string, string, AnyPathParams, AnyValidator, {}, AnyContext, AnyContext, AnyContext, AnyContext>, 'component' | 'errorComponent' | 'pendingComponent' | 'notFoundComponent'>;
|
|
68
|
+
interface LazyRoute<in out TRoute extends AnyRoute> {
|
|
69
|
+
options: {
|
|
70
|
+
id: string;
|
|
71
|
+
} & LazyRouteOptions;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region ../../node_modules/.pnpm/@tanstack+history@1.162.4/node_modules/@tanstack/history/dist/esm/index.d.ts
|
|
5
75
|
interface NavigateOptions$1 {
|
|
6
76
|
ignoreBlocker?: boolean;
|
|
7
77
|
}
|
|
@@ -31,7 +101,9 @@ interface RouterHistory {
|
|
|
31
101
|
flush: () => void;
|
|
32
102
|
destroy: () => void;
|
|
33
103
|
notify: (action: SubscriberHistoryAction) => void;
|
|
104
|
+
_getBlockers: () => Array<NavigationBlocker>;
|
|
34
105
|
_ignoreSubscribers?: boolean;
|
|
106
|
+
_ignoreNextBeforeUnload?: (href: string) => void;
|
|
35
107
|
}
|
|
36
108
|
interface HistoryLocation$1 extends ParsedPath {
|
|
37
109
|
state: ParsedHistoryState;
|
|
@@ -61,24 +133,7 @@ type NavigationBlocker = {
|
|
|
61
133
|
enableBeforeUnload?: (() => boolean) | boolean;
|
|
62
134
|
};
|
|
63
135
|
//#endregion
|
|
64
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
65
|
-
interface FileRouteTypes {
|
|
66
|
-
fileRoutesByFullPath: any;
|
|
67
|
-
fullPaths: any;
|
|
68
|
-
to: any;
|
|
69
|
-
fileRoutesByTo: any;
|
|
70
|
-
id: any;
|
|
71
|
-
fileRoutesById: any;
|
|
72
|
-
}
|
|
73
|
-
type InferFileRouteTypes<TRouteTree extends AnyRoute> = unknown extends TRouteTree['types']['fileRouteTypes'] ? never : TRouteTree['types']['fileRouteTypes'] extends FileRouteTypes ? TRouteTree['types']['fileRouteTypes'] : never;
|
|
74
|
-
type LazyRouteOptions = Pick<UpdatableRouteOptions<AnyRoute, string, string, AnyPathParams, AnyValidator, {}, AnyContext, AnyContext, AnyContext, AnyContext>, 'component' | 'errorComponent' | 'pendingComponent' | 'notFoundComponent'>;
|
|
75
|
-
interface LazyRoute<in out TRoute extends AnyRoute> {
|
|
76
|
-
options: {
|
|
77
|
-
id: string;
|
|
78
|
-
} & LazyRouteOptions;
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/utils.d.ts
|
|
136
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/utils.d.ts
|
|
82
137
|
type Awaitable<T> = T | Promise<T>;
|
|
83
138
|
type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
84
139
|
type PickAsRequired<TValue, TKey extends keyof TValue> = Omit<TValue, TKey> & Required<Pick<TValue, TKey>>;
|
|
@@ -99,14 +154,59 @@ type ConstrainLiteral<T, TConstraint, TDefault = TConstraint> = (T & TConstraint
|
|
|
99
154
|
type ValidateJSON<T> = ((...args: Array<any>) => any) extends T ? unknown extends T ? never : 'Function is not serializable' : { [K in keyof T]: ValidateJSON<T[K]>; };
|
|
100
155
|
type LooseReturnType<T> = T extends ((...args: Array<any>) => infer TReturn) ? TReturn : never;
|
|
101
156
|
type LooseAsyncReturnType<T> = T extends ((...args: Array<any>) => infer TReturn) ? TReturn extends Promise<infer TReturn> ? TReturn : TReturn : never;
|
|
102
|
-
type
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
157
|
+
type ThrowOrOptional<T, TThrow extends boolean> = TThrow extends true ? T : T | undefined;
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/location.d.ts
|
|
160
|
+
interface ParsedLocation<TSearchObj extends AnySchema = {}> {
|
|
161
|
+
/**
|
|
162
|
+
* The full path of the location, including pathname, search, and hash.
|
|
163
|
+
* Does not include the origin. Is the equivalent of calling
|
|
164
|
+
* `url.replace(url.origin, '')`
|
|
165
|
+
*/
|
|
166
|
+
href: string;
|
|
167
|
+
/**
|
|
168
|
+
* @description The pathname of the location, including the leading slash.
|
|
169
|
+
*/
|
|
170
|
+
pathname: string;
|
|
171
|
+
/**
|
|
172
|
+
* The parsed search parameters of the location in object form.
|
|
173
|
+
*/
|
|
174
|
+
search: TSearchObj;
|
|
175
|
+
/**
|
|
176
|
+
* The search string of the location, including the leading question mark.
|
|
177
|
+
*/
|
|
178
|
+
searchStr: string;
|
|
179
|
+
/**
|
|
180
|
+
* The in-memory state of the location as it *may* exist in the browser's history.
|
|
181
|
+
*/
|
|
182
|
+
state: ParsedHistoryState;
|
|
183
|
+
/**
|
|
184
|
+
* The hash of the location, excluding the leading hash character.
|
|
185
|
+
* (e.g., '123' instead of '#123')
|
|
186
|
+
*/
|
|
187
|
+
hash: string;
|
|
188
|
+
/**
|
|
189
|
+
* The masked location of the location.
|
|
190
|
+
*/
|
|
191
|
+
maskedLocation?: ParsedLocation<TSearchObj>;
|
|
192
|
+
/**
|
|
193
|
+
* Whether to unmask the location on reload.
|
|
194
|
+
*/
|
|
195
|
+
unmaskOnReload?: boolean;
|
|
196
|
+
/**
|
|
197
|
+
* @private
|
|
198
|
+
* @description The public href of the location.
|
|
199
|
+
* If a rewrite is applied, the `href` property will be the rewritten URL.
|
|
200
|
+
*/
|
|
201
|
+
publicHref: string;
|
|
202
|
+
/**
|
|
203
|
+
* @private
|
|
204
|
+
* @description Whether the publicHref is external (different origin from rewrite).
|
|
205
|
+
*/
|
|
206
|
+
external: boolean;
|
|
207
|
+
}
|
|
108
208
|
//#endregion
|
|
109
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
209
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/link.d.ts
|
|
110
210
|
type IsRequiredParams<TParams> = Record<never, never> extends TParams ? never : true;
|
|
111
211
|
interface ParsePathParamsResult<in out TRequired, in out TOptional, in out TRest> {
|
|
112
212
|
required: TRequired;
|
|
@@ -298,13 +398,15 @@ interface LinkOptionsProps {
|
|
|
298
398
|
/**
|
|
299
399
|
* The preloading strategy for this link
|
|
300
400
|
* - `false` - No preloading
|
|
301
|
-
* - `'intent'` - Preload the linked route
|
|
401
|
+
* - `'intent'` - Preload the linked route when the user focuses, hovers over, or touches the link
|
|
302
402
|
* - `'viewport'` - Preload the linked route when it enters the viewport
|
|
403
|
+
* - `'render'` - Preload the linked route as soon as it renders
|
|
303
404
|
*/
|
|
304
405
|
preload?: false | 'intent' | 'viewport' | 'render';
|
|
305
406
|
/**
|
|
306
|
-
*
|
|
307
|
-
*
|
|
407
|
+
* Delays focus, hover, and viewport preloading by this many milliseconds.
|
|
408
|
+
* Touch intent preloads immediately. If focus or hover ends, or the link
|
|
409
|
+
* leaves the viewport before this delay, the preload will be cancelled.
|
|
308
410
|
*/
|
|
309
411
|
preloadDelay?: number;
|
|
310
412
|
/**
|
|
@@ -321,7 +423,7 @@ interface LinkOptionsProps {
|
|
|
321
423
|
}
|
|
322
424
|
type LinkOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & LinkOptionsProps;
|
|
323
425
|
//#endregion
|
|
324
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
426
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/routeInfo.d.ts
|
|
325
427
|
type ParseRoute<TRouteTree, TAcc = TRouteTree> = TRouteTree extends {
|
|
326
428
|
types: {
|
|
327
429
|
children: infer TChildren;
|
|
@@ -366,14 +468,31 @@ type AllParams<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (in
|
|
|
366
468
|
type AllContext<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? PartialMergeAll<TRoutes['types']['allContext']> : never;
|
|
367
469
|
type AllLoaderData<TRouteTree extends AnyRoute> = ParseRoute<TRouteTree> extends (infer TRoutes extends AnyRoute) ? PartialMergeAll<TRoutes['types']['loaderData']> : never;
|
|
368
470
|
//#endregion
|
|
369
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
471
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/not-found.d.ts
|
|
472
|
+
type NotFoundError = {
|
|
473
|
+
/**
|
|
474
|
+
@deprecated
|
|
475
|
+
Use `routeId: rootRouteId` instead
|
|
476
|
+
*/
|
|
477
|
+
global?: boolean;
|
|
478
|
+
/**
|
|
479
|
+
@private
|
|
480
|
+
Do not use this. It's used internally to indicate a path matching error
|
|
481
|
+
*/
|
|
482
|
+
_global?: boolean;
|
|
483
|
+
data?: any;
|
|
484
|
+
throw?: boolean;
|
|
485
|
+
routeId?: RouteIds<RegisteredRouter['routeTree']>;
|
|
486
|
+
headers?: HeadersInit;
|
|
487
|
+
};
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts
|
|
370
490
|
type AnyRedirect = Redirect<any, any, any, any, any>;
|
|
371
491
|
/**
|
|
372
492
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
|
|
373
493
|
*/
|
|
374
494
|
type Redirect<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = Response & {
|
|
375
|
-
options: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo
|
|
376
|
-
redirectHandled?: boolean;
|
|
495
|
+
options: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>;
|
|
377
496
|
};
|
|
378
497
|
type RedirectOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = {
|
|
379
498
|
href?: string;
|
|
@@ -411,7 +530,7 @@ interface RedirectFnRoute<in out TDefaultFrom extends string = string> {
|
|
|
411
530
|
<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>;
|
|
412
531
|
}
|
|
413
532
|
//#endregion
|
|
414
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
533
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/Matches.d.ts
|
|
415
534
|
interface DefaultRouteMatchExtensions {
|
|
416
535
|
scripts?: unknown;
|
|
417
536
|
links?: unknown;
|
|
@@ -428,35 +547,26 @@ interface RouteMatch$1<out TRouteId, out TFullPath, out TAllParams, out TFullSea
|
|
|
428
547
|
pathname: string;
|
|
429
548
|
params: TAllParams;
|
|
430
549
|
_strictParams: TAllParams;
|
|
431
|
-
status: 'pending' | 'success' | 'error' | '
|
|
550
|
+
status: 'pending' | 'success' | 'error' | 'notFound';
|
|
432
551
|
isFetching: false | 'beforeLoad' | 'loader';
|
|
433
552
|
error: unknown;
|
|
434
553
|
paramsError: unknown;
|
|
435
554
|
searchError: unknown;
|
|
436
555
|
updatedAt: number;
|
|
437
|
-
_nonReactive: {
|
|
438
|
-
loadPromise?: ControlledPromise<void>;
|
|
439
|
-
displayPendingPromise?: Promise<void>;
|
|
440
|
-
minPendingPromise?: ControlledPromise<void>;
|
|
441
|
-
dehydrated?: boolean;
|
|
442
|
-
};
|
|
443
556
|
loaderData?: TLoaderData;
|
|
444
557
|
context: TAllContext;
|
|
445
558
|
search: TFullSearchSchema;
|
|
446
559
|
_strictSearch: TFullSearchSchema;
|
|
447
|
-
fetchCount: number;
|
|
448
560
|
abortController: AbortController;
|
|
449
561
|
cause: 'preload' | 'enter' | 'stay';
|
|
450
562
|
loaderDeps: TLoaderDeps;
|
|
451
563
|
preload: boolean;
|
|
452
564
|
invalid: boolean;
|
|
453
565
|
headers?: Record<string, string>;
|
|
454
|
-
|
|
566
|
+
_notFound?: boolean;
|
|
455
567
|
staticData: StaticDataRouteOption;
|
|
456
568
|
/** This attribute is not reactive */
|
|
457
569
|
ssr?: SSROption;
|
|
458
|
-
_forcePending?: boolean;
|
|
459
|
-
_displayPending?: boolean;
|
|
460
570
|
}
|
|
461
571
|
interface PreValidationErrorHandlingRouteMatch<TRouteId, TFullPath, TAllParams, TFullSearchSchema> {
|
|
462
572
|
id: string;
|
|
@@ -520,12 +630,12 @@ interface MatchRouteOptions {
|
|
|
520
630
|
fuzzy?: boolean;
|
|
521
631
|
}
|
|
522
632
|
//#endregion
|
|
523
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
633
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/root.d.ts
|
|
524
634
|
/** Stable identifier used for the root route in a route tree. */
|
|
525
635
|
declare const rootRouteId = "__root__";
|
|
526
636
|
type RootRouteId = typeof rootRouteId;
|
|
527
637
|
//#endregion
|
|
528
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
638
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/RouterProvider.d.ts
|
|
529
639
|
interface CommitLocationOptions {
|
|
530
640
|
replace?: boolean;
|
|
531
641
|
resetScroll?: boolean;
|
|
@@ -544,19 +654,11 @@ type BuildLocationFn = <TRouter extends RegisteredRouter, TTo extends string | u
|
|
|
544
654
|
_isNavigate?: boolean;
|
|
545
655
|
}) => ParsedLocation;
|
|
546
656
|
//#endregion
|
|
547
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
548
|
-
/**
|
|
549
|
-
* Hint for RawStream encoding strategy during SSR serialization.
|
|
550
|
-
* - 'binary': Always use base64 encoding (best for binary data like files, images)
|
|
551
|
-
* - 'text': Try UTF-8 first, fallback to base64 (best for text-heavy data like RSC payloads)
|
|
552
|
-
*/
|
|
657
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/RawStream.d.ts
|
|
553
658
|
type RawStreamHint = 'binary' | 'text';
|
|
554
|
-
/**
|
|
555
|
-
* Options for RawStream configuration.
|
|
556
|
-
*/
|
|
557
659
|
interface RawStreamOptions {
|
|
558
660
|
/**
|
|
559
|
-
* Encoding hint for SSR serialization.
|
|
661
|
+
* Encoding hint for JSON and SSR serialization.
|
|
560
662
|
* - 'binary' (default): Always use base64 encoding
|
|
561
663
|
* - 'text': Try UTF-8 first, fallback to base64 for invalid UTF-8 chunks
|
|
562
664
|
*/
|
|
@@ -564,7 +666,8 @@ interface RawStreamOptions {
|
|
|
564
666
|
}
|
|
565
667
|
/**
|
|
566
668
|
* Marker class for ReadableStream<Uint8Array> that should be serialized
|
|
567
|
-
* with base64 encoding (SSR) or binary framing
|
|
669
|
+
* with base64/text encoding (JSON and SSR) or binary framing
|
|
670
|
+
* (server-function responses).
|
|
568
671
|
*
|
|
569
672
|
* Wrap your binary streams with this to get efficient serialization:
|
|
570
673
|
* ```ts
|
|
@@ -574,6 +677,13 @@ interface RawStreamOptions {
|
|
|
574
677
|
* // For text-heavy data (RSC payloads, etc.)
|
|
575
678
|
* return { data: new RawStream(rscStream, { hint: 'text' }) }
|
|
576
679
|
* ```
|
|
680
|
+
*
|
|
681
|
+
* RawStreams returned from one server function share one ordered response.
|
|
682
|
+
* Arbitrary or sequential consumption can require potentially unbounded client
|
|
683
|
+
* buffering for unread data. Cancelling one RawStream discards it locally;
|
|
684
|
+
* abort the whole server-function call to cancel the response and server work.
|
|
685
|
+
* Consume streams concurrently, cancel unused streams promptly, or use separate
|
|
686
|
+
* calls when independent backpressure is required.
|
|
577
687
|
*/
|
|
578
688
|
declare class RawStream {
|
|
579
689
|
readonly stream: ReadableStream<Uint8Array>;
|
|
@@ -581,7 +691,7 @@ declare class RawStream {
|
|
|
581
691
|
constructor(stream: ReadableStream<Uint8Array>, options?: RawStreamOptions);
|
|
582
692
|
}
|
|
583
693
|
//#endregion
|
|
584
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
694
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/transformer.d.ts
|
|
585
695
|
declare const TSR_SERIALIZABLE: unique symbol;
|
|
586
696
|
type TSR_SERIALIZABLE = typeof TSR_SERIALIZABLE;
|
|
587
697
|
type TsrSerializable = {
|
|
@@ -641,7 +751,7 @@ interface DefaultSerializerExtensions {
|
|
|
641
751
|
}
|
|
642
752
|
interface SerializerExtensions extends DefaultSerializerExtensions {}
|
|
643
753
|
//#endregion
|
|
644
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
754
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/route.d.ts
|
|
645
755
|
type AnyPathParams = {};
|
|
646
756
|
type SearchSchemaInput = {
|
|
647
757
|
__TSearchSchemaInput__: 'TSearchSchemaInput';
|
|
@@ -794,9 +904,7 @@ interface Route<in out TRegister, in out TParentRoute extends AnyRoute, in out T
|
|
|
794
904
|
lazyFn?: () => Promise<LazyRoute<Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>>>;
|
|
795
905
|
rank: number;
|
|
796
906
|
to: TrimPathRight<TFullPath>;
|
|
797
|
-
init: (
|
|
798
|
-
originalIndex: number;
|
|
799
|
-
}) => void;
|
|
907
|
+
init: (originalIndex: number) => void;
|
|
800
908
|
update: (options: UpdatableRouteOptions<TParentRoute, TCustomId, TFullPath, TParams, TSearchValidator, TLoaderFn, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn>) => this;
|
|
801
909
|
lazy: RouteLazyFn<Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>>;
|
|
802
910
|
addChildren: RouteAddChildrenFn<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
|
|
@@ -911,7 +1019,7 @@ interface UpdatableRouteOptions<in out TParentRoute extends AnyRoute, in out TRo
|
|
|
911
1019
|
@deprecated Use search.middlewares instead
|
|
912
1020
|
*/
|
|
913
1021
|
postSearchFilters?: Array<SearchFilter<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>>;
|
|
914
|
-
onCatch?: (error:
|
|
1022
|
+
onCatch?: (error: ErrorBoundaryTypes['error']) => void;
|
|
915
1023
|
onError?: (err: any) => void;
|
|
916
1024
|
onEnter?: (match: RouteMatch$1<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
|
|
917
1025
|
onStay?: (match: RouteMatch$1<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
|
|
@@ -953,7 +1061,12 @@ type RouteMask<TRouteTree extends AnyRoute> = {
|
|
|
953
1061
|
state?: any;
|
|
954
1062
|
unmaskOnReload?: boolean;
|
|
955
1063
|
};
|
|
956
|
-
|
|
1064
|
+
interface DefaultErrorBoundaryTypes {
|
|
1065
|
+
error: unknown;
|
|
1066
|
+
}
|
|
1067
|
+
/** Frameworks can specialize the error exposed by boundary components and callbacks. */
|
|
1068
|
+
interface ErrorBoundaryTypes extends DefaultErrorBoundaryTypes {}
|
|
1069
|
+
type ErrorComponentProps<TError = ErrorBoundaryTypes['error']> = {
|
|
957
1070
|
error: TError;
|
|
958
1071
|
info?: {
|
|
959
1072
|
componentStack: string;
|
|
@@ -966,114 +1079,13 @@ type NotFoundRouteProps = {
|
|
|
966
1079
|
routeId: RouteIds<RegisteredRouter['routeTree']>;
|
|
967
1080
|
};
|
|
968
1081
|
//#endregion
|
|
969
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
}
|
|
974
|
-
interface StandardSchemaValidator<TInput, TOutput> {
|
|
975
|
-
readonly '~standard': StandardSchemaValidatorProps<TInput, TOutput>;
|
|
976
|
-
}
|
|
977
|
-
type AnyStandardSchemaValidator = StandardSchemaValidator<any, any>;
|
|
978
|
-
interface StandardSchemaValidatorTypes<TInput, TOutput> {
|
|
979
|
-
readonly input: TInput;
|
|
980
|
-
readonly output: TOutput;
|
|
981
|
-
}
|
|
982
|
-
interface AnyStandardSchemaValidateSuccess {
|
|
983
|
-
readonly value: any;
|
|
984
|
-
readonly issues?: undefined;
|
|
985
|
-
}
|
|
986
|
-
interface AnyStandardSchemaValidateFailure {
|
|
987
|
-
readonly issues: ReadonlyArray<AnyStandardSchemaValidateIssue>;
|
|
988
|
-
}
|
|
989
|
-
interface AnyStandardSchemaValidateIssue {
|
|
990
|
-
readonly message: string;
|
|
991
|
-
}
|
|
992
|
-
type AnyStandardSchemaValidate = (value: unknown) => (AnyStandardSchemaValidateSuccess | AnyStandardSchemaValidateFailure) | Promise<AnyStandardSchemaValidateSuccess | AnyStandardSchemaValidateFailure>;
|
|
993
|
-
interface ValidatorObj<TInput, TOutput> {
|
|
994
|
-
parse: ValidatorFn<TInput, TOutput>;
|
|
995
|
-
}
|
|
996
|
-
type AnyValidatorObj = ValidatorObj<any, any>;
|
|
997
|
-
interface ValidatorAdapter<TInput, TOutput> {
|
|
998
|
-
types: {
|
|
999
|
-
input: TInput;
|
|
1000
|
-
output: TOutput;
|
|
1001
|
-
};
|
|
1002
|
-
parse: (input: unknown) => TOutput;
|
|
1003
|
-
}
|
|
1004
|
-
type AnyValidatorAdapter = ValidatorAdapter<any, any>;
|
|
1005
|
-
type ValidatorFn<TInput, TOutput> = (input: TInput) => TOutput;
|
|
1006
|
-
type Validator<TInput, TOutput> = ValidatorObj<TInput, TOutput> | ValidatorFn<TInput, TOutput> | ValidatorAdapter<TInput, TOutput> | StandardSchemaValidator<TInput, TOutput> | undefined;
|
|
1007
|
-
type AnyValidator = Validator<any, any>;
|
|
1008
|
-
type AnySchema = {};
|
|
1009
|
-
type DefaultValidator = Validator<Record<string, unknown>, AnySchema>;
|
|
1010
|
-
type ResolveSearchValidatorInputFn<TValidator> = TValidator extends ((input: infer TSchemaInput) => any) ? TSchemaInput extends SearchSchemaInput ? Omit<TSchemaInput, keyof SearchSchemaInput> : ResolveValidatorOutputFn<TValidator> : AnySchema;
|
|
1011
|
-
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>;
|
|
1012
|
-
type ResolveValidatorOutputFn<TValidator> = TValidator extends ((...args: any) => infer TSchema) ? TSchema : AnySchema;
|
|
1013
|
-
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>;
|
|
1014
|
-
//#endregion
|
|
1015
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/location.d.ts
|
|
1016
|
-
interface ParsedLocation<TSearchObj extends AnySchema = {}> {
|
|
1017
|
-
/**
|
|
1018
|
-
* The full path of the location, including pathname, search, and hash.
|
|
1019
|
-
* Does not include the origin. Is the equivalent of calling
|
|
1020
|
-
* `url.replace(url.origin, '')`
|
|
1021
|
-
*/
|
|
1022
|
-
href: string;
|
|
1023
|
-
/**
|
|
1024
|
-
* @description The pathname of the location, including the leading slash.
|
|
1025
|
-
*/
|
|
1026
|
-
pathname: string;
|
|
1027
|
-
/**
|
|
1028
|
-
* The parsed search parameters of the location in object form.
|
|
1029
|
-
*/
|
|
1030
|
-
search: TSearchObj;
|
|
1031
|
-
/**
|
|
1032
|
-
* The search string of the location, including the leading question mark.
|
|
1033
|
-
*/
|
|
1034
|
-
searchStr: string;
|
|
1035
|
-
/**
|
|
1036
|
-
* The in-memory state of the location as it *may* exist in the browser's history.
|
|
1037
|
-
*/
|
|
1038
|
-
state: ParsedHistoryState;
|
|
1039
|
-
/**
|
|
1040
|
-
* The hash of the location, excluding the leading hash character.
|
|
1041
|
-
* (e.g., '123' instead of '#123')
|
|
1042
|
-
*/
|
|
1043
|
-
hash: string;
|
|
1044
|
-
/**
|
|
1045
|
-
* The masked location of the location.
|
|
1046
|
-
*/
|
|
1047
|
-
maskedLocation?: ParsedLocation<TSearchObj>;
|
|
1048
|
-
/**
|
|
1049
|
-
* Whether to unmask the location on reload.
|
|
1050
|
-
*/
|
|
1051
|
-
unmaskOnReload?: boolean;
|
|
1052
|
-
/**
|
|
1053
|
-
* @private
|
|
1054
|
-
* @description The public href of the location.
|
|
1055
|
-
* If a rewrite is applied, the `href` property will be the rewritten URL.
|
|
1056
|
-
*/
|
|
1057
|
-
publicHref: string;
|
|
1058
|
-
/**
|
|
1059
|
-
* @private
|
|
1060
|
-
* @description Whether the publicHref is external (different origin from rewrite).
|
|
1061
|
-
*/
|
|
1062
|
-
external: boolean;
|
|
1063
|
-
}
|
|
1064
|
-
//#endregion
|
|
1065
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/load-matches.d.ts
|
|
1066
|
-
type RouteComponentType = 'component' | 'errorComponent' | 'pendingComponent' | 'notFoundComponent';
|
|
1067
|
-
declare function loadRouteChunk(route: AnyRoute, componentTypesToLoad?: Array<RouteComponentType>): Promise<void> | undefined;
|
|
1068
|
-
//#endregion
|
|
1069
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.15/node_modules/@tanstack/router-core/dist/esm/lru-cache.d.ts
|
|
1070
|
-
type LRUCache<TKey, TValue> = {
|
|
1071
|
-
get: (key: TKey) => TValue | undefined;
|
|
1072
|
-
set: (key: TKey, value: TValue) => void;
|
|
1073
|
-
clear: () => void;
|
|
1082
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/path.d.ts
|
|
1083
|
+
type InterpolationSegment = string | DynamicPathSegment;
|
|
1084
|
+
type RouteInterpolation = Array<InterpolationSegment> & {
|
|
1085
|
+
names?: Array<string>;
|
|
1074
1086
|
};
|
|
1075
1087
|
//#endregion
|
|
1076
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
1088
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.d.ts
|
|
1077
1089
|
declare const SEGMENT_TYPE_PATHNAME = 0;
|
|
1078
1090
|
declare const SEGMENT_TYPE_PARAM = 1;
|
|
1079
1091
|
declare const SEGMENT_TYPE_WILDCARD = 2;
|
|
@@ -1088,18 +1100,24 @@ type SegmentKind = typeof SEGMENT_TYPE_PATHNAME | typeof SEGMENT_TYPE_PARAM | ty
|
|
|
1088
1100
|
* All the kinds of segments that can be present in the segment tree.
|
|
1089
1101
|
*/
|
|
1090
1102
|
type ExtendedSegmentKind = SegmentKind | typeof SEGMENT_TYPE_INDEX | typeof SEGMENT_TYPE_PATHLESS;
|
|
1103
|
+
type DynamicPathSegment = [kind: Exclude<SegmentKind, typeof SEGMENT_TYPE_PATHNAME>, key: string, prefix: string,
|
|
1104
|
+
/** Undefined marks a bare splat, which discards the remaining template. */
|
|
1105
|
+
suffix: string | undefined];
|
|
1091
1106
|
type StaticSegmentNode<T extends RouteLike> = SegmentNode<T> & {
|
|
1092
1107
|
kind: typeof SEGMENT_TYPE_PATHNAME | typeof SEGMENT_TYPE_PATHLESS | typeof SEGMENT_TYPE_INDEX;
|
|
1093
1108
|
};
|
|
1094
1109
|
type DynamicSegmentNode<T extends RouteLike> = SegmentNode<T> & {
|
|
1095
1110
|
kind: typeof SEGMENT_TYPE_PARAM | typeof SEGMENT_TYPE_WILDCARD | typeof SEGMENT_TYPE_OPTIONAL_PARAM;
|
|
1096
|
-
prefix
|
|
1097
|
-
suffix
|
|
1111
|
+
prefix: string;
|
|
1112
|
+
suffix: string;
|
|
1098
1113
|
caseSensitive: boolean;
|
|
1099
1114
|
};
|
|
1100
1115
|
type AnySegmentNode<T extends RouteLike> = StaticSegmentNode<T> | DynamicSegmentNode<T>;
|
|
1101
1116
|
type SegmentNode<T extends RouteLike> = {
|
|
1102
1117
|
kind: ExtendedSegmentKind;
|
|
1118
|
+
prefix?: string;
|
|
1119
|
+
suffix?: string;
|
|
1120
|
+
caseSensitive?: boolean;
|
|
1103
1121
|
pathless: Array<StaticSegmentNode<T>> | null;
|
|
1104
1122
|
/** Exact index segment (highest priority) */
|
|
1105
1123
|
index: StaticSegmentNode<T> | null;
|
|
@@ -1115,9 +1133,9 @@ type SegmentNode<T extends RouteLike> = {
|
|
|
1115
1133
|
wildcard: Array<DynamicSegmentNode<T>> | null;
|
|
1116
1134
|
/** Terminal route (if this path can end here) */
|
|
1117
1135
|
route: T | null;
|
|
1118
|
-
/**
|
|
1119
|
-
|
|
1120
|
-
parent: AnySegmentNode<T> |
|
|
1136
|
+
/** Original template data for this candidate or parse gate. */
|
|
1137
|
+
data: RouteInterpolation | undefined;
|
|
1138
|
+
parent: AnySegmentNode<T> | undefined;
|
|
1121
1139
|
depth: number;
|
|
1122
1140
|
/** route.options.params.parse function, set on the last node of the route */
|
|
1123
1141
|
parse: null | ((params: Record<string, string>) => unknown);
|
|
@@ -1125,6 +1143,7 @@ type SegmentNode<T extends RouteLike> = {
|
|
|
1125
1143
|
priority: number;
|
|
1126
1144
|
};
|
|
1127
1145
|
type RouteLike = {
|
|
1146
|
+
_interpolation?: RouteInterpolation;
|
|
1128
1147
|
id?: string;
|
|
1129
1148
|
path?: string;
|
|
1130
1149
|
children?: Array<RouteLike>;
|
|
@@ -1157,11 +1176,11 @@ type ProcessedTree<TTree extends Extract<RouteLike, {
|
|
|
1157
1176
|
/** a mini route tree generated from the flat `routeMasks` list */
|
|
1158
1177
|
masksTree: AnySegmentNode<TFlat> | null;
|
|
1159
1178
|
/** @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree */
|
|
1160
|
-
singleCache:
|
|
1179
|
+
singleCache: SieveCache<string, AnySegmentNode<TSingle>>;
|
|
1161
1180
|
/** a cache of route matches from the `segmentTree` */
|
|
1162
|
-
matchCache:
|
|
1181
|
+
matchCache: SieveCache<string, RouteMatch<TTree> | null>;
|
|
1163
1182
|
/** a cache of route matches from the `masksTree` */
|
|
1164
|
-
flatCache:
|
|
1183
|
+
flatCache: SieveCache<string, ReturnType<typeof findMatch<TFlat>>> | null;
|
|
1165
1184
|
};
|
|
1166
1185
|
type RouteMatch<T extends Extract<RouteLike, {
|
|
1167
1186
|
fullPath: string;
|
|
@@ -1191,11 +1210,15 @@ declare function findMatch<T extends RouteLike>(path: string, segmentTree: AnySe
|
|
|
1191
1210
|
rawParams: Record<string, string>;
|
|
1192
1211
|
} | null;
|
|
1193
1212
|
//#endregion
|
|
1194
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
1213
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/searchParams.d.ts
|
|
1195
1214
|
type SearchSerializer = (searchObj: Record<string, any>) => string;
|
|
1196
1215
|
type SearchParser = (searchStr: string) => Record<string, any>;
|
|
1197
1216
|
//#endregion
|
|
1198
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
1217
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/ssr/constants.d.ts
|
|
1218
|
+
declare const GLOBAL_TSR = "$_TSR";
|
|
1219
|
+
declare const GLOBAL_SEROVAL: '$R';
|
|
1220
|
+
//#endregion
|
|
1221
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts
|
|
1199
1222
|
type AssetCrossOrigin = 'anonymous' | 'use-credentials';
|
|
1200
1223
|
type ScriptFormat = 'module' | 'iife';
|
|
1201
1224
|
declare const DEV_STYLES_ATTR = "data-tanstack-router-dev-styles";
|
|
@@ -1253,7 +1276,78 @@ type ManifestInlineCss = {
|
|
|
1253
1276
|
children?: string;
|
|
1254
1277
|
};
|
|
1255
1278
|
//#endregion
|
|
1256
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
1279
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/ssr/types.d.ts
|
|
1280
|
+
interface DehydratedMatch {
|
|
1281
|
+
i: MakeRouteMatch['id'];
|
|
1282
|
+
l?: MakeRouteMatch['loaderData'];
|
|
1283
|
+
e?: MakeRouteMatch['error'];
|
|
1284
|
+
u: MakeRouteMatch['updatedAt'];
|
|
1285
|
+
s: MakeRouteMatch['status'];
|
|
1286
|
+
ssr?: MakeRouteMatch['ssr'];
|
|
1287
|
+
g?: true;
|
|
1288
|
+
}
|
|
1289
|
+
interface DehydratedRouter {
|
|
1290
|
+
manifest: Manifest | undefined;
|
|
1291
|
+
dehydratedData?: any;
|
|
1292
|
+
matches: Array<DehydratedMatch>;
|
|
1293
|
+
}
|
|
1294
|
+
interface TsrSsrGlobal {
|
|
1295
|
+
router?: DehydratedRouter;
|
|
1296
|
+
h: () => void;
|
|
1297
|
+
e: () => void;
|
|
1298
|
+
c: () => void;
|
|
1299
|
+
p: (script: () => void) => void;
|
|
1300
|
+
buffer: Array<() => void>;
|
|
1301
|
+
t?: Map<string, (value: any) => any>;
|
|
1302
|
+
initialized?: boolean;
|
|
1303
|
+
hydrated?: boolean;
|
|
1304
|
+
streamEnded?: boolean;
|
|
1305
|
+
}
|
|
1306
|
+
//#endregion
|
|
1307
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/load-client.d.ts
|
|
1308
|
+
declare const SUCCESS = 0;
|
|
1309
|
+
declare const ERROR = 1;
|
|
1310
|
+
declare const NOT_FOUND = 2;
|
|
1311
|
+
declare const REDIRECTED = 3;
|
|
1312
|
+
declare const CANCELED = 4;
|
|
1313
|
+
type NonRedirectOutcome = [kind: typeof SUCCESS, data: unknown] | [kind: typeof ERROR, error: unknown] | [kind: typeof NOT_FOUND, error: NotFoundError] | [kind: typeof CANCELED];
|
|
1314
|
+
type RawLoaderOutcome = NonRedirectOutcome | [kind: typeof REDIRECTED, redirect: AnyRedirect];
|
|
1315
|
+
type LoaderFlight = [outcome: Promise<RawLoaderOutcome>, controller: AbortController, leases: number];
|
|
1316
|
+
type LoadTransaction = [controller: AbortController, redirects: number, location: ParsedLocation, matches: Array<AnyRouteMatch>, startedAt: number, done: Promise<void>,
|
|
1317
|
+
/**
|
|
1318
|
+
* Dev-only HMR refresh mode. Presence forces successor rematerialization
|
|
1319
|
+
* until this publication is acknowledged. The optional hydration handoff is
|
|
1320
|
+
* retired when the refresh publishes.
|
|
1321
|
+
*/
|
|
1322
|
+
refresh?: [handoff: NonNullable<AnyRouter['_handoff']> | undefined]];
|
|
1323
|
+
type PendingSession = [generation: LoadTransaction, boundaryId: string,
|
|
1324
|
+
/** Pending reveal time until acknowledged, then minimum-visible-until time. */
|
|
1325
|
+
deadline: number, revealTimer?: ReturnType<typeof setTimeout>, ack?: Promise<boolean> | true, component?: unknown];
|
|
1326
|
+
declare global {
|
|
1327
|
+
interface Window {
|
|
1328
|
+
[GLOBAL_TSR]?: TsrSsrGlobal;
|
|
1329
|
+
[GLOBAL_SEROVAL]?: any;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
//#endregion
|
|
1333
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/load-server.d.ts
|
|
1334
|
+
type ServerLoadResult = {
|
|
1335
|
+
type: 'render';
|
|
1336
|
+
status: 200 | 404 | 500;
|
|
1337
|
+
matches: Array<AnyRouteMatch>;
|
|
1338
|
+
} | {
|
|
1339
|
+
type: 'redirect';
|
|
1340
|
+
redirect: AnyRedirect;
|
|
1341
|
+
};
|
|
1342
|
+
//#endregion
|
|
1343
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/ssr/hydrationScripts.d.ts
|
|
1344
|
+
/** The one-time initial `<Scripts>` take: hydration tags plus the boundary. */
|
|
1345
|
+
type InitialHydrationScriptTags = {
|
|
1346
|
+
before: Array<RouterManagedTag>;
|
|
1347
|
+
boundary: RouterManagedTag;
|
|
1348
|
+
};
|
|
1349
|
+
//#endregion
|
|
1350
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/stores.d.ts
|
|
1257
1351
|
interface RouterReadableStore<TValue> {
|
|
1258
1352
|
get: () => TValue;
|
|
1259
1353
|
}
|
|
@@ -1270,50 +1364,26 @@ type StoreConfig = {
|
|
|
1270
1364
|
createMutableStore: MutableStoreFactory;
|
|
1271
1365
|
createReadonlyStore: ReadonlyStoreFactory;
|
|
1272
1366
|
batch: RouterBatchFn;
|
|
1273
|
-
init?: (stores: RouterStores<AnyRoute>) => void;
|
|
1274
|
-
};
|
|
1275
|
-
type MatchStore = RouterWritableStore<AnyRouteMatch> & {
|
|
1276
|
-
routeId?: string;
|
|
1277
1367
|
};
|
|
1368
|
+
type MatchStore = RouterWritableStore<AnyRouteMatch | undefined>;
|
|
1278
1369
|
type ReadableStore<TValue> = RouterReadableStore<TValue>;
|
|
1279
1370
|
interface RouterStores<in out TRouteTree extends AnyRoute> {
|
|
1280
1371
|
status: RouterWritableStore<RouterState<TRouteTree>['status']>;
|
|
1281
|
-
loadedAt: RouterWritableStore<number>;
|
|
1282
|
-
isLoading: RouterWritableStore<boolean>;
|
|
1283
|
-
isTransitioning: RouterWritableStore<boolean>;
|
|
1284
1372
|
location: RouterWritableStore<ParsedLocation<FullSearchSchema<TRouteTree>>>;
|
|
1285
1373
|
resolvedLocation: RouterWritableStore<ParsedLocation<FullSearchSchema<TRouteTree>> | undefined>;
|
|
1286
|
-
|
|
1287
|
-
redirect: RouterWritableStore<AnyRedirect | undefined>;
|
|
1288
|
-
matchesId: RouterWritableStore<Array<string>>;
|
|
1289
|
-
pendingIds: RouterWritableStore<Array<string>>;
|
|
1374
|
+
ids: RouterWritableStore<Array<string>>;
|
|
1290
1375
|
matches: ReadableStore<Array<AnyRouteMatch>>;
|
|
1291
|
-
pendingMatches: ReadableStore<Array<AnyRouteMatch>>;
|
|
1292
|
-
cachedMatches: ReadableStore<Array<AnyRouteMatch>>;
|
|
1293
|
-
firstId: ReadableStore<string | undefined>;
|
|
1294
|
-
hasPending: ReadableStore<boolean>;
|
|
1295
|
-
matchRouteDeps: ReadableStore<{
|
|
1296
|
-
locationHref: string;
|
|
1297
|
-
resolvedLocationHref: string | undefined;
|
|
1298
|
-
status: RouterState<TRouteTree>['status'];
|
|
1299
|
-
}>;
|
|
1300
1376
|
__store: RouterReadableStore<RouterState<TRouteTree>>;
|
|
1301
|
-
|
|
1302
|
-
pendingMatchStores: Map<string, MatchStore>;
|
|
1303
|
-
cachedMatchStores: Map<string, MatchStore>;
|
|
1377
|
+
byRoute: Map<string, MatchStore>;
|
|
1304
1378
|
/**
|
|
1305
|
-
* Get
|
|
1306
|
-
*
|
|
1307
|
-
* The computed depends on matchesId + the individual match store, so
|
|
1308
|
-
* subscribers are only notified when the resolved match state changes.
|
|
1379
|
+
* Get the stable atom for a route's presented match. The atom remains in the
|
|
1380
|
+
* pool when the route leaves and contains `undefined` until it re-enters.
|
|
1309
1381
|
*/
|
|
1310
|
-
|
|
1382
|
+
getMatchStore: (routeId: string) => RouterReadableStore<AnyRouteMatch | undefined>;
|
|
1311
1383
|
setMatches: (nextMatches: Array<AnyRouteMatch>) => void;
|
|
1312
|
-
setPending: (nextMatches: Array<AnyRouteMatch>) => void;
|
|
1313
|
-
setCached: (nextMatches: Array<AnyRouteMatch>) => void;
|
|
1314
1384
|
}
|
|
1315
1385
|
//#endregion
|
|
1316
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
1386
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/router.d.ts
|
|
1317
1387
|
interface Register {}
|
|
1318
1388
|
type RegisteredSsr<TRegister = Register> = TRegister extends {
|
|
1319
1389
|
ssr: infer TSSR;
|
|
@@ -1369,7 +1439,8 @@ interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extend
|
|
|
1369
1439
|
*/
|
|
1370
1440
|
defaultPreload?: false | 'intent' | 'viewport' | 'render';
|
|
1371
1441
|
/**
|
|
1372
|
-
* The delay in milliseconds
|
|
1442
|
+
* The delay in milliseconds before intent focus/hover and viewport preloading.
|
|
1443
|
+
* Touch intent preloads immediately.
|
|
1373
1444
|
*
|
|
1374
1445
|
* @default 50
|
|
1375
1446
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloaddelay-property)
|
|
@@ -1426,9 +1497,9 @@ interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extend
|
|
|
1426
1497
|
*/
|
|
1427
1498
|
defaultPreloadStaleTime?: number;
|
|
1428
1499
|
/**
|
|
1429
|
-
* The default `
|
|
1500
|
+
* The default `preloadGcTime` a route should use if none is provided.
|
|
1430
1501
|
*
|
|
1431
|
-
* @default
|
|
1502
|
+
* @default 300_000 `(5 minutes)`
|
|
1432
1503
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadgctime-property)
|
|
1433
1504
|
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
|
|
1434
1505
|
*/
|
|
@@ -1460,7 +1531,7 @@ interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extend
|
|
|
1460
1531
|
/**
|
|
1461
1532
|
* The default `gcTime` a route should use if no gcTime is provided.
|
|
1462
1533
|
*
|
|
1463
|
-
* @default
|
|
1534
|
+
* @default 300_000 `(5 minutes)`
|
|
1464
1535
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultgctime-property)
|
|
1465
1536
|
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options)
|
|
1466
1537
|
*/
|
|
@@ -1591,11 +1662,12 @@ interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extend
|
|
|
1591
1662
|
defaultStructuralSharing?: TDefaultStructuralSharingOption;
|
|
1592
1663
|
/**
|
|
1593
1664
|
* Configures which URI characters are allowed in path params that would ordinarily be escaped by encodeURIComponent.
|
|
1665
|
+
* This is read only during initialization. Create a new router to change it.
|
|
1594
1666
|
*
|
|
1595
1667
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#pathparamsallowedcharacters-property)
|
|
1596
1668
|
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/path-params#allowed-characters)
|
|
1597
1669
|
*/
|
|
1598
|
-
pathParamsAllowedCharacters?:
|
|
1670
|
+
readonly pathParamsAllowedCharacters?: ReadonlyArray<';' | ':' | '@' | '&' | '=' | '+' | '$' | ','>;
|
|
1599
1671
|
defaultRemountDeps?: DefaultRemountDepsFn<TRouteTree>;
|
|
1600
1672
|
/**
|
|
1601
1673
|
* If `true`, scroll restoration will be enabled
|
|
@@ -1650,6 +1722,11 @@ interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extend
|
|
|
1650
1722
|
* This is useful for shifting data from the origin to the path (for things like subdomain routing), or other advanced use cases.
|
|
1651
1723
|
*/
|
|
1652
1724
|
rewrite?: LocationRewrite;
|
|
1725
|
+
/**
|
|
1726
|
+
* The origin used to resolve URLs. Pass a normalized origin, such as
|
|
1727
|
+
* `https://example.com` or `http://localhost:3000`, without a path or trailing slash.
|
|
1728
|
+
* Defaults to the browser origin, or `http://localhost` on the server.
|
|
1729
|
+
*/
|
|
1653
1730
|
origin?: string;
|
|
1654
1731
|
ssr?: {
|
|
1655
1732
|
nonce?: string;
|
|
@@ -1680,14 +1757,10 @@ type LocationRewriteFunction = ({ url }: {
|
|
|
1680
1757
|
}) => undefined | string | URL;
|
|
1681
1758
|
interface RouterState<in out TRouteTree extends AnyRoute = AnyRoute, in out TRouteMatch = MakeRouteMatchUnion> {
|
|
1682
1759
|
status: 'pending' | 'idle';
|
|
1683
|
-
loadedAt: number;
|
|
1684
1760
|
isLoading: boolean;
|
|
1685
|
-
isTransitioning: boolean;
|
|
1686
1761
|
matches: Array<TRouteMatch>;
|
|
1687
1762
|
location: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1688
1763
|
resolvedLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1689
|
-
statusCode: number;
|
|
1690
|
-
redirect?: AnyRedirect;
|
|
1691
1764
|
}
|
|
1692
1765
|
interface BuildNextOptions {
|
|
1693
1766
|
to?: string | number | null;
|
|
@@ -1744,9 +1817,7 @@ type RouterListener<TRouterEvent extends RouterEvent> = {
|
|
|
1744
1817
|
};
|
|
1745
1818
|
type SubscribeFn = <TType extends keyof RouterEvents>(eventType: TType, fn: ListenerFn<RouterEvents[TType]>) => () => void;
|
|
1746
1819
|
interface MatchRoutesOpts {
|
|
1747
|
-
preload?: boolean;
|
|
1748
1820
|
throwOnError?: boolean;
|
|
1749
|
-
dest?: BuildNextOptions;
|
|
1750
1821
|
}
|
|
1751
1822
|
type InferRouterContext<TRouteTree extends AnyRoute> = TRouteTree['types']['routerContext'];
|
|
1752
1823
|
type RouterContextOptions<TRouteTree extends AnyRoute> = AnyContext extends InferRouterContext<TRouteTree> ? {
|
|
@@ -1755,31 +1826,28 @@ type RouterContextOptions<TRouteTree extends AnyRoute> = AnyContext extends Infe
|
|
|
1755
1826
|
context: InferRouterContext<TRouteTree>;
|
|
1756
1827
|
};
|
|
1757
1828
|
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>;
|
|
1758
|
-
type PreloadRouteFn<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TDefaultStructuralSharingOption extends boolean, TRouterHistory extends RouterHistory> = <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>, TFrom, TTo, TMaskFrom, TMaskTo>
|
|
1829
|
+
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>;
|
|
1759
1830
|
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'];
|
|
1760
|
-
type UpdateFn<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TDefaultStructuralSharingOption extends boolean, TRouterHistory extends RouterHistory, TDehydrated extends Record<string, any>> = (newOptions: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>) => void;
|
|
1831
|
+
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;
|
|
1761
1832
|
type InvalidateFn<TRouter extends AnyRouter> = (opts?: {
|
|
1762
1833
|
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
1763
1834
|
sync?: boolean;
|
|
1764
1835
|
forcePending?: boolean;
|
|
1765
1836
|
}) => Promise<void>;
|
|
1766
1837
|
type ParseLocationFn<TRouteTree extends AnyRoute> = (locationToParse: HistoryLocation$1, previousLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>) => ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1767
|
-
type GetMatchRoutesFn = (pathname: string) =>
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
routeParams: Record<string, string>;
|
|
1771
|
-
foundRoute: AnyRoute | undefined;
|
|
1772
|
-
parseError?: unknown;
|
|
1773
|
-
};
|
|
1838
|
+
type GetMatchRoutesFn = (pathname: string) => [matchedRoutes: ReadonlyArray<AnyRoute>,
|
|
1839
|
+
/** exhaustive params, still in their string form */
|
|
1840
|
+
rawParams: Record<string, string>, foundRoute: AnyRoute | undefined];
|
|
1774
1841
|
type EmitFn = (routerEvent: RouterEvent) => void;
|
|
1775
1842
|
type LoadFn = (opts?: {
|
|
1776
1843
|
sync?: boolean;
|
|
1777
1844
|
action?: {
|
|
1778
1845
|
type: HistoryAction;
|
|
1779
1846
|
};
|
|
1847
|
+
_signal?: AbortSignal;
|
|
1780
1848
|
}) => Promise<void>;
|
|
1781
1849
|
type CommitLocationFn = ({ viewTransition, ignoreBlocker, ...next }: ParsedLocation & CommitLocationOptions) => Promise<void>;
|
|
1782
|
-
type StartTransitionFn = (fn: () => void) =>
|
|
1850
|
+
type StartTransitionFn = (fn: () => void, expected: Array<AnyRouteMatch>) => Promise<boolean>;
|
|
1783
1851
|
interface MatchRoutesFn {
|
|
1784
1852
|
(pathname: string, locationSearch?: AnySchema, opts?: MatchRoutesOpts): Array<MakeRouteMatchUnion>;
|
|
1785
1853
|
/**
|
|
@@ -1788,22 +1856,17 @@ interface MatchRoutesFn {
|
|
|
1788
1856
|
(next: ParsedLocation, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
|
|
1789
1857
|
(pathnameOrNext: string | ParsedLocation, locationSearchOrOpts?: AnySchema | MatchRoutesOpts, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
|
|
1790
1858
|
}
|
|
1791
|
-
type GetMatchFn = (matchId: string) => AnyRouteMatch | undefined;
|
|
1792
|
-
type UpdateMatchFn = (id: string, updater: (match: AnyRouteMatch) => AnyRouteMatch) => void;
|
|
1793
1859
|
type ClearCacheFn<TRouter extends AnyRouter> = (opts?: {
|
|
1794
1860
|
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
1795
1861
|
}) => void;
|
|
1862
|
+
/**
|
|
1863
|
+
* Server-side SSR request contract.
|
|
1864
|
+
*
|
|
1865
|
+
* Tiering rule: the flat methods are the adapter/framework contract;
|
|
1866
|
+
* `hydrationScripts` is transport for the core SSR stream merger only.
|
|
1867
|
+
* New members must land on the matching tier.
|
|
1868
|
+
*/
|
|
1796
1869
|
interface ServerSsr {
|
|
1797
|
-
/** Framework-only: injects router-owned HTML into the SSR stream. */
|
|
1798
|
-
injectHtml: (html: string) => void;
|
|
1799
|
-
/** Framework-only: injects a router-owned script tag into the SSR stream. */
|
|
1800
|
-
injectScript: (script: string) => void;
|
|
1801
|
-
isDehydrated: () => boolean;
|
|
1802
|
-
isSerializationFinished: () => boolean;
|
|
1803
|
-
/** Framework-only: atomically reserves the pass-through stream path if safe. */
|
|
1804
|
-
reserveStreamFastPath: () => boolean;
|
|
1805
|
-
/** Framework-only. */
|
|
1806
|
-
onInjectedHtml: (listener: () => void) => () => void;
|
|
1807
1870
|
/** Framework-only. */
|
|
1808
1871
|
onRenderFinished: (listener: () => void) => void;
|
|
1809
1872
|
/** Framework-only. */
|
|
@@ -1816,21 +1879,28 @@ interface ServerSsr {
|
|
|
1816
1879
|
* resources whose references would otherwise pin the router (e.g. query
|
|
1817
1880
|
* cache subscriptions, gcTime timers, abort controllers).
|
|
1818
1881
|
*
|
|
1882
|
+
* `settled` is true when every value the router dehydrated has settled, so
|
|
1883
|
+
* no loader work can still be pending. It is false when the response ended
|
|
1884
|
+
* early (abort, cancellation, timeout) or never consumed the loader data.
|
|
1885
|
+
*
|
|
1819
1886
|
* Listeners run synchronously and exactly once. Errors are caught and logged.
|
|
1887
|
+
* A listener registered after cleanup already ran is invoked immediately.
|
|
1820
1888
|
*/
|
|
1821
|
-
onCleanup: (listener: () => void) => void;
|
|
1822
|
-
/** Framework-only. */
|
|
1823
|
-
onSerializationFinished: (listener: () => void) => () => void;
|
|
1889
|
+
onCleanup: (listener: (settled: boolean) => void) => void;
|
|
1824
1890
|
/** Framework-only. */
|
|
1825
1891
|
dehydrate: (opts?: {
|
|
1826
1892
|
requestAssets?: ManifestRouteAssets;
|
|
1893
|
+
signal?: AbortSignal;
|
|
1827
1894
|
}) => Promise<void>;
|
|
1895
|
+
/**
|
|
1896
|
+
* Framework-only: opt this request out of hydration output entirely (for
|
|
1897
|
+
* example a `hydrate: false` page). Call instead of `dehydrate()`, before
|
|
1898
|
+
* rendering starts. No hydration scripts are emitted, `<Scripts>` renders
|
|
1899
|
+
* no boundary, and the response takes the pass-through stream path.
|
|
1900
|
+
*/
|
|
1901
|
+
disableHydration: () => void;
|
|
1828
1902
|
/** Framework-only. */
|
|
1829
|
-
|
|
1830
|
-
/** Framework-only: takes buffered router-owned HTML. */
|
|
1831
|
-
takeBufferedHtml: () => string | undefined;
|
|
1832
|
-
/** Framework-only. */
|
|
1833
|
-
liftScriptBarrier: () => void;
|
|
1903
|
+
takeInitialHydrationScriptTags: () => InitialHydrationScriptTags | undefined;
|
|
1834
1904
|
}
|
|
1835
1905
|
interface RouterSsrLifecycle {
|
|
1836
1906
|
onServerSsrAttach?: Array<(serverSsr: ServerSsr) => void>;
|
|
@@ -1852,13 +1922,46 @@ declare const trailingSlashOptions: {
|
|
|
1852
1922
|
readonly preserve: "preserve";
|
|
1853
1923
|
};
|
|
1854
1924
|
type TrailingSlashOption = (typeof trailingSlashOptions)[keyof typeof trailingSlashOptions];
|
|
1925
|
+
/** Indexes and caches rebuilt together when the route tree changes. */
|
|
1926
|
+
type RouteTreeCaches<TRouteTree extends AnyRoute> = ProcessRouteTreeResult<TRouteTree> & {
|
|
1927
|
+
resolvePathCache: SieveCache<string, string>;
|
|
1928
|
+
};
|
|
1855
1929
|
declare global {
|
|
1856
1930
|
var __TSR_CACHE__: {
|
|
1857
1931
|
routeTree: AnyRoute;
|
|
1858
|
-
|
|
1859
|
-
|
|
1932
|
+
caseSensitive: boolean | undefined;
|
|
1933
|
+
processRouteTreeResult: RouteTreeCaches<AnyRoute>;
|
|
1860
1934
|
} | undefined;
|
|
1861
1935
|
}
|
|
1936
|
+
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>> {
|
|
1937
|
+
shouldViewTransition?: boolean | ViewTransitionOptions;
|
|
1938
|
+
/**
|
|
1939
|
+
* Foreground lifecycle boundary survives invalidation/background statuses.
|
|
1940
|
+
* Zero or undefined means the whole branch participates.
|
|
1941
|
+
*/
|
|
1942
|
+
_lifecycleEnd?: number;
|
|
1943
|
+
/** Current client load transaction and owner of navigation writes. */
|
|
1944
|
+
_tx?: LoadTransaction;
|
|
1945
|
+
/** Joinable in-flight loader generations keyed by match ID. */
|
|
1946
|
+
_flights?: Map<string, LoaderFlight>;
|
|
1947
|
+
/** Active speculative lanes retained for cancellation, invalidation, and cache clearing. */
|
|
1948
|
+
_preloads?: Map<AbortController, Array<AnyRouteMatch>>;
|
|
1949
|
+
/** Owns cancellable work before a client transaction publishes. */
|
|
1950
|
+
_preflight?: AbortController;
|
|
1951
|
+
/** Transfers one reconstructed SSR prefix into its initial client load. */
|
|
1952
|
+
_handoff?: HydrationHandoff;
|
|
1953
|
+
/** Pending-boundary reveal and minimum-visible timing state. */
|
|
1954
|
+
_pending?: PendingSession;
|
|
1955
|
+
/** Result of the latest server load, used to render or redirect. */
|
|
1956
|
+
_serverResult?: ServerLoadResult;
|
|
1957
|
+
/** Framework publication waiting for an exact render acknowledgement. */
|
|
1958
|
+
_rendered?: [offered?: Array<AnyRouteMatch>, settle?: (rendered: boolean) => void];
|
|
1959
|
+
/** Development-only HMR reload for a route and its descendants. */
|
|
1960
|
+
_refreshRoute: (() => Promise<void>) | undefined;
|
|
1961
|
+
/** Development-only replacement for a route's lazy chunk owner. */
|
|
1962
|
+
_replaceRouteChunk: ((route: AnyRoute, lazyFn: AnyRoute['lazyFn']) => void) | undefined;
|
|
1963
|
+
}
|
|
1964
|
+
type HydrationHandoff = [claim: () => AbortController | undefined, finish: (matches?: Array<AnyRouteMatch>) => number | undefined];
|
|
1862
1965
|
/**
|
|
1863
1966
|
* Core, framework-agnostic router engine that powers TanStack Router.
|
|
1864
1967
|
*
|
|
@@ -1871,35 +1974,36 @@ declare global {
|
|
|
1871
1974
|
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>> {
|
|
1872
1975
|
tempLocationKey: string | undefined;
|
|
1873
1976
|
_scroll: {
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1977
|
+
n: boolean;
|
|
1978
|
+
h?: boolean;
|
|
1979
|
+
e?: boolean;
|
|
1980
|
+
s?: boolean;
|
|
1981
|
+
r?: boolean;
|
|
1879
1982
|
};
|
|
1880
|
-
shouldViewTransition?: boolean | ViewTransitionOptions;
|
|
1881
|
-
isViewTransitionTypesSupported?: boolean;
|
|
1882
1983
|
subscribers: Set<RouterListener<RouterEvent>>;
|
|
1883
|
-
|
|
1984
|
+
/** Accepted off-screen loader generations keyed by match ID. */
|
|
1985
|
+
_cache: Map<string, AnyRouteMatch>;
|
|
1986
|
+
/** Accepted semantic lane, excluding temporary pending presentation. */
|
|
1987
|
+
_committed: Array<AnyRouteMatch>;
|
|
1884
1988
|
stores: RouterStores<TRouteTree>;
|
|
1885
1989
|
private getStoreConfig;
|
|
1886
1990
|
batch: (fn: () => void) => void;
|
|
1887
1991
|
options: PickAsRequired<RouterOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>, 'stringifySearch' | 'parseSearch' | 'context'>;
|
|
1888
1992
|
history: TRouterHistory;
|
|
1889
1993
|
rewrite?: LocationRewrite;
|
|
1890
|
-
origin
|
|
1994
|
+
origin: string;
|
|
1891
1995
|
latestLocation: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1892
|
-
|
|
1996
|
+
_pendingLocation?: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
1893
1997
|
basepath: string;
|
|
1894
1998
|
routeTree: TRouteTree;
|
|
1895
1999
|
routesById: RoutesById<TRouteTree>;
|
|
1896
2000
|
routesByPath: RoutesByPath<TRouteTree>;
|
|
1897
2001
|
processedTree: ProcessedTree<TRouteTree, any, any>;
|
|
1898
|
-
resolvePathCache:
|
|
1899
|
-
private routeBranchCache;
|
|
2002
|
+
resolvePathCache: SieveCache<string, string>;
|
|
1900
2003
|
private lightweightCache;
|
|
2004
|
+
private staticLocations;
|
|
1901
2005
|
isServer: boolean;
|
|
1902
|
-
pathParamsDecoder?: (encoded: string) => string;
|
|
2006
|
+
readonly pathParamsDecoder?: (encoded: string) => string;
|
|
1903
2007
|
protocolAllowlist: Set<string>;
|
|
1904
2008
|
/**
|
|
1905
2009
|
* @deprecated Use the `createRouter` function instead
|
|
@@ -1907,12 +2011,11 @@ declare class RouterCore<in out TRouteTree extends AnyRoute, in out TTrailingSla
|
|
|
1907
2011
|
constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>, getStoreConfig: GetStoreConfig);
|
|
1908
2012
|
startTransition: StartTransitionFn;
|
|
1909
2013
|
isShell(): boolean;
|
|
1910
|
-
isPrerendering(): boolean;
|
|
1911
2014
|
update: UpdateFn<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>;
|
|
1912
2015
|
get state(): RouterState<TRouteTree>;
|
|
1913
2016
|
updateLatestLocation: () => void;
|
|
1914
|
-
buildRouteTree: () =>
|
|
1915
|
-
setRoutes(
|
|
2017
|
+
buildRouteTree: () => RouteTreeCaches<TRouteTree>;
|
|
2018
|
+
setRoutes(caches: RouteTreeCaches<TRouteTree>): void;
|
|
1916
2019
|
/**
|
|
1917
2020
|
* Subscribe to router lifecycle events like `onBeforeNavigate`, `onLoad`,
|
|
1918
2021
|
* `onResolved`, etc. Returns an unsubscribe function.
|
|
@@ -1926,38 +2029,35 @@ declare class RouterCore<in out TRouteTree extends AnyRoute, in out TTrailingSla
|
|
|
1926
2029
|
* current router options, rewrite rules and search parser/stringifier.
|
|
1927
2030
|
*/
|
|
1928
2031
|
parseLocation: ParseLocationFn<TRouteTree>;
|
|
1929
|
-
/** Resolve a path using the router's trailing-slash policy. */
|
|
1930
|
-
resolvePathWithBase: (from: string, path: string) => string;
|
|
1931
|
-
private getRouteBranch;
|
|
1932
|
-
get looseRoutesById(): Record<string, AnyRoute>;
|
|
1933
2032
|
matchRoutes: MatchRoutesFn;
|
|
1934
|
-
private getParentContext;
|
|
1935
2033
|
private matchRoutesInternal;
|
|
1936
2034
|
getMatchedRoutes: GetMatchRoutesFn;
|
|
1937
2035
|
/**
|
|
1938
2036
|
* Lightweight route matching for buildLocation.
|
|
1939
2037
|
* Only computes fullPath, accumulated search, and params - skipping expensive
|
|
1940
|
-
* operations like AbortController,
|
|
2038
|
+
* operations like AbortController, loaderDeps, and full match objects.
|
|
1941
2039
|
*/
|
|
1942
2040
|
private matchRoutesLightweight;
|
|
1943
|
-
cancelMatch: (id: string) => void;
|
|
1944
|
-
cancelMatches: () => void;
|
|
1945
2041
|
/**
|
|
1946
2042
|
* Build the next ParsedLocation from navigation options without committing.
|
|
1947
2043
|
* Resolves `to`/`from`, params/search/hash/state, applies search validation
|
|
1948
|
-
* and middlewares, and returns a
|
|
2044
|
+
* and middlewares, and returns a stringified location object. The built
|
|
2045
|
+
* `search` and `state` are not structurally shared with the current
|
|
2046
|
+
* location; `parseLocation` stabilizes them once the location is committed.
|
|
1949
2047
|
*
|
|
1950
2048
|
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouterType#buildlocation-method
|
|
1951
2049
|
*/
|
|
1952
2050
|
buildLocation: BuildLocationFn;
|
|
1953
|
-
|
|
2051
|
+
_commitPromise: (Promise<void> & {
|
|
2052
|
+
resolve: () => void;
|
|
2053
|
+
}) | undefined;
|
|
1954
2054
|
/**
|
|
1955
2055
|
* Commit a previously built location to history (push/replace), optionally
|
|
1956
2056
|
* using view transitions and scroll restoration options.
|
|
1957
2057
|
*/
|
|
1958
2058
|
commitLocation: CommitLocationFn;
|
|
1959
2059
|
/** Convenience helper: build a location from options, then commit it. */
|
|
1960
|
-
buildAndCommitLocation: ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker,
|
|
2060
|
+
buildAndCommitLocation: ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, ...rest }?: BuildNextOptions & CommitLocationOptions) => Promise<void>;
|
|
1961
2061
|
/**
|
|
1962
2062
|
* Imperatively navigate using standard `NavigateOptions`. When `reloadDocument`
|
|
1963
2063
|
* or an absolute `href` is provided, performs a full document navigation.
|
|
@@ -1966,75 +2066,70 @@ declare class RouterCore<in out TRouteTree extends AnyRoute, in out TTrailingSla
|
|
|
1966
2066
|
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType
|
|
1967
2067
|
*/
|
|
1968
2068
|
navigate: NavigateFn;
|
|
1969
|
-
latestLoadPromise: undefined | Promise<void>;
|
|
1970
|
-
beforeLoad: () => void;
|
|
1971
2069
|
load: LoadFn;
|
|
1972
|
-
startViewTransition: (fn: () => Promise<void>) =>
|
|
1973
|
-
updateMatch: UpdateMatchFn;
|
|
1974
|
-
getMatch: GetMatchFn;
|
|
2070
|
+
startViewTransition: (fn: () => Promise<void>) => any;
|
|
1975
2071
|
/**
|
|
1976
|
-
* Invalidate
|
|
2072
|
+
* Invalidate selected match generations and optionally force current matches
|
|
2073
|
+
* back into a pending state.
|
|
2074
|
+
*
|
|
2075
|
+
* - Marks committed and cached matches whose IDs are selected as invalid.
|
|
2076
|
+
* - Retires selected active preloads so older work cannot publish fresh data.
|
|
1977
2077
|
*
|
|
1978
|
-
*
|
|
1979
|
-
*
|
|
1980
|
-
* its status is reset to `'pending'` and its `error` cleared so that the loader is re-run
|
|
1981
|
-
* on the next `load()` call (eg. after HMR or a manual invalidation).
|
|
2078
|
+
* The next load decides when to publish pending UI, so invalidation does not
|
|
2079
|
+
* mutate the currently rendered status.
|
|
1982
2080
|
*/
|
|
1983
2081
|
invalidate: InvalidateFn<RouterCore<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>>;
|
|
1984
|
-
getParsedLocationHref: (location: ParsedLocation) => string;
|
|
1985
2082
|
resolveRedirect: (redirect: AnyRedirect) => AnyRedirect;
|
|
1986
2083
|
clearCache: ClearCacheFn<this>;
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
preloadRoute: PreloadRouteFn<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory>;
|
|
2084
|
+
loadRouteChunk: (route: AnyRoute, componentType?: 'errorComponent' | 'notFoundComponent' | false) => Promise<void> | undefined;
|
|
2085
|
+
preloadRoute: PreloadRouteFn<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory, TDehydrated>;
|
|
1990
2086
|
matchRoute: MatchRouteFn<TRouteTree, TTrailingSlashOption, TDefaultStructuralSharingOption, TRouterHistory>;
|
|
1991
2087
|
ssr?: {
|
|
1992
2088
|
manifest: Manifest | undefined;
|
|
1993
2089
|
};
|
|
1994
2090
|
serverSsr?: ServerSsr;
|
|
1995
2091
|
serverSsrLifecycle?: RouterSsrLifecycle;
|
|
1996
|
-
hasNotFoundMatch: () => boolean;
|
|
1997
2092
|
}
|
|
1998
2093
|
//#endregion
|
|
1999
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
2094
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/global.d.ts
|
|
2000
2095
|
declare global {
|
|
2001
2096
|
interface Window {
|
|
2002
2097
|
__TSR_ROUTER__?: AnyRouter;
|
|
2003
2098
|
}
|
|
2004
2099
|
}
|
|
2005
2100
|
//#endregion
|
|
2006
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
2101
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/structuralSharing.d.ts
|
|
2007
2102
|
interface OptionalStructuralSharing<TStructuralSharing, TConstraint> {
|
|
2008
2103
|
readonly structuralSharing?: Constrain<TStructuralSharing, TConstraint> | undefined;
|
|
2009
2104
|
}
|
|
2010
2105
|
//#endregion
|
|
2011
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
2106
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/useRouteContext.d.ts
|
|
2012
2107
|
interface UseRouteContextBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> {
|
|
2013
2108
|
select?: (search: ResolveUseRouteContext<TRouter, TFrom, TStrict>) => TSelected;
|
|
2014
2109
|
}
|
|
2015
2110
|
type ResolveUseRouteContext<TRouter extends AnyRouter, TFrom, TStrict extends boolean> = TStrict extends false ? AllContext<TRouter['routeTree']> : Expand<RouteById<TRouter['routeTree'], TFrom>['types']['allContext']>;
|
|
2016
2111
|
type UseRouteContextResult<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> = unknown extends TSelected ? ResolveUseRouteContext<TRouter, TFrom, TStrict> : TSelected;
|
|
2017
2112
|
//#endregion
|
|
2018
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
2113
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/useSearch.d.ts
|
|
2019
2114
|
type UseSearchResult<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> = unknown extends TSelected ? ResolveUseSearch<TRouter, TFrom, TStrict> : TSelected;
|
|
2020
2115
|
type ResolveUseSearch<TRouter extends AnyRouter, TFrom, TStrict extends boolean> = TStrict extends false ? FullSearchSchema<TRouter['routeTree']> : Expand<RouteById<TRouter['routeTree'], TFrom>['types']['fullSearchSchema']>;
|
|
2021
2116
|
//#endregion
|
|
2022
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
2117
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/useParams.d.ts
|
|
2023
2118
|
type ResolveUseParams<TRouter extends AnyRouter, TFrom, TStrict extends boolean> = TStrict extends false ? AllParams<TRouter['routeTree']> : Expand<RouteById<TRouter['routeTree'], TFrom>['types']['allParams']>;
|
|
2024
2119
|
type UseParamsResult<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> = unknown extends TSelected ? ResolveUseParams<TRouter, TFrom, TStrict> : TSelected;
|
|
2025
2120
|
//#endregion
|
|
2026
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
2121
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/useNavigate.d.ts
|
|
2027
2122
|
type UseNavigateResult<TDefaultFrom extends string> = <TRouter extends RegisteredRouter, TTo extends string | undefined, TFrom extends string = TDefaultFrom, TMaskFrom extends string = TFrom, TMaskTo extends string = ''>({ from, ...rest }: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>) => Promise<void>;
|
|
2028
2123
|
//#endregion
|
|
2029
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
2124
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/useLoaderDeps.d.ts
|
|
2030
2125
|
type ResolveUseLoaderDeps<TRouter extends AnyRouter, TFrom> = Expand<RouteById<TRouter['routeTree'], TFrom>['types']['loaderDeps']>;
|
|
2031
2126
|
type UseLoaderDepsResult<TRouter extends AnyRouter, TFrom, TSelected> = unknown extends TSelected ? ResolveUseLoaderDeps<TRouter, TFrom> : TSelected;
|
|
2032
2127
|
//#endregion
|
|
2033
|
-
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.
|
|
2128
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.171.33/node_modules/@tanstack/router-core/dist/esm/useLoaderData.d.ts
|
|
2034
2129
|
type ResolveUseLoaderData<TRouter extends AnyRouter, TFrom, TStrict extends boolean> = TStrict extends false ? AllLoaderData<TRouter['routeTree']> : Expand<RouteById<TRouter['routeTree'], TFrom>['types']['loaderData']>;
|
|
2035
2130
|
type UseLoaderDataResult<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> = unknown extends TSelected ? ResolveUseLoaderData<TRouter, TFrom, TStrict> : TSelected;
|
|
2036
2131
|
//#endregion
|
|
2037
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2132
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/structuralSharing.d.ts
|
|
2038
2133
|
type DefaultStructuralSharingEnabled<TRouter extends AnyRouter> = boolean extends TRouter['options']['defaultStructuralSharing'] ? false : NonNullable<TRouter['options']['defaultStructuralSharing']>;
|
|
2039
2134
|
interface RequiredStructuralSharing<TStructuralSharing, TConstraint> {
|
|
2040
2135
|
readonly structuralSharing: Constrain<TStructuralSharing, TConstraint>;
|
|
@@ -2043,44 +2138,44 @@ type StructuralSharingOption<TRouter extends AnyRouter, TSelected, TStructuralSh
|
|
|
2043
2138
|
type StructuralSharingEnabled<TRouter extends AnyRouter, TStructuralSharing> = boolean extends TStructuralSharing ? DefaultStructuralSharingEnabled<TRouter> : TStructuralSharing;
|
|
2044
2139
|
type ValidateSelected<TRouter extends AnyRouter, TSelected, TStructuralSharing> = StructuralSharingEnabled<TRouter, TStructuralSharing> extends true ? ValidateJSON<TSelected> : TSelected;
|
|
2045
2140
|
//#endregion
|
|
2046
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2141
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useLoaderData.d.ts
|
|
2047
2142
|
interface UseLoaderDataBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected, TStructuralSharing> {
|
|
2048
2143
|
select?: (match: ResolveUseLoaderData<TRouter, TFrom, TStrict>) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
|
|
2049
2144
|
}
|
|
2050
2145
|
type UseLoaderDataRoute<out TId> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts?: UseLoaderDataBaseOptions<TRouter, TId, true, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>) => UseLoaderDataResult<TRouter, TId, true, TSelected>;
|
|
2051
2146
|
//#endregion
|
|
2052
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2147
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useMatch.d.ts
|
|
2053
2148
|
interface UseMatchBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TThrow extends boolean, TSelected, TStructuralSharing extends boolean> {
|
|
2054
2149
|
select?: (match: MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict>) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
|
|
2055
2150
|
shouldThrow?: TThrow;
|
|
2056
2151
|
}
|
|
2057
|
-
type UseMatchRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts?: UseMatchBaseOptions<TRouter, TFrom, true,
|
|
2152
|
+
type UseMatchRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean, TThrow extends boolean = true>(opts?: UseMatchBaseOptions<TRouter, TFrom, true, TThrow, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>) => ThrowOrOptional<UseMatchResult<TRouter, TFrom, true, TSelected>, TThrow>;
|
|
2058
2153
|
type UseMatchResult<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TSelected> = unknown extends TSelected ? TStrict extends true ? MakeRouteMatch<TRouter['routeTree'], TFrom, TStrict> : MakeRouteMatchUnion<TRouter> : TSelected;
|
|
2059
2154
|
//#endregion
|
|
2060
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2155
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useLoaderDeps.d.ts
|
|
2061
2156
|
interface UseLoaderDepsBaseOptions<TRouter extends AnyRouter, TFrom, TSelected, TStructuralSharing> {
|
|
2062
2157
|
select?: (deps: ResolveUseLoaderDeps<TRouter, TFrom>) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
|
|
2063
2158
|
}
|
|
2064
2159
|
type UseLoaderDepsRoute<out TId> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts?: UseLoaderDepsBaseOptions<TRouter, TId, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>) => UseLoaderDepsResult<TRouter, TId, TSelected>;
|
|
2065
2160
|
//#endregion
|
|
2066
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2161
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useParams.d.ts
|
|
2067
2162
|
interface UseParamsBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TThrow extends boolean, TSelected, TStructuralSharing> {
|
|
2068
2163
|
select?: (params: ResolveUseParams<TRouter, TFrom, TStrict>) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
|
|
2069
2164
|
shouldThrow?: TThrow;
|
|
2070
2165
|
}
|
|
2071
|
-
type UseParamsRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts?: UseParamsBaseOptions<TRouter, TFrom, true,
|
|
2166
|
+
type UseParamsRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean, TThrow extends boolean = true>(opts?: UseParamsBaseOptions<TRouter, TFrom, true, TThrow, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>) => ThrowOrOptional<UseParamsResult<TRouter, TFrom, true, TSelected>, TThrow>;
|
|
2072
2167
|
//#endregion
|
|
2073
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2168
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useSearch.d.ts
|
|
2074
2169
|
interface UseSearchBaseOptions<TRouter extends AnyRouter, TFrom, TStrict extends boolean, TThrow extends boolean, TSelected, TStructuralSharing> {
|
|
2075
2170
|
select?: (state: ResolveUseSearch<TRouter, TFrom, TStrict>) => ValidateSelected<TRouter, TSelected, TStructuralSharing>;
|
|
2076
2171
|
shouldThrow?: TThrow;
|
|
2077
2172
|
}
|
|
2078
|
-
type UseSearchRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean>(opts?: UseSearchBaseOptions<TRouter, TFrom, true,
|
|
2173
|
+
type UseSearchRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, TStructuralSharing extends boolean = boolean, TThrow extends boolean = true>(opts?: UseSearchBaseOptions<TRouter, TFrom, true, TThrow, TSelected, TStructuralSharing> & StructuralSharingOption<TRouter, TSelected, TStructuralSharing>) => ThrowOrOptional<UseSearchResult<TRouter, TFrom, true, TSelected>, TThrow>;
|
|
2079
2174
|
//#endregion
|
|
2080
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2175
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/useRouteContext.d.ts
|
|
2081
2176
|
type UseRouteContextRoute<out TFrom> = <TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown>(opts?: UseRouteContextBaseOptions<TRouter, TFrom, true, TSelected>) => UseRouteContextResult<TRouter, TFrom, true, TSelected>;
|
|
2082
2177
|
//#endregion
|
|
2083
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2178
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/link.d.ts
|
|
2084
2179
|
type UseLinkReactProps<TComp> = TComp extends keyof React$2.JSX.IntrinsicElements ? React$2.JSX.IntrinsicElements[TComp] : TComp extends React$2.ComponentType<any> ? React$2.ComponentPropsWithoutRef<TComp> & React$2.RefAttributes<React$2.ComponentRef<TComp>> : never;
|
|
2085
2180
|
type ActiveLinkOptions<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = LinkOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & ActiveLinkOptionProps<TComp>;
|
|
2086
2181
|
type ActiveLinkProps<TComp> = Partial<LinkComponentReactProps<TComp> & {
|
|
@@ -2102,7 +2197,6 @@ type LinkProps<TComp = 'a', TRouter extends AnyRouter = RegisteredRouter, TFrom
|
|
|
2102
2197
|
interface LinkPropsChildren {
|
|
2103
2198
|
children?: React$2.ReactNode | ((state: {
|
|
2104
2199
|
isActive: boolean;
|
|
2105
|
-
isTransitioning: boolean;
|
|
2106
2200
|
}) => React$2.ReactNode);
|
|
2107
2201
|
}
|
|
2108
2202
|
type LinkComponentReactProps<TComp> = Omit<UseLinkReactProps<TComp>, keyof CreateLinkProps>;
|
|
@@ -2113,7 +2207,7 @@ interface LinkComponentRoute<in out TDefaultFrom extends string = string> {
|
|
|
2113
2207
|
<TRouter extends AnyRouter = RegisteredRouter, const TTo extends string | undefined = undefined, const TMaskTo extends string = ''>(props: LinkComponentProps<'a', TRouter, this['defaultFrom'], TTo, this['defaultFrom'], TMaskTo>): React$2.ReactElement;
|
|
2114
2208
|
}
|
|
2115
2209
|
//#endregion
|
|
2116
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2210
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/route.d.ts
|
|
2117
2211
|
declare module '@tanstack/router-core' {
|
|
2118
2212
|
interface UpdatableRouteOptionsExtensions {
|
|
2119
2213
|
component?: RouteComponent;
|
|
@@ -2142,13 +2236,13 @@ interface DefaultRouteTypes<TProps> {
|
|
|
2142
2236
|
}
|
|
2143
2237
|
interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}
|
|
2144
2238
|
type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {
|
|
2145
|
-
preload?: () => Promise<void
|
|
2239
|
+
preload?: () => Promise<void> | undefined;
|
|
2146
2240
|
};
|
|
2147
2241
|
type RouteComponent = AsyncRouteComponent<{}>;
|
|
2148
2242
|
type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>;
|
|
2149
2243
|
type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component'];
|
|
2150
2244
|
//#endregion
|
|
2151
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2245
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/fileRoute.d.ts
|
|
2152
2246
|
declare module '@tanstack/router-core' {
|
|
2153
2247
|
interface LazyRoute<in out TRoute extends AnyRoute> {
|
|
2154
2248
|
useMatch: UseMatchRoute<TRoute['id']>;
|
|
@@ -2161,7 +2255,7 @@ declare module '@tanstack/router-core' {
|
|
|
2161
2255
|
}
|
|
2162
2256
|
}
|
|
2163
2257
|
//#endregion
|
|
2164
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2258
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/history.d.ts
|
|
2165
2259
|
declare module '@tanstack/history' {
|
|
2166
2260
|
interface HistoryState {
|
|
2167
2261
|
__tempLocation?: HistoryLocation;
|
|
@@ -2170,7 +2264,7 @@ declare module '@tanstack/history' {
|
|
|
2170
2264
|
}
|
|
2171
2265
|
}
|
|
2172
2266
|
//#endregion
|
|
2173
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2267
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/Matches.d.ts
|
|
2174
2268
|
declare module '@tanstack/router-core' {
|
|
2175
2269
|
interface RouteMatchExtensions {
|
|
2176
2270
|
meta?: Array<React$2.JSX.IntrinsicElements['meta'] | undefined>;
|
|
@@ -2181,7 +2275,7 @@ declare module '@tanstack/router-core' {
|
|
|
2181
2275
|
}
|
|
2182
2276
|
}
|
|
2183
2277
|
//#endregion
|
|
2184
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2278
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/router.d.ts
|
|
2185
2279
|
declare module '@tanstack/router-core' {
|
|
2186
2280
|
interface RouterOptionsExtensions {
|
|
2187
2281
|
/**
|
|
@@ -2244,11 +2338,11 @@ declare module '@tanstack/router-core' {
|
|
|
2244
2338
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)
|
|
2245
2339
|
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)
|
|
2246
2340
|
*/
|
|
2247
|
-
defaultOnCatch?: (error:
|
|
2341
|
+
defaultOnCatch?: (error: unknown, errorInfo: React.ErrorInfo) => void;
|
|
2248
2342
|
}
|
|
2249
2343
|
}
|
|
2250
2344
|
//#endregion
|
|
2251
|
-
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.
|
|
2345
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-router@1.170.40_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@tanstack/react-router/dist/esm/ssr/serializer.d.ts
|
|
2252
2346
|
declare module '@tanstack/router-core' {
|
|
2253
2347
|
interface SerializerExtensions {
|
|
2254
2348
|
ReadableStream: React$2.JSX.Element;
|
|
@@ -2257,18 +2351,27 @@ declare module '@tanstack/router-core' {
|
|
|
2257
2351
|
//#endregion
|
|
2258
2352
|
//#region src/loaders.d.ts
|
|
2259
2353
|
/**
|
|
2260
|
-
*
|
|
2261
|
-
*
|
|
2262
|
-
*
|
|
2263
|
-
|
|
2264
|
-
|
|
2354
|
+
* Internal type for extracting route info from TanStack context.
|
|
2355
|
+
* This is a minimal interface used only for instrumentation - the actual
|
|
2356
|
+
* TanStack types flow through the generic parameter.
|
|
2357
|
+
*/
|
|
2358
|
+
interface TanStackContextInternal {
|
|
2359
|
+
route?: {
|
|
2360
|
+
id?: string;
|
|
2361
|
+
};
|
|
2362
|
+
params?: Record<string, string>;
|
|
2363
|
+
}
|
|
2364
|
+
/**
|
|
2365
|
+
* Trace a TanStack route loader with OpenTelemetry
|
|
2265
2366
|
*
|
|
2266
|
-
*
|
|
2267
|
-
*
|
|
2367
|
+
* Creates a span per invocation with the route id, params (optionally) and
|
|
2368
|
+
* errors. Call it from inside the route's own loader and pass its context
|
|
2369
|
+
* through, so TanStack Router keeps typing params and context.
|
|
2268
2370
|
*
|
|
2269
|
-
* @param
|
|
2371
|
+
* @param context - The loader context TanStack passed in
|
|
2372
|
+
* @param loaderFn - The loader logic to trace
|
|
2270
2373
|
* @param config - Configuration options
|
|
2271
|
-
* @returns
|
|
2374
|
+
* @returns Whatever loaderFn returns
|
|
2272
2375
|
*
|
|
2273
2376
|
* @example
|
|
2274
2377
|
* ```typescript
|
|
@@ -2276,37 +2379,27 @@ declare module '@tanstack/router-core' {
|
|
|
2276
2379
|
* import { traceLoader } from 'autotel-tanstack/loaders';
|
|
2277
2380
|
*
|
|
2278
2381
|
* export const Route = createFileRoute('/users/$userId')({
|
|
2279
|
-
*
|
|
2280
|
-
*
|
|
2281
|
-
*
|
|
2282
|
-
*
|
|
2283
|
-
* });
|
|
2284
|
-
* ```
|
|
2285
|
-
*
|
|
2286
|
-
* @example
|
|
2287
|
-
* ```typescript
|
|
2288
|
-
* // Sync loaders are also supported
|
|
2289
|
-
* export const Route = createFileRoute('/static')({
|
|
2290
|
-
* loader: traceLoader(({ context }) => ({
|
|
2291
|
-
* message: `Welcome, ${context.userId}!`,
|
|
2292
|
-
* })),
|
|
2382
|
+
* loader: (ctx) =>
|
|
2383
|
+
* traceLoader(ctx, async ({ params }) => {
|
|
2384
|
+
* return await db.users.findUnique({ where: { id: params.userId } });
|
|
2385
|
+
* }),
|
|
2293
2386
|
* });
|
|
2294
2387
|
* ```
|
|
2295
2388
|
*/
|
|
2296
|
-
declare function traceLoader<
|
|
2389
|
+
declare function traceLoader<TContext extends TanStackContextInternal, TResult>(context: TContext, loaderFn: (context: TContext) => TResult, config?: TraceLoaderConfig): TResult;
|
|
2297
2390
|
/**
|
|
2298
|
-
*
|
|
2299
|
-
*
|
|
2300
|
-
* This function wraps a beforeLoad function to automatically create spans.
|
|
2301
|
-
* beforeLoad runs before the route component renders and is typically
|
|
2302
|
-
* used for auth checks, redirects, or data prefetching.
|
|
2391
|
+
* Trace a TanStack route beforeLoad with OpenTelemetry
|
|
2303
2392
|
*
|
|
2304
|
-
*
|
|
2305
|
-
*
|
|
2393
|
+
* beforeLoad runs before the route component renders and is typically used
|
|
2394
|
+
* for auth checks, redirects, or data prefetching. Call this from inside the
|
|
2395
|
+
* route's own beforeLoad and pass its context through. TanStack Router types
|
|
2396
|
+
* the context from the function you write, and the return value flows to the
|
|
2397
|
+
* loader's context.
|
|
2306
2398
|
*
|
|
2307
|
-
* @param
|
|
2399
|
+
* @param context - The beforeLoad context TanStack passed in
|
|
2400
|
+
* @param beforeLoadFn - The beforeLoad logic to trace
|
|
2308
2401
|
* @param config - Configuration options
|
|
2309
|
-
* @returns
|
|
2402
|
+
* @returns Whatever beforeLoadFn returns
|
|
2310
2403
|
*
|
|
2311
2404
|
* @example
|
|
2312
2405
|
* ```typescript
|
|
@@ -2314,21 +2407,18 @@ declare function traceLoader<TLoaderFn extends (ctx: any) => any>(loaderFn: TLoa
|
|
|
2314
2407
|
* import { traceBeforeLoad } from 'autotel-tanstack/loaders';
|
|
2315
2408
|
*
|
|
2316
2409
|
* export const Route = createFileRoute('/dashboard')({
|
|
2317
|
-
*
|
|
2318
|
-
*
|
|
2319
|
-
*
|
|
2320
|
-
*
|
|
2321
|
-
*
|
|
2322
|
-
*
|
|
2323
|
-
*
|
|
2324
|
-
* loader: ({ context }) => {
|
|
2325
|
-
* // context.userId is typed from beforeLoad return
|
|
2326
|
-
* return { user: context.userId };
|
|
2327
|
-
* },
|
|
2410
|
+
* beforeLoad: (ctx) =>
|
|
2411
|
+
* traceBeforeLoad(ctx, async ({ context, params }) => {
|
|
2412
|
+
* if (!context.auth.isAuthenticated) {
|
|
2413
|
+
* throw redirect({ to: '/login' });
|
|
2414
|
+
* }
|
|
2415
|
+
* return { userId: params.userId }; // flows to the loader's context
|
|
2416
|
+
* }),
|
|
2417
|
+
* loader: ({ context }) => ({ user: context.userId }),
|
|
2328
2418
|
* });
|
|
2329
2419
|
* ```
|
|
2330
2420
|
*/
|
|
2331
|
-
declare function traceBeforeLoad<
|
|
2421
|
+
declare function traceBeforeLoad<TContext extends TanStackContextInternal, TResult>(context: TContext, beforeLoadFn: (context: TContext) => TResult, config?: TraceLoaderConfig): TResult;
|
|
2332
2422
|
/**
|
|
2333
2423
|
* Create a traced route configuration helper
|
|
2334
2424
|
*
|
|
@@ -2337,7 +2427,7 @@ declare function traceBeforeLoad<TBeforeLoadFn extends (opts: any) => any>(befor
|
|
|
2337
2427
|
*
|
|
2338
2428
|
* @param routeId - The route identifier
|
|
2339
2429
|
* @param config - Tracing configuration
|
|
2340
|
-
* @returns Object with
|
|
2430
|
+
* @returns Object with loader and beforeLoad tracers named after the route
|
|
2341
2431
|
*
|
|
2342
2432
|
* @example
|
|
2343
2433
|
* ```typescript
|
|
@@ -2347,24 +2437,26 @@ declare function traceBeforeLoad<TBeforeLoadFn extends (opts: any) => any>(befor
|
|
|
2347
2437
|
* const traced = createTracedRoute('/users/$userId');
|
|
2348
2438
|
*
|
|
2349
2439
|
* export const Route = createFileRoute('/users/$userId')({
|
|
2350
|
-
* beforeLoad:
|
|
2351
|
-
*
|
|
2352
|
-
*
|
|
2353
|
-
*
|
|
2354
|
-
*
|
|
2355
|
-
*
|
|
2440
|
+
* beforeLoad: (ctx) =>
|
|
2441
|
+
* traced.beforeLoad(ctx, async ({ context }) => {
|
|
2442
|
+
* // Auth check
|
|
2443
|
+
* }),
|
|
2444
|
+
* loader: (ctx) =>
|
|
2445
|
+
* traced.loader(ctx, async ({ params }) => {
|
|
2446
|
+
* return await getUser(params.userId);
|
|
2447
|
+
* }),
|
|
2356
2448
|
* });
|
|
2357
2449
|
* ```
|
|
2358
2450
|
*/
|
|
2359
2451
|
declare function createTracedRoute(routeId: string, config?: Omit<TraceLoaderConfig, 'name'>): {
|
|
2360
2452
|
/**
|
|
2361
|
-
*
|
|
2453
|
+
* Trace a loader under this route's span name
|
|
2362
2454
|
*/
|
|
2363
|
-
loader<
|
|
2455
|
+
loader<TContext extends TanStackContextInternal, TResult>(context: TContext, loaderFn: (context: TContext) => TResult): TResult;
|
|
2364
2456
|
/**
|
|
2365
|
-
*
|
|
2457
|
+
* Trace a beforeLoad under this route's span name
|
|
2366
2458
|
*/
|
|
2367
|
-
beforeLoad<
|
|
2459
|
+
beforeLoad<TContext extends TanStackContextInternal, TResult>(context: TContext, beforeLoadFn: (context: TContext) => TResult): TResult;
|
|
2368
2460
|
};
|
|
2369
2461
|
//#endregion
|
|
2370
2462
|
export { LoaderFnContext as i, traceBeforeLoad as n, traceLoader as r, createTracedRoute as t };
|