camox 0.33.1 → 0.34.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.
Files changed (94) hide show
  1. package/dist/core/createBlock.js +19 -19
  2. package/dist/core/defineDocument.d.ts +7 -0
  3. package/dist/core/defineDocument.js +7 -0
  4. package/dist/features/agent-chat/components/AgentChatSidebar.js +3 -3
  5. package/dist/features/agent-chat/components/AgentChatThread.js +5 -5
  6. package/dist/features/navigation/navigation.d.ts +39 -0
  7. package/dist/features/navigation/navigation.js +231 -0
  8. package/dist/features/preview/CamoxPreview.d.ts +3 -0
  9. package/dist/features/preview/CamoxPreview.js +12 -12
  10. package/dist/features/preview/components/AddBlockSidebar.js +4 -4
  11. package/dist/features/preview/components/CreatePageModal.js +3 -3
  12. package/dist/features/preview/components/FieldToolbar.js +1 -1
  13. package/dist/features/preview/components/PageInfoSidebar.js +23 -23
  14. package/dist/features/preview/components/PageNavigatorSidebar.js +6 -6
  15. package/dist/features/preview/components/PagePicker.js +1 -1
  16. package/dist/features/preview/components/useUpdateBlockPosition.js +3 -3
  17. package/dist/features/provider/CamoxProvider.js +10 -8
  18. package/dist/features/routes/pageRuntime.js +6 -0
  19. package/dist/features/runtime/pageApp.js +75 -0
  20. package/dist/features/runtime/pageClient.d.ts +7 -0
  21. package/dist/features/runtime/pageClient.js +37 -0
  22. package/dist/features/runtime/pageNavigation.js +170 -0
  23. package/dist/features/runtime/pageServer.d.ts +9 -0
  24. package/dist/features/runtime/pageServer.js +18 -0
  25. package/dist/features/runtime/runtime.d.ts +24 -0
  26. package/dist/features/runtime/runtime.js +44 -0
  27. package/dist/features/runtime/studioApp.d.ts +15 -0
  28. package/dist/features/runtime/studioApp.js +117 -0
  29. package/dist/features/runtime/studioNavigation.js +115 -0
  30. package/dist/features/runtime/studioServer.d.ts +9 -0
  31. package/dist/features/runtime/studioServer.js +18 -0
  32. package/dist/features/studio/CamoxStudio.js +3 -3
  33. package/dist/features/studio/components/Navbar.js +7 -7
  34. package/dist/features/studio/components/ProjectMenu.js +9 -9
  35. package/dist/features/studio/components/UserButton.js +3 -3
  36. package/dist/features/vite/appGeneration.js +16 -5
  37. package/dist/features/vite/blockBoilerplate.js +1 -1
  38. package/dist/features/vite/definitionsSync.js +4 -4
  39. package/dist/features/vite/routeGeneration.js +9 -156
  40. package/dist/features/vite/runtimeDev.js +270 -0
  41. package/dist/features/vite/utils.js +3 -1
  42. package/dist/features/vite/vite.d.ts +22 -3
  43. package/dist/features/vite/vite.js +36 -19
  44. package/dist/lib/auth.js +42 -68
  45. package/dist/lib/telemetry.js +1 -24
  46. package/dist/lib/utils.js +1 -1
  47. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/Matches.d.ts +114 -0
  48. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/RouterProvider.d.ts +25 -0
  49. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/config.d.ts +1 -0
  50. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/defer.d.ts +1 -0
  51. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/fileRoute.d.ts +20 -0
  52. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/global.d.ts +8 -0
  53. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/hash-scroll.d.ts +1 -0
  54. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/index.d.ts +18 -0
  55. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/link.d.ts +161 -0
  56. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/load-matches.d.ts +6 -0
  57. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/location.d.ts +54 -0
  58. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/lru-cache.d.ts +8 -0
  59. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts +32 -0
  60. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.d.ts +115 -0
  61. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/not-found.d.ts +1 -0
  62. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts +49 -0
  63. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/rewrite.d.ts +1 -0
  64. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/root.d.ts +6 -0
  65. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/route.d.ts +343 -0
  66. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/routeInfo.d.ts +48 -0
  67. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/router.d.ts +695 -0
  68. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/scroll-restoration.d.ts +1 -0
  69. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchMiddleware.d.ts +1 -0
  70. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchParams.d.ts +5 -0
  71. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/RawStream.d.ts +38 -0
  72. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/seroval-plugins.d.ts +1 -0
  73. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/transformer.d.ts +65 -0
  74. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/stores.d.ts +69 -0
  75. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/structuralSharing.d.ts +1 -0
  76. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/typePrimitives.d.ts +1 -0
  77. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderData.d.ts +1 -0
  78. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderDeps.d.ts +1 -0
  79. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useNavigate.d.ts +10 -0
  80. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useParams.d.ts +1 -0
  81. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useRouteContext.d.ts +1 -0
  82. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useSearch.d.ts +1 -0
  83. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/utils.d.ts +28 -0
  84. package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/validators.d.ts +49 -0
  85. package/package.json +34 -12
  86. package/skills/camox-block/SKILL.md +4 -4
  87. package/skills/camox-cli/SKILL.md +3 -3
  88. package/skills/camox-layout/SKILL.md +2 -2
  89. package/dist/features/routes/ogRoute.d.ts +0 -12
  90. package/dist/features/routes/ogRoute.js +0 -20
  91. package/dist/features/routes/pageRoute.d.ts +0 -48
  92. package/dist/features/routes/pageRoute.js +0 -254
  93. package/dist/lib/api-client.d.ts +0 -7
  94. package/dist/lib/queries.d.ts +0 -12
@@ -0,0 +1,54 @@
1
+ import { AnySchema } from "./validators.js";
2
+ import { ParsedHistoryState } from "@tanstack/history";
3
+
4
+ //#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/location.d.ts
5
+ interface ParsedLocation<TSearchObj extends AnySchema = {}> {
6
+ /**
7
+ * The full path of the location, including pathname, search, and hash.
8
+ * Does not include the origin. Is the equivalent of calling
9
+ * `url.replace(url.origin, '')`
10
+ */
11
+ href: string;
12
+ /**
13
+ * @description The pathname of the location, including the leading slash.
14
+ */
15
+ pathname: string;
16
+ /**
17
+ * The parsed search parameters of the location in object form.
18
+ */
19
+ search: TSearchObj;
20
+ /**
21
+ * The search string of the location, including the leading question mark.
22
+ */
23
+ searchStr: string;
24
+ /**
25
+ * The in-memory state of the location as it *may* exist in the browser's history.
26
+ */
27
+ state: ParsedHistoryState;
28
+ /**
29
+ * The hash of the location, excluding the leading hash character.
30
+ * (e.g., '123' instead of '#123')
31
+ */
32
+ hash: string;
33
+ /**
34
+ * The masked location of the location.
35
+ */
36
+ maskedLocation?: ParsedLocation<TSearchObj>;
37
+ /**
38
+ * Whether to unmask the location on reload.
39
+ */
40
+ unmaskOnReload?: boolean;
41
+ /**
42
+ * @private
43
+ * @description The public href of the location.
44
+ * If a rewrite is applied, the `href` property will be the rewritten URL.
45
+ */
46
+ publicHref: string;
47
+ /**
48
+ * @private
49
+ * @description Whether the publicHref is external (different origin from rewrite).
50
+ */
51
+ external: boolean;
52
+ }
53
+ //#endregion
54
+ export { ParsedLocation };
@@ -0,0 +1,8 @@
1
+ //#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/lru-cache.d.ts
2
+ type LRUCache<TKey, TValue> = {
3
+ get: (key: TKey) => TValue | undefined;
4
+ set: (key: TKey, value: TValue) => void;
5
+ clear: () => void;
6
+ };
7
+ //#endregion
8
+ export { LRUCache };
@@ -0,0 +1,32 @@
1
+ //#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts
2
+ type AssetCrossOrigin = 'anonymous' | 'use-credentials';
3
+ type ManifestAssetLink = string | {
4
+ href: string;
5
+ crossOrigin?: AssetCrossOrigin;
6
+ };
7
+ type Manifest = {
8
+ routes: Record<string, {
9
+ filePath?: string;
10
+ preloads?: Array<ManifestAssetLink>;
11
+ assets?: Array<RouterManagedTag>;
12
+ }>;
13
+ };
14
+ type RouterManagedTag = {
15
+ tag: 'title';
16
+ attrs?: Record<string, any>;
17
+ children: string;
18
+ } | {
19
+ tag: 'meta' | 'link';
20
+ attrs?: Record<string, any>;
21
+ children?: never;
22
+ } | {
23
+ tag: 'script';
24
+ attrs?: Record<string, any>;
25
+ children?: string;
26
+ } | {
27
+ tag: 'style';
28
+ attrs?: Record<string, any>;
29
+ children?: string;
30
+ };
31
+ //#endregion
32
+ export { AssetCrossOrigin, Manifest, ManifestAssetLink, RouterManagedTag };
@@ -0,0 +1,115 @@
1
+ import { LRUCache } from "./lru-cache.js";
2
+
3
+ //#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.d.ts
4
+ declare const SEGMENT_TYPE_PATHNAME = 0;
5
+ declare const SEGMENT_TYPE_PARAM = 1;
6
+ declare const SEGMENT_TYPE_WILDCARD = 2;
7
+ declare const SEGMENT_TYPE_OPTIONAL_PARAM = 3;
8
+ declare const SEGMENT_TYPE_INDEX = 4;
9
+ declare const SEGMENT_TYPE_PATHLESS = 5;
10
+ /**
11
+ * All the kinds of segments that can be present in a route path.
12
+ */
13
+ type SegmentKind = typeof SEGMENT_TYPE_PATHNAME | typeof SEGMENT_TYPE_PARAM | typeof SEGMENT_TYPE_WILDCARD | typeof SEGMENT_TYPE_OPTIONAL_PARAM;
14
+ /**
15
+ * All the kinds of segments that can be present in the segment tree.
16
+ */
17
+ type ExtendedSegmentKind = SegmentKind | typeof SEGMENT_TYPE_INDEX | typeof SEGMENT_TYPE_PATHLESS;
18
+ type StaticSegmentNode<T extends RouteLike> = SegmentNode<T> & {
19
+ kind: typeof SEGMENT_TYPE_PATHNAME | typeof SEGMENT_TYPE_PATHLESS | typeof SEGMENT_TYPE_INDEX;
20
+ };
21
+ type DynamicSegmentNode<T extends RouteLike> = SegmentNode<T> & {
22
+ kind: typeof SEGMENT_TYPE_PARAM | typeof SEGMENT_TYPE_WILDCARD | typeof SEGMENT_TYPE_OPTIONAL_PARAM;
23
+ prefix?: string;
24
+ suffix?: string;
25
+ caseSensitive: boolean;
26
+ };
27
+ type AnySegmentNode<T extends RouteLike> = StaticSegmentNode<T> | DynamicSegmentNode<T>;
28
+ type SegmentNode<T extends RouteLike> = {
29
+ kind: ExtendedSegmentKind;
30
+ pathless: Array<StaticSegmentNode<T>> | null; /** Exact index segment (highest priority) */
31
+ index: StaticSegmentNode<T> | null; /** Static segments (2nd priority) */
32
+ static: Map<string, StaticSegmentNode<T>> | null; /** Case insensitive static segments (3rd highest priority) */
33
+ staticInsensitive: Map<string, StaticSegmentNode<T>> | null; /** Dynamic segments ($param) */
34
+ dynamic: Array<DynamicSegmentNode<T>> | null; /** Optional dynamic segments ({-$param}) */
35
+ optional: Array<DynamicSegmentNode<T>> | null; /** Wildcard segments ($ - lowest priority) */
36
+ wildcard: Array<DynamicSegmentNode<T>> | null; /** Terminal route (if this path can end here) */
37
+ route: T | null; /** The full path for this segment node (will only be valid on leaf nodes) */
38
+ fullPath: string;
39
+ parent: AnySegmentNode<T> | null;
40
+ depth: number; /** route.options.params.parse function, set on the last node of the route */
41
+ parse: null | ((params: Record<string, string>) => any); /** options.skipRouteOnParseError.params ?? false */
42
+ skipOnParamError: boolean; /** options.skipRouteOnParseError.priority ?? 0 */
43
+ parsingPriority: number;
44
+ };
45
+ type RouteLike = {
46
+ id?: string;
47
+ path?: string;
48
+ children?: Array<RouteLike>;
49
+ parentRoute?: RouteLike;
50
+ isRoot?: boolean;
51
+ options?: {
52
+ skipRouteOnParseError?: {
53
+ params?: boolean;
54
+ priority?: number;
55
+ };
56
+ caseSensitive?: boolean;
57
+ params?: {
58
+ parse?: (params: Record<string, string>) => any;
59
+ };
60
+ };
61
+ } & ({
62
+ fullPath: string;
63
+ from?: never;
64
+ } | {
65
+ fullPath?: never;
66
+ from: string;
67
+ });
68
+ type ProcessedTree<TTree extends Extract<RouteLike, {
69
+ fullPath: string;
70
+ }>, TFlat extends Extract<RouteLike, {
71
+ from: string;
72
+ }>, TSingle extends Extract<RouteLike, {
73
+ from: string;
74
+ }>> = {
75
+ /** a representation of the `routeTree` as a segment tree */segmentTree: AnySegmentNode<TTree>; /** a mini route tree generated from the flat `routeMasks` list */
76
+ masksTree: AnySegmentNode<TFlat> | null; /** @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree */
77
+ singleCache: LRUCache<string, AnySegmentNode<TSingle>>; /** a cache of route matches from the `segmentTree` */
78
+ matchCache: LRUCache<string, RouteMatch<TTree> | null>; /** a cache of route matches from the `masksTree` */
79
+ flatCache: LRUCache<string, ReturnType<typeof findMatch<TFlat>>> | null;
80
+ };
81
+ type RouteMatch<T extends Extract<RouteLike, {
82
+ fullPath: string;
83
+ }>> = {
84
+ route: T;
85
+ rawParams: Record<string, string>;
86
+ parsedParams?: Record<string, unknown>;
87
+ branch: ReadonlyArray<T>;
88
+ };
89
+ interface ProcessRouteTreeResult<TRouteLike extends Extract<RouteLike, {
90
+ fullPath: string;
91
+ }> & {
92
+ id: string;
93
+ }> {
94
+ /** Should be considered a black box, needs to be provided to all matching functions in this module. */
95
+ processedTree: ProcessedTree<TRouteLike, any, any>;
96
+ /** A lookup map of routes by their unique IDs. */
97
+ routesById: Record<string, TRouteLike>;
98
+ /** A lookup map of routes by their trimmed full paths. */
99
+ routesByPath: Record<string, TRouteLike>;
100
+ }
101
+ declare function findMatch<T extends RouteLike>(path: string, segmentTree: AnySegmentNode<T>, fuzzy?: boolean): {
102
+ route: T;
103
+ /**
104
+ * The raw (unparsed) params extracted from the path.
105
+ * This will be the exhaustive list of all params defined in the route's path.
106
+ */
107
+ rawParams: Record<string, string>;
108
+ /**
109
+ * The accumlulated parsed params of each route in the branch that had `skipRouteOnParseError` enabled.
110
+ * Will not contain all params defined in the route's path. Those w/ a `params.parse` but no `skipRouteOnParseError` will need to be parsed separately.
111
+ */
112
+ parsedParams?: Record<string, unknown>;
113
+ } | null;
114
+ //#endregion
115
+ export { ProcessRouteTreeResult, ProcessedTree };
@@ -0,0 +1,49 @@
1
+ import { NavigateOptions } from "./link.js";
2
+ import { AnyRouter, RegisteredRouter } from "./router.js";
3
+
4
+ //#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts
5
+ type AnyRedirect = Redirect<any, any, any, any, any>;
6
+ /**
7
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
8
+ */
9
+ type Redirect<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = Response & {
10
+ options: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {};
11
+ redirectHandled?: boolean;
12
+ };
13
+ type RedirectOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = {
14
+ href?: string;
15
+ /**
16
+ * @deprecated Use `statusCode` instead
17
+ **/
18
+ code?: number;
19
+ /**
20
+ * The HTTP status code to use when redirecting.
21
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#statuscode-property)
22
+ */
23
+ statusCode?: number;
24
+ /**
25
+ * If provided, will throw the redirect object instead of returning it. This can be useful in places where `throwing` in a function might cause it to have a return type of `never`. In that case, you can use `redirect({ throw: true })` to throw the redirect object instead of returning it.
26
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#throw-property)
27
+ */
28
+ throw?: any;
29
+ /**
30
+ * The HTTP headers to use when redirecting.
31
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#headers-property)
32
+ */
33
+ headers?: HeadersInit;
34
+ } & NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>;
35
+ /**
36
+ * Options for route-bound redirect, where 'from' is automatically set.
37
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
38
+ */
39
+ type RedirectOptionsRoute<TDefaultFrom extends string = string, TRouter extends AnyRouter = RegisteredRouter, TTo extends string | undefined = undefined, TMaskTo extends string = ''> = Omit<RedirectOptions<TRouter, TDefaultFrom, TTo, TDefaultFrom, TMaskTo>, 'from'>;
40
+ /**
41
+ * A redirect function bound to a specific route, with 'from' pre-set to the route's fullPath.
42
+ * This enables relative redirects like `Route.redirect({ to: './overview' })`.
43
+ * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
44
+ */
45
+ interface RedirectFnRoute<in out TDefaultFrom extends string = string> {
46
+ <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>;
47
+ }
48
+ //#endregion
49
+ export { AnyRedirect, Redirect, RedirectFnRoute, RedirectOptions, RedirectOptionsRoute };
@@ -0,0 +1,6 @@
1
+ //#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/root.d.ts
2
+ /** Stable identifier used for the root route in a route tree. */
3
+ declare const rootRouteId = "__root__";
4
+ type RootRouteId = typeof rootRouteId;
5
+ //#endregion
6
+ export { RootRouteId, rootRouteId };
@@ -0,0 +1,343 @@
1
+ import { LazyRoute } from "./fileRoute.js";
2
+ import { Assign, Awaitable, Constrain, Expand, IntersectAssign, LooseAsyncReturnType, LooseReturnType, NoInfer } from "./utils.js";
3
+ import { NavigateOptions, ParsePathParams } from "./link.js";
4
+ import { ParseRoute, RoutePaths } from "./routeInfo.js";
5
+ import { RedirectFnRoute } from "./redirect.js";
6
+ import { AnyRouteMatch, MakePreValidationErrorHandlingRouteMatchUnion, MakeRouteMatchFromRoute, MakeRouteMatchUnion, RouteMatch } from "./Matches.js";
7
+ import { RootRouteId } from "./root.js";
8
+ import { BuildLocationFn, NavigateFn } from "./RouterProvider.js";
9
+ import { ValidateSerializableLifecycleResult } from "./ssr/serializer/transformer.js";
10
+ import { AnyValidator, DefaultValidator, ResolveSearchValidatorInput, ResolveValidatorOutput } from "./validators.js";
11
+ import { ParsedLocation } from "./location.js";
12
+ import { AnyRouter, RegisteredRouter, SSROption } from "./router.js";
13
+
14
+ //#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/route.d.ts
15
+ type AnyPathParams = {};
16
+ type SearchSchemaInput = {
17
+ __TSearchSchemaInput__: 'TSearchSchemaInput';
18
+ };
19
+ type AnyContext = {};
20
+ type RoutePathOptions<TCustomId, TPath> = {
21
+ path: TPath;
22
+ } | {
23
+ id: TCustomId;
24
+ };
25
+ interface StaticDataRouteOption {}
26
+ type SearchFilter<TInput, TResult = TInput> = (prev: TInput) => TResult;
27
+ type SearchMiddlewareContext<TSearchSchema> = {
28
+ search: TSearchSchema;
29
+ next: (newSearch: TSearchSchema) => TSearchSchema;
30
+ };
31
+ type SearchMiddleware<TSearchSchema> = (ctx: SearchMiddlewareContext<TSearchSchema>) => TSearchSchema;
32
+ type InferFullSearchSchema<TRoute> = TRoute extends {
33
+ types: {
34
+ fullSearchSchema: infer TFullSearchSchema;
35
+ };
36
+ } ? TFullSearchSchema : {};
37
+ type InferFullSearchSchemaInput<TRoute> = TRoute extends {
38
+ types: {
39
+ fullSearchSchemaInput: infer TFullSearchSchemaInput;
40
+ };
41
+ } ? TFullSearchSchemaInput : {};
42
+ type InferAllParams<TRoute> = TRoute extends {
43
+ types: {
44
+ allParams: infer TAllParams;
45
+ };
46
+ } ? TAllParams : {};
47
+ type InferAllContext<TRoute> = unknown extends TRoute ? TRoute : TRoute extends {
48
+ types: {
49
+ allContext: infer TAllContext;
50
+ };
51
+ } ? TAllContext : {};
52
+ type ResolveRequiredParams<TPath extends string, T> = { [K in ParsePathParams<TPath>['required']]: T };
53
+ type ResolveOptionalParams<TPath extends string, T> = { [K in ParsePathParams<TPath>['optional']]?: T | undefined };
54
+ type ResolveParams<TPath extends string, T = string> = ResolveRequiredParams<TPath, T> & ResolveOptionalParams<TPath, T>;
55
+ type ParseParamsFn<in out TPath extends string, in out TParams> = (rawParams: Expand<ResolveParams<TPath>>) => TParams extends ResolveParams<TPath, any> ? TParams : ResolveParams<TPath, any>;
56
+ type StringifyParamsFn<in out TPath extends string, in out TParams> = (params: TParams) => ResolveParams<TPath>;
57
+ type ParamsOptions<in out TPath extends string, in out TParams> = {
58
+ params?: {
59
+ parse?: ParseParamsFn<TPath, TParams>;
60
+ stringify?: StringifyParamsFn<TPath, TParams>;
61
+ };
62
+ /**
63
+ @deprecated Use params.parse instead
64
+ */
65
+ parseParams?: ParseParamsFn<TPath, TParams>;
66
+ /**
67
+ @deprecated Use params.stringify instead
68
+ */
69
+ stringifyParams?: StringifyParamsFn<TPath, TParams>;
70
+ };
71
+ interface RequiredStaticDataRouteOption {
72
+ staticData: StaticDataRouteOption;
73
+ }
74
+ interface OptionalStaticDataRouteOption {
75
+ staticData?: StaticDataRouteOption;
76
+ }
77
+ type UpdatableStaticRouteOption = {} extends StaticDataRouteOption ? OptionalStaticDataRouteOption : RequiredStaticDataRouteOption;
78
+ type TrimPathRight<T extends string> = T extends '/' ? '/' : T extends `${infer U}/` ? TrimPathRight<U> : T;
79
+ type ContextReturnType<TContextFn> = unknown extends TContextFn ? TContextFn : LooseReturnType<TContextFn> extends never ? AnyContext : LooseReturnType<TContextFn>;
80
+ type ContextAsyncReturnType<TContextFn> = unknown extends TContextFn ? TContextFn : LooseAsyncReturnType<TContextFn> extends never ? AnyContext : LooseAsyncReturnType<TContextFn>;
81
+ type ResolveRouteContext<TRouteContextFn, TBeforeLoadFn> = Assign<ContextReturnType<TRouteContextFn>, ContextAsyncReturnType<TBeforeLoadFn>>;
82
+ type ResolveRouteLoaderFn<TLoaderFn> = TLoaderFn extends {
83
+ handler: infer THandler;
84
+ } ? THandler : TLoaderFn;
85
+ type RouteLoaderObject<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TParams = {}, TLoaderDeps = {}, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TServerMiddlewares = unknown, THandlers = undefined> = {
86
+ handler: RouteLoaderFn<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers>;
87
+ staleReloadMode?: LoaderStaleReloadMode;
88
+ };
89
+ type ResolveLoaderData<TLoaderFn> = unknown extends TLoaderFn ? TLoaderFn : LooseAsyncReturnType<ResolveRouteLoaderFn<TLoaderFn>> extends never ? undefined : LooseAsyncReturnType<ResolveRouteLoaderFn<TLoaderFn>>;
90
+ type ResolveFullSearchSchema<TParentRoute extends AnyRoute, TSearchValidator> = unknown extends TParentRoute ? ResolveValidatorOutput<TSearchValidator> : IntersectAssign<InferFullSearchSchema<TParentRoute>, ResolveValidatorOutput<TSearchValidator>>;
91
+ type ResolveFullSearchSchemaInput<TParentRoute extends AnyRoute, TSearchValidator> = IntersectAssign<InferFullSearchSchemaInput<TParentRoute>, ResolveSearchValidatorInput<TSearchValidator>>;
92
+ type ResolveAllParamsFromParent<TParentRoute extends AnyRoute, TParams> = Assign<InferAllParams<TParentRoute>, TParams>;
93
+ type RouteContextParameter<TParentRoute extends AnyRoute, TRouterContext> = unknown extends TParentRoute ? TRouterContext : Assign<TRouterContext, InferAllContext<TParentRoute>>;
94
+ type BeforeLoadContextParameter<TParentRoute extends AnyRoute, TRouterContext, TRouteContextFn> = Assign<RouteContextParameter<TParentRoute, TRouterContext>, ContextReturnType<TRouteContextFn>>;
95
+ type ResolveAllContext<TParentRoute extends AnyRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn> = Assign<BeforeLoadContextParameter<TParentRoute, TRouterContext, TRouteContextFn>, ContextAsyncReturnType<TBeforeLoadFn>>;
96
+ interface FullSearchSchemaOption<in out TParentRoute extends AnyRoute, in out TSearchValidator> {
97
+ search: Expand<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>;
98
+ }
99
+ interface RemountDepsOptions<in out TRouteId, in out TFullSearchSchema, in out TAllParams, in out TLoaderDeps> {
100
+ routeId: TRouteId;
101
+ search: TFullSearchSchema;
102
+ params: TAllParams;
103
+ loaderDeps: TLoaderDeps;
104
+ }
105
+ type MakeRemountDepsOptionsUnion<TRouteTree extends AnyRoute = RegisteredRouter['routeTree']> = ParseRoute<TRouteTree> extends infer TRoute extends AnyRoute ? TRoute extends any ? RemountDepsOptions<TRoute['id'], TRoute['types']['fullSearchSchema'], TRoute['types']['allParams'], TRoute['types']['loaderDeps']> : never : never;
106
+ interface RouteTypes<in out TRegister, in out TParentRoute extends AnyRoute, in out TPath extends string, in out TFullPath extends string, in out TCustomId extends string, in out TId extends string, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps, in out TLoaderFn, in out TChildren, in out TFileRouteTypes, in out TSSR, in out TServerMiddlewares, in out THandlers> {
107
+ parentRoute: TParentRoute;
108
+ path: TPath;
109
+ to: TrimPathRight<TFullPath>;
110
+ fullPath: TFullPath;
111
+ customId: TCustomId;
112
+ id: TId;
113
+ searchSchema: ResolveValidatorOutput<TSearchValidator>;
114
+ searchSchemaInput: ResolveSearchValidatorInput<TSearchValidator>;
115
+ searchValidator: TSearchValidator;
116
+ fullSearchSchema: ResolveFullSearchSchema<TParentRoute, TSearchValidator>;
117
+ fullSearchSchemaInput: ResolveFullSearchSchemaInput<TParentRoute, TSearchValidator>;
118
+ params: TParams;
119
+ allParams: ResolveAllParamsFromParent<TParentRoute, TParams>;
120
+ routerContext: TRouterContext;
121
+ routeContext: ResolveRouteContext<TRouteContextFn, TBeforeLoadFn>;
122
+ routeContextFn: TRouteContextFn;
123
+ beforeLoadFn: TBeforeLoadFn;
124
+ allContext: ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>;
125
+ children: TChildren;
126
+ loaderData: ResolveLoaderData<TLoaderFn>;
127
+ loaderDeps: TLoaderDeps;
128
+ fileRouteTypes: TFileRouteTypes;
129
+ ssr: ResolveSSR<TSSR>;
130
+ allSsr: ResolveAllSSR<TParentRoute, TSSR>;
131
+ }
132
+ type ResolveSSR<TSSR> = TSSR extends ((...args: ReadonlyArray<any>) => any) ? LooseReturnType<TSSR> : TSSR;
133
+ type ResolveAllSSR<TParentRoute extends AnyRoute, TSSR> = unknown extends TParentRoute ? ResolveSSR<TSSR> : unknown extends TSSR ? TParentRoute['types']['allSsr'] : ResolveSSR<TSSR>;
134
+ interface RouteExtensions<in out TId, in out TFullPath> {
135
+ id: TId;
136
+ fullPath: TFullPath;
137
+ }
138
+ type RouteLazyFn<TRoute extends AnyRoute> = (lazyFn: () => Promise<LazyRoute<TRoute>>) => TRoute;
139
+ type RouteAddChildrenFn<in out TRegister, in out TParentRoute extends AnyRoute, in out TPath extends string, in out TFullPath extends string, in out TCustomId extends string, in out TId extends string, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps extends Record<string, any>, in out TLoaderFn, in out TFileRouteTypes, in out TSSR, in out TServerMiddlewares, in out THandlers> = <const TNewChildren>(children: Constrain<TNewChildren, ReadonlyArray<AnyRoute> | Record<string, AnyRoute>>) => Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TNewChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
140
+ type RouteAddFileChildrenFn<in out TRegister, in out TParentRoute extends AnyRoute, in out TPath extends string, in out TFullPath extends string, in out TCustomId extends string, in out TId extends string, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps extends Record<string, any>, in out TLoaderFn, in out TFileRouteTypes, in out TSSR, in out TServerMiddlewares, in out THandlers> = <const TNewChildren>(children: TNewChildren) => Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TNewChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
141
+ type RouteAddFileTypesFn<TRegister, TParentRoute extends AnyRoute, TPath extends string, TFullPath extends string, TCustomId extends string, TId extends string, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps extends Record<string, any>, TLoaderFn, TChildren, TSSR, TServerMiddlewares, THandlers> = <TNewFileRouteTypes>() => Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TNewFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
142
+ interface Route<in out TRegister, in out TParentRoute extends AnyRoute, in out TPath extends string, in out TFullPath extends string, in out TCustomId extends string, in out TId extends string, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps extends Record<string, any>, in out TLoaderFn, in out TChildren, in out TFileRouteTypes, in out TSSR, in out TServerMiddlewares, in out THandlers> extends RouteExtensions<TId, TFullPath> {
143
+ path: TPath;
144
+ parentRoute: TParentRoute;
145
+ children?: TChildren;
146
+ types: RouteTypes<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
147
+ options: RouteOptions<TRegister, TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TSSR, TServerMiddlewares, THandlers>;
148
+ isRoot: TParentRoute extends AnyRoute ? true : false;
149
+ lazyFn?: () => Promise<LazyRoute<Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>>>;
150
+ rank: number;
151
+ to: TrimPathRight<TFullPath>;
152
+ init: (opts: {
153
+ originalIndex: number;
154
+ }) => void;
155
+ update: (options: UpdatableRouteOptions<TParentRoute, TCustomId, TFullPath, TParams, TSearchValidator, TLoaderFn, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn>) => this;
156
+ lazy: RouteLazyFn<Route<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>>;
157
+ addChildren: RouteAddChildrenFn<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
158
+ _addFileChildren: RouteAddFileChildrenFn<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TFileRouteTypes, TSSR, TServerMiddlewares, THandlers>;
159
+ _addFileTypes: RouteAddFileTypesFn<TRegister, TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TSSR, TServerMiddlewares, THandlers>;
160
+ /**
161
+ * Create a redirect with `from` automatically set to this route's path.
162
+ * Enables relative redirects like `Route.redirect({ to: './overview' })`.
163
+ * @param opts Redirect options (same as `redirect()` but without `from`)
164
+ * @returns A redirect Response that can be thrown from loaders/beforeLoad
165
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/redirectFunction
166
+ */
167
+ redirect: RedirectFnRoute<TFullPath>;
168
+ }
169
+ type AnyRoute = Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
170
+ type RouteOptions<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TCustomId extends string = string, TFullPath extends string = string, TPath extends string = string, TSearchValidator = undefined, TParams = AnyPathParams, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined> = BaseRouteOptions<TRegister, TParentRoute, TId, TCustomId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TSSR, TServerMiddlewares, THandlers> & UpdatableRouteOptions<NoInfer<TParentRoute>, NoInfer<TCustomId>, NoInfer<TFullPath>, NoInfer<TParams>, NoInfer<TSearchValidator>, NoInfer<TLoaderFn>, NoInfer<TLoaderDeps>, NoInfer<TRouterContext>, NoInfer<TRouteContextFn>, NoInfer<TBeforeLoadFn>>;
171
+ type FileBaseRouteOptions<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TPath extends string = string, TSearchValidator = undefined, TParams = {}, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TRemountDepsFn = AnyContext, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined> = ParamsOptions<TPath, TParams> & FilebaseRouteOptionsInterface<TRegister, TParentRoute, TId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TRemountDepsFn, TSSR, TServerMiddlewares, THandlers>;
172
+ interface FilebaseRouteOptionsInterface<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TPath extends string = string, TSearchValidator = undefined, TParams = {}, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TRemountDepsFn = AnyContext, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined> {
173
+ validateSearch?: Constrain<TSearchValidator, AnyValidator, DefaultValidator>;
174
+ shouldReload?: boolean | ((match: LoaderFnContext<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers>) => any);
175
+ context?: Constrain<TRouteContextFn, (ctx: RouteContextOptions<TParentRoute, TParams, TRouterContext, TLoaderDeps, TId>) => any>;
176
+ ssr?: Constrain<TSSR, undefined | SSROption | ((ctx: SsrContextOptions<TParentRoute, TSearchValidator, TParams>) => Awaitable<undefined | SSROption>)>;
177
+ beforeLoad?: Constrain<TBeforeLoadFn, (ctx: BeforeLoadContextOptions<TRegister, TParentRoute, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TId, TServerMiddlewares, THandlers>) => ValidateSerializableLifecycleResult<TRegister, TParentRoute, TSSR, TBeforeLoadFn>>;
178
+ loaderDeps?: (opts: FullSearchSchemaOption<TParentRoute, TSearchValidator>) => TLoaderDeps;
179
+ remountDeps?: Constrain<TRemountDepsFn, (opt: RemountDepsOptions<TId, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>, TLoaderDeps>) => any>;
180
+ loader?: Constrain<TLoaderFn, RouteLoaderFn<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers> | RouteLoaderObject<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers>>;
181
+ }
182
+ type BaseRouteOptions<TRegister, TParentRoute extends AnyRoute = AnyRoute, TId extends string = string, TCustomId extends string = string, TPath extends string = string, TSearchValidator = undefined, TParams = {}, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSSR = unknown, TServerMiddlewares = unknown, THandlers = undefined> = RoutePathOptions<TCustomId, TPath> & FileBaseRouteOptions<TRegister, TParentRoute, TId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, AnyContext, TSSR, TServerMiddlewares, THandlers> & {
183
+ getParentRoute: () => TParentRoute;
184
+ };
185
+ interface ContextOptions<in out TParentRoute extends AnyRoute, in out TParams, in out TRouteId> {
186
+ abortController: AbortController;
187
+ preload: boolean;
188
+ params: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>;
189
+ location: ParsedLocation;
190
+ /**
191
+ * @deprecated Use `throw redirect({ to: '/somewhere' })` instead
192
+ **/
193
+ navigate: NavigateFn;
194
+ buildLocation: BuildLocationFn;
195
+ cause: 'preload' | 'enter' | 'stay';
196
+ matches: Array<MakeRouteMatchUnion>;
197
+ routeId: TRouteId;
198
+ }
199
+ interface RouteContextOptions<in out TParentRoute extends AnyRoute, in out TParams, in out TRouterContext, in out TLoaderDeps, in out TRouteId> extends ContextOptions<TParentRoute, TParams, TRouteId> {
200
+ deps: TLoaderDeps;
201
+ context: Expand<RouteContextParameter<TParentRoute, TRouterContext>>;
202
+ }
203
+ interface SsrContextOptions<in out TParentRoute extends AnyRoute, in out TSearchValidator, in out TParams> {
204
+ params: {
205
+ status: 'success';
206
+ value: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>;
207
+ } | {
208
+ status: 'error';
209
+ error: unknown;
210
+ };
211
+ search: {
212
+ status: 'success';
213
+ value: Expand<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>;
214
+ } | {
215
+ status: 'error';
216
+ error: unknown;
217
+ };
218
+ location: ParsedLocation;
219
+ matches: Array<MakePreValidationErrorHandlingRouteMatchUnion>;
220
+ }
221
+ interface BeforeLoadContextOptions<in out TRegister, in out TParentRoute extends AnyRoute, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn, in out TRouteId, in out TServerMiddlewares, in out THandlers> extends ContextOptions<TParentRoute, TParams, TRouteId>, FullSearchSchemaOption<TParentRoute, TSearchValidator> {
222
+ context: Expand<BeforeLoadContextParameter<TParentRoute, TRouterContext, TRouteContextFn>>;
223
+ }
224
+ type AssetFnContextOptions<in out TRouteId, in out TFullPath, in out TParentRoute extends AnyRoute, in out TParams, in out TSearchValidator, in out TLoaderFn, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn, in out TLoaderDeps> = {
225
+ ssr?: {
226
+ nonce?: string;
227
+ };
228
+ matches: Array<RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>>;
229
+ match: RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>;
230
+ params: ResolveAllParamsFromParent<TParentRoute, TParams>;
231
+ loaderData?: ResolveLoaderData<TLoaderFn>;
232
+ };
233
+ interface DefaultUpdatableRouteOptionsExtensions {
234
+ component?: unknown;
235
+ errorComponent?: unknown;
236
+ notFoundComponent?: unknown;
237
+ pendingComponent?: unknown;
238
+ }
239
+ interface UpdatableRouteOptionsExtensions extends DefaultUpdatableRouteOptionsExtensions {}
240
+ interface UpdatableRouteOptions<in out TParentRoute extends AnyRoute, in out TRouteId, in out TFullPath, in out TParams, in out TSearchValidator, in out TLoaderFn, in out TLoaderDeps, in out TRouterContext, in out TRouteContextFn, in out TBeforeLoadFn> extends UpdatableStaticRouteOption, UpdatableRouteOptionsExtensions {
241
+ /**
242
+ * Options to control route matching behavior with runtime code.
243
+ *
244
+ * @experimental 🚧 this feature is subject to change
245
+ *
246
+ * @link https://tanstack.com/router/latest/docs/framework/react/api/router/RouteOptionsType
247
+ */
248
+ skipRouteOnParseError?: {
249
+ /**
250
+ * If `true`, skip this route during matching if `params.parse` fails.
251
+ *
252
+ * Without this option, a `/$param` route could match *any* value for `param`,
253
+ * and only later during the route lifecycle would `params.parse` run and potentially
254
+ * show the `errorComponent` if validation failed.
255
+ *
256
+ * With this option enabled, the route will only match if `params.parse` succeeds.
257
+ * If it fails, the router will continue trying to match other routes, potentially
258
+ * finding a different route that works, or ultimately showing the `notFoundComponent`.
259
+ *
260
+ * @default false
261
+ */
262
+ params?: boolean;
263
+ /**
264
+ * In cases where multiple routes would need to run `params.parse` during matching
265
+ * to determine which route to pick, this priority number can be used as a tie-breaker
266
+ * for which route to try first. Higher number = higher priority.
267
+ *
268
+ * @default 0
269
+ */
270
+ priority?: number;
271
+ };
272
+ /**
273
+ * If true, this route will be matched as case-sensitive
274
+ *
275
+ * @default false
276
+ */
277
+ caseSensitive?: boolean;
278
+ /**
279
+ * If true, this route will be forcefully wrapped in a suspense boundary
280
+ */
281
+ wrapInSuspense?: boolean;
282
+ pendingMs?: number;
283
+ pendingMinMs?: number;
284
+ staleTime?: number;
285
+ gcTime?: number;
286
+ preload?: boolean;
287
+ preloadStaleTime?: number;
288
+ preloadGcTime?: number;
289
+ search?: {
290
+ middlewares?: Array<SearchMiddleware<ResolveFullSearchSchemaInput<TParentRoute, TSearchValidator>>>;
291
+ };
292
+ /**
293
+ @deprecated Use search.middlewares instead
294
+ */
295
+ preSearchFilters?: Array<SearchFilter<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>>;
296
+ /**
297
+ @deprecated Use search.middlewares instead
298
+ */
299
+ postSearchFilters?: Array<SearchFilter<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>>;
300
+ onCatch?: (error: Error) => void;
301
+ onError?: (err: any) => void;
302
+ onEnter?: (match: RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
303
+ onStay?: (match: RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
304
+ onLeave?: (match: RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
305
+ headers?: (ctx: AssetFnContextOptions<TRouteId, TFullPath, TParentRoute, TParams, TSearchValidator, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps>) => Awaitable<Record<string, string> | undefined>;
306
+ head?: (ctx: AssetFnContextOptions<TRouteId, TFullPath, TParentRoute, TParams, TSearchValidator, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps>) => Awaitable<{
307
+ links?: AnyRouteMatch['links'];
308
+ scripts?: AnyRouteMatch['headScripts'];
309
+ meta?: AnyRouteMatch['meta'];
310
+ styles?: AnyRouteMatch['styles'];
311
+ }>;
312
+ scripts?: (ctx: AssetFnContextOptions<TRouteId, TFullPath, TParentRoute, TParams, TSearchValidator, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps>) => Awaitable<AnyRouteMatch['scripts']>;
313
+ codeSplitGroupings?: Array<Array<'loader' | 'component' | 'pendingComponent' | 'notFoundComponent' | 'errorComponent'>>;
314
+ }
315
+ type RouteLoaderFn<in out TRegister, in out TParentRoute extends AnyRoute = AnyRoute, in out TId extends string = string, in out TParams = {}, in out TLoaderDeps = {}, in out TRouterContext = {}, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TServerMiddlewares = unknown, in out THandlers = undefined> = (match: LoaderFnContext<TRegister, TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn, TServerMiddlewares, THandlers>) => any;
316
+ type LoaderStaleReloadMode = 'background' | 'blocking';
317
+ interface LoaderFnContext<in out TRegister = unknown, in out TParentRoute extends AnyRoute = AnyRoute, in out TId extends string = string, in out TParams = {}, in out TLoaderDeps = {}, in out TRouterContext = {}, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TServerMiddlewares = unknown, in out THandlers = undefined> {
318
+ abortController: AbortController;
319
+ preload: boolean;
320
+ params: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>;
321
+ deps: TLoaderDeps;
322
+ context: Expand<ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>>;
323
+ location: ParsedLocation;
324
+ /**
325
+ * @deprecated Use `throw redirect({ to: '/somewhere' })` instead
326
+ **/
327
+ navigate: (opts: NavigateOptions<AnyRouter>) => Promise<void> | void;
328
+ parentMatchPromise: TId extends RootRouteId ? never : Promise<MakeRouteMatchFromRoute<TParentRoute>>;
329
+ cause: 'preload' | 'enter' | 'stay';
330
+ route: AnyRoute;
331
+ }
332
+ type RouteMask<TRouteTree extends AnyRoute> = {
333
+ routeTree: TRouteTree;
334
+ from: RoutePaths<TRouteTree>;
335
+ to?: any;
336
+ params?: any;
337
+ search?: any;
338
+ hash?: any;
339
+ state?: any;
340
+ unmaskOnReload?: boolean;
341
+ };
342
+ //#endregion
343
+ export { AnyContext, AnyPathParams, AnyRoute, BaseRouteOptions, BeforeLoadContextOptions, BeforeLoadContextParameter, ContextAsyncReturnType, ContextOptions, ContextReturnType, FileBaseRouteOptions, FilebaseRouteOptionsInterface, FullSearchSchemaOption, InferAllContext, InferAllParams, InferFullSearchSchema, InferFullSearchSchemaInput, LoaderFnContext, LoaderStaleReloadMode, MakeRemountDepsOptionsUnion, ParamsOptions, ParseParamsFn, RemountDepsOptions, ResolveAllContext, ResolveAllParamsFromParent, ResolveAllSSR, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveLoaderData, ResolveOptionalParams, ResolveParams, ResolveRequiredParams, ResolveRouteContext, Route, RouteAddChildrenFn, RouteAddFileChildrenFn, RouteAddFileTypesFn, RouteContextOptions, RouteContextParameter, RouteExtensions, RouteLazyFn, RouteLoaderFn, RouteMask, RouteOptions, RoutePathOptions, RouteTypes, SearchFilter, SearchMiddleware, SearchMiddlewareContext, SearchSchemaInput, StaticDataRouteOption, StringifyParamsFn, TrimPathRight, UpdatableRouteOptions, UpdatableRouteOptionsExtensions, UpdatableStaticRouteOption };