@tanstack/solid-router 1.110.0 → 1.111.4

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 (207) hide show
  1. package/dist/cjs/Matches.cjs.map +1 -1
  2. package/dist/cjs/Matches.d.cts +1 -3
  3. package/dist/cjs/RouterProvider.cjs.map +1 -1
  4. package/dist/cjs/RouterProvider.d.cts +0 -25
  5. package/dist/cjs/fileRoute.cjs.map +1 -1
  6. package/dist/cjs/fileRoute.d.cts +2 -14
  7. package/dist/cjs/index.d.cts +6 -7
  8. package/dist/cjs/link.cjs.map +1 -1
  9. package/dist/cjs/link.d.cts +1 -73
  10. package/dist/cjs/not-found.cjs.map +1 -1
  11. package/dist/cjs/not-found.d.cts +1 -1
  12. package/dist/cjs/redirects.cjs.map +1 -1
  13. package/dist/cjs/redirects.d.cts +1 -3
  14. package/dist/cjs/route.cjs.map +1 -1
  15. package/dist/cjs/route.d.cts +10 -50
  16. package/dist/cjs/router.cjs.map +1 -1
  17. package/dist/cjs/router.d.cts +2 -8
  18. package/dist/cjs/typePrimitives.d.cts +2 -3
  19. package/dist/cjs/useBlocker.cjs.map +1 -1
  20. package/dist/cjs/useBlocker.d.cts +1 -1
  21. package/dist/cjs/useLoaderData.cjs.map +1 -1
  22. package/dist/cjs/useLoaderData.d.cts +1 -2
  23. package/dist/cjs/useLoaderDeps.cjs.map +1 -1
  24. package/dist/cjs/useLoaderDeps.d.cts +1 -2
  25. package/dist/cjs/useNavigate.cjs.map +1 -1
  26. package/dist/cjs/useNavigate.d.cts +1 -1
  27. package/dist/cjs/useParams.cjs.map +1 -1
  28. package/dist/cjs/useParams.d.cts +1 -2
  29. package/dist/cjs/useRouteContext.cjs.map +1 -1
  30. package/dist/cjs/useRouteContext.d.cts +1 -2
  31. package/dist/cjs/useSearch.cjs.map +1 -1
  32. package/dist/cjs/useSearch.d.cts +1 -2
  33. package/dist/cjs/utils.cjs.map +1 -1
  34. package/dist/cjs/utils.d.cts +2 -3
  35. package/dist/esm/Matches.d.ts +1 -3
  36. package/dist/esm/Matches.js.map +1 -1
  37. package/dist/esm/RouterProvider.d.ts +0 -25
  38. package/dist/esm/RouterProvider.js.map +1 -1
  39. package/dist/esm/fileRoute.d.ts +2 -14
  40. package/dist/esm/fileRoute.js.map +1 -1
  41. package/dist/esm/index.d.ts +6 -7
  42. package/dist/esm/link.d.ts +1 -73
  43. package/dist/esm/link.js.map +1 -1
  44. package/dist/esm/not-found.d.ts +1 -1
  45. package/dist/esm/not-found.js.map +1 -1
  46. package/dist/esm/redirects.d.ts +1 -3
  47. package/dist/esm/redirects.js.map +1 -1
  48. package/dist/esm/route.d.ts +10 -50
  49. package/dist/esm/route.js.map +1 -1
  50. package/dist/esm/router.d.ts +2 -8
  51. package/dist/esm/router.js.map +1 -1
  52. package/dist/esm/typePrimitives.d.ts +2 -3
  53. package/dist/esm/useBlocker.d.ts +1 -1
  54. package/dist/esm/useBlocker.js.map +1 -1
  55. package/dist/esm/useLoaderData.d.ts +1 -2
  56. package/dist/esm/useLoaderData.js.map +1 -1
  57. package/dist/esm/useLoaderDeps.d.ts +1 -2
  58. package/dist/esm/useLoaderDeps.js.map +1 -1
  59. package/dist/esm/useNavigate.d.ts +1 -1
  60. package/dist/esm/useNavigate.js.map +1 -1
  61. package/dist/esm/useParams.d.ts +1 -2
  62. package/dist/esm/useParams.js.map +1 -1
  63. package/dist/esm/useRouteContext.d.ts +1 -2
  64. package/dist/esm/useRouteContext.js.map +1 -1
  65. package/dist/esm/useSearch.d.ts +1 -2
  66. package/dist/esm/useSearch.js.map +1 -1
  67. package/dist/esm/utils.d.ts +2 -3
  68. package/dist/esm/utils.js.map +1 -1
  69. package/dist/source/Asset.d.ts +2 -0
  70. package/dist/source/Asset.jsx +22 -0
  71. package/dist/source/Asset.jsx.map +1 -0
  72. package/dist/source/CatchBoundary.d.ts +11 -0
  73. package/dist/source/CatchBoundary.jsx +43 -0
  74. package/dist/source/CatchBoundary.jsx.map +1 -0
  75. package/dist/source/HeadContent.d.ts +8 -0
  76. package/dist/source/HeadContent.jsx +125 -0
  77. package/dist/source/HeadContent.jsx.map +1 -0
  78. package/dist/source/Match.d.ts +8 -0
  79. package/dist/source/Match.jsx +256 -0
  80. package/dist/source/Match.jsx.map +1 -0
  81. package/dist/source/Matches.d.ts +67 -0
  82. package/dist/source/Matches.jsx +103 -0
  83. package/dist/source/Matches.jsx.map +1 -0
  84. package/dist/source/RouterProvider.d.ts +10 -0
  85. package/dist/source/RouterProvider.jsx +27 -0
  86. package/dist/source/RouterProvider.jsx.map +1 -0
  87. package/dist/source/SafeFragment.d.ts +1 -0
  88. package/dist/source/SafeFragment.jsx +4 -0
  89. package/dist/source/SafeFragment.jsx.map +1 -0
  90. package/dist/source/ScriptOnce.d.ts +5 -0
  91. package/dist/source/ScriptOnce.jsx +17 -0
  92. package/dist/source/ScriptOnce.jsx.map +1 -0
  93. package/dist/source/Scripts.d.ts +1 -0
  94. package/dist/source/Scripts.jsx +49 -0
  95. package/dist/source/Scripts.jsx.map +1 -0
  96. package/dist/source/ScrollRestoration.d.ts +15 -0
  97. package/dist/source/ScrollRestoration.jsx +36 -0
  98. package/dist/source/ScrollRestoration.jsx.map +1 -0
  99. package/dist/source/Transitioner.d.ts +1 -0
  100. package/dist/source/Transitioner.jsx +112 -0
  101. package/dist/source/Transitioner.jsx.map +1 -0
  102. package/dist/source/awaited.d.ts +11 -0
  103. package/dist/source/awaited.jsx +24 -0
  104. package/dist/source/awaited.jsx.map +1 -0
  105. package/dist/source/fileRoute.d.ts +46 -0
  106. package/dist/source/fileRoute.js +85 -0
  107. package/dist/source/fileRoute.js.map +1 -0
  108. package/dist/source/history.d.ts +8 -0
  109. package/dist/source/history.js +2 -0
  110. package/dist/source/history.js.map +1 -0
  111. package/dist/source/index.d.ts +52 -0
  112. package/dist/source/index.jsx +41 -0
  113. package/dist/source/index.jsx.map +1 -0
  114. package/dist/source/lazyRouteComponent.d.ts +7 -0
  115. package/dist/source/lazyRouteComponent.jsx +82 -0
  116. package/dist/source/lazyRouteComponent.jsx.map +1 -0
  117. package/dist/source/link.d.ts +41 -0
  118. package/dist/source/link.jsx +339 -0
  119. package/dist/source/link.jsx.map +1 -0
  120. package/dist/source/matchContext.d.ts +3 -0
  121. package/dist/source/matchContext.jsx +5 -0
  122. package/dist/source/matchContext.jsx.map +1 -0
  123. package/dist/source/not-found.d.ts +27 -0
  124. package/dist/source/not-found.jsx +39 -0
  125. package/dist/source/not-found.jsx.map +1 -0
  126. package/dist/source/redirects.d.ts +19 -0
  127. package/dist/source/redirects.js +25 -0
  128. package/dist/source/redirects.js.map +1 -0
  129. package/dist/source/renderRouteNotFound.d.ts +3 -0
  130. package/dist/source/renderRouteNotFound.jsx +15 -0
  131. package/dist/source/renderRouteNotFound.jsx.map +1 -0
  132. package/dist/source/route.d.ts +257 -0
  133. package/dist/source/route.js +240 -0
  134. package/dist/source/route.js.map +1 -0
  135. package/dist/source/router.d.ts +550 -0
  136. package/dist/source/router.js +1802 -0
  137. package/dist/source/router.js.map +1 -0
  138. package/dist/source/routerContext.d.ts +8 -0
  139. package/dist/source/routerContext.jsx +13 -0
  140. package/dist/source/routerContext.jsx.map +1 -0
  141. package/dist/source/scroll-restoration.d.ts +29 -0
  142. package/dist/source/scroll-restoration.jsx +244 -0
  143. package/dist/source/scroll-restoration.jsx.map +1 -0
  144. package/dist/source/typePrimitives.d.ts +70 -0
  145. package/dist/source/typePrimitives.js +2 -0
  146. package/dist/source/typePrimitives.js.map +1 -0
  147. package/dist/source/useBlocker.d.ts +68 -0
  148. package/dist/source/useBlocker.jsx +136 -0
  149. package/dist/source/useBlocker.jsx.map +1 -0
  150. package/dist/source/useCanGoBack.d.ts +1 -0
  151. package/dist/source/useCanGoBack.js +5 -0
  152. package/dist/source/useCanGoBack.js.map +1 -0
  153. package/dist/source/useLoaderData.d.ts +12 -0
  154. package/dist/source/useLoaderData.jsx +11 -0
  155. package/dist/source/useLoaderData.jsx.map +1 -0
  156. package/dist/source/useLoaderDeps.d.ts +11 -0
  157. package/dist/source/useLoaderDeps.jsx +11 -0
  158. package/dist/source/useLoaderDeps.jsx.map +1 -0
  159. package/dist/source/useLocation.d.ts +7 -0
  160. package/dist/source/useLocation.jsx +7 -0
  161. package/dist/source/useLocation.jsx.map +1 -0
  162. package/dist/source/useMatch.d.ts +14 -0
  163. package/dist/source/useMatch.jsx +19 -0
  164. package/dist/source/useMatch.jsx.map +1 -0
  165. package/dist/source/useNavigate.d.ts +7 -0
  166. package/dist/source/useNavigate.jsx +32 -0
  167. package/dist/source/useNavigate.jsx.map +1 -0
  168. package/dist/source/useParams.d.ts +14 -0
  169. package/dist/source/useParams.jsx +12 -0
  170. package/dist/source/useParams.jsx.map +1 -0
  171. package/dist/source/useRouteContext.d.ts +12 -0
  172. package/dist/source/useRouteContext.js +8 -0
  173. package/dist/source/useRouteContext.js.map +1 -0
  174. package/dist/source/useRouter.d.ts +4 -0
  175. package/dist/source/useRouter.jsx +9 -0
  176. package/dist/source/useRouter.jsx.map +1 -0
  177. package/dist/source/useRouterState.d.ts +8 -0
  178. package/dist/source/useRouterState.jsx +14 -0
  179. package/dist/source/useRouterState.jsx.map +1 -0
  180. package/dist/source/useSearch.d.ts +14 -0
  181. package/dist/source/useSearch.jsx +12 -0
  182. package/dist/source/useSearch.jsx.map +1 -0
  183. package/dist/source/utils.d.ts +43 -0
  184. package/dist/source/utils.js +59 -0
  185. package/dist/source/utils.js.map +1 -0
  186. package/package.json +6 -2
  187. package/src/Matches.tsx +11 -15
  188. package/src/RouterProvider.tsx +0 -48
  189. package/src/fileRoute.ts +3 -31
  190. package/src/index.tsx +47 -54
  191. package/src/link.tsx +3 -427
  192. package/src/not-found.tsx +1 -1
  193. package/src/redirects.ts +5 -3
  194. package/src/route.ts +101 -154
  195. package/src/router.ts +11 -25
  196. package/src/typePrimitives.ts +9 -8
  197. package/src/useBlocker.tsx +1 -1
  198. package/src/useLoaderData.tsx +1 -2
  199. package/src/useLoaderDeps.tsx +1 -2
  200. package/src/useNavigate.tsx +1 -1
  201. package/src/useParams.tsx +6 -2
  202. package/src/useRouteContext.ts +2 -2
  203. package/src/useSearch.tsx +6 -2
  204. package/src/utils.ts +1 -2
  205. package/dist/cjs/routeInfo.d.cts +0 -53
  206. package/dist/esm/routeInfo.d.ts +0 -53
  207. package/src/routeInfo.ts +0 -239
@@ -0,0 +1,257 @@
1
+ import type { AnyContext, AnyPathParams, AnySchema, AnyValidator, BeforeLoadContextParameter, BuildLocationFn, Constrain, ConstrainLiteral, RootRoute as CoreRootRoute, Route as CoreRoute, DefaultValidator, ErrorComponentProps, Expand, FullSearchSchemaOption, NavigateFn, NavigateOptions, NoInfer, NotFoundRouteProps, ParamsOptions, ParsedLocation, RemountDepsOptions, ResolveAllContext, ResolveAllParamsFromParent, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveId, ResolveLoaderData, ResolveParams, RootRouteId, RouteById, RouteContext, RouteContextParameter, RouteIds, RoutePathOptions, RoutePaths, RoutePrefix, RouteTypes, SearchFilter, SearchMiddleware, ToMaskOptions, TrimPathRight, UpdatableStaticRouteOption } from '@tanstack/router-core';
2
+ import type { UseLoaderDataRoute } from './useLoaderData';
3
+ import type { UseMatchRoute } from './useMatch';
4
+ import type { UseLoaderDepsRoute } from './useLoaderDeps';
5
+ import type { UseParamsRoute } from './useParams';
6
+ import type { UseSearchRoute } from './useSearch';
7
+ import type * as Solid from 'solid-js';
8
+ import type { UseNavigateResult } from './useNavigate';
9
+ import type { AnyRouteMatch, MakeRouteMatchFromRoute, MakeRouteMatchUnion, RouteMatch } from './Matches';
10
+ import type { AnyRouter, RegisteredRouter, Router } from './router';
11
+ import type { NotFoundError } from './not-found';
12
+ import type { LazyRoute } from './fileRoute';
13
+ import type { UseRouteContextRoute } from './useRouteContext';
14
+ export type RouteOptions<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> = BaseRouteOptions<TParentRoute, TId, TCustomId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn> & UpdatableRouteOptions<NoInfer<TParentRoute>, NoInfer<TCustomId>, NoInfer<TFullPath>, NoInfer<TParams>, NoInfer<TSearchValidator>, NoInfer<TLoaderFn>, NoInfer<TLoaderDeps>, NoInfer<TRouterContext>, NoInfer<TRouteContextFn>, NoInfer<TBeforeLoadFn>>;
15
+ export type RouteContextFn<in out TParentRoute extends AnyRoute, in out TSearchValidator, in out TParams, in out TRouterContext> = (ctx: RouteContextOptions<TParentRoute, TSearchValidator, TParams, TRouterContext>) => any;
16
+ export type BeforeLoadFn<in out TParentRoute extends AnyRoute, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn> = (ctx: BeforeLoadContextOptions<TParentRoute, TSearchValidator, TParams, TRouterContext, TRouteContextFn>) => any;
17
+ export type FileBaseRouteOptions<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> = ParamsOptions<TPath, TParams> & {
18
+ validateSearch?: Constrain<TSearchValidator, AnyValidator, DefaultValidator>;
19
+ shouldReload?: boolean | ((match: LoaderFnContext<TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn>) => any);
20
+ context?: Constrain<TRouteContextFn, (ctx: RouteContextOptions<TParentRoute, TParams, TRouterContext, TLoaderDeps>) => any>;
21
+ beforeLoad?: Constrain<TBeforeLoadFn, (ctx: BeforeLoadContextOptions<TParentRoute, TSearchValidator, TParams, TRouterContext, TRouteContextFn>) => any>;
22
+ loaderDeps?: (opts: FullSearchSchemaOption<TParentRoute, TSearchValidator>) => TLoaderDeps;
23
+ remountDeps?: Constrain<TRemountDepsFn, (opt: RemountDepsOptions<TId, FullSearchSchemaOption<TParentRoute, TSearchValidator>, Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>, TLoaderDeps>) => any>;
24
+ loader?: Constrain<TLoaderFn, (ctx: LoaderFnContext<TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn>) => any>;
25
+ };
26
+ export type BaseRouteOptions<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> = RoutePathOptions<TCustomId, TPath> & FileBaseRouteOptions<TParentRoute, TId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn> & {
27
+ getParentRoute: () => TParentRoute;
28
+ };
29
+ export interface ContextOptions<in out TParentRoute extends AnyRoute, in out TParams> {
30
+ abortController: AbortController;
31
+ preload: boolean;
32
+ params: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>;
33
+ location: ParsedLocation;
34
+ /**
35
+ * @deprecated Use `throw redirect({ to: '/somewhere' })` instead
36
+ **/
37
+ navigate: NavigateFn;
38
+ buildLocation: BuildLocationFn;
39
+ cause: 'preload' | 'enter' | 'stay';
40
+ matches: Array<MakeRouteMatchUnion>;
41
+ }
42
+ export interface RouteContextOptions<in out TParentRoute extends AnyRoute, in out TParams, in out TRouterContext, in out TLoaderDeps> extends ContextOptions<TParentRoute, TParams> {
43
+ deps: TLoaderDeps;
44
+ context: Expand<RouteContextParameter<TParentRoute, TRouterContext>>;
45
+ }
46
+ export interface BeforeLoadContextOptions<in out TParentRoute extends AnyRoute, in out TSearchValidator, in out TParams, in out TRouterContext, in out TRouteContextFn> extends ContextOptions<TParentRoute, TParams>, FullSearchSchemaOption<TParentRoute, TSearchValidator> {
47
+ context: Expand<BeforeLoadContextParameter<TParentRoute, TRouterContext, TRouteContextFn>>;
48
+ }
49
+ 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> = {
50
+ matches: Array<RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>>;
51
+ match: RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>;
52
+ params: ResolveAllParamsFromParent<TParentRoute, TParams>;
53
+ loaderData: ResolveLoaderData<TLoaderFn>;
54
+ };
55
+ export 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 {
56
+ caseSensitive?: boolean;
57
+ wrapInSuspense?: boolean;
58
+ component?: RouteComponent;
59
+ errorComponent?: false | null | ErrorRouteComponent;
60
+ notFoundComponent?: NotFoundRouteComponent;
61
+ pendingComponent?: RouteComponent;
62
+ pendingMs?: number;
63
+ pendingMinMs?: number;
64
+ staleTime?: number;
65
+ gcTime?: number;
66
+ preload?: boolean;
67
+ preloadStaleTime?: number;
68
+ preloadGcTime?: number;
69
+ search?: {
70
+ middlewares?: Array<SearchMiddleware<ResolveFullSearchSchemaInput<TParentRoute, TSearchValidator>>>;
71
+ };
72
+ /**
73
+ @deprecated Use search.middlewares instead
74
+ */
75
+ preSearchFilters?: Array<SearchFilter<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>>;
76
+ /**
77
+ @deprecated Use search.middlewares instead
78
+ */
79
+ postSearchFilters?: Array<SearchFilter<ResolveFullSearchSchema<TParentRoute, TSearchValidator>>>;
80
+ onCatch?: (error: Error) => void;
81
+ onError?: (err: any) => void;
82
+ onEnter?: (match: RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
83
+ onStay?: (match: RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
84
+ onLeave?: (match: RouteMatch<TRouteId, TFullPath, ResolveAllParamsFromParent<TParentRoute, TParams>, ResolveFullSearchSchema<TParentRoute, TSearchValidator>, ResolveLoaderData<TLoaderFn>, ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>, TLoaderDeps>) => void;
85
+ headers?: (ctx: {
86
+ loaderData: ResolveLoaderData<TLoaderFn>;
87
+ }) => Record<string, string>;
88
+ head?: (ctx: AssetFnContextOptions<TRouteId, TFullPath, TParentRoute, TParams, TSearchValidator, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps>) => {
89
+ links?: AnyRouteMatch['links'];
90
+ scripts?: AnyRouteMatch['headScripts'];
91
+ meta?: AnyRouteMatch['meta'];
92
+ };
93
+ scripts?: (ctx: AssetFnContextOptions<TRouteId, TFullPath, TParentRoute, TParams, TSearchValidator, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps>) => AnyRouteMatch['scripts'];
94
+ ssr?: boolean;
95
+ codeSplitGroupings?: Array<Array<'loader' | 'component' | 'pendingComponent' | 'notFoundComponent' | 'errorComponent'>>;
96
+ }
97
+ export type RouteLoaderFn<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> = (match: LoaderFnContext<TParentRoute, TId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn>) => any;
98
+ export interface LoaderFnContext<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> {
99
+ abortController: AbortController;
100
+ preload: boolean;
101
+ params: Expand<ResolveAllParamsFromParent<TParentRoute, TParams>>;
102
+ deps: TLoaderDeps;
103
+ context: Expand<ResolveAllContext<TParentRoute, TRouterContext, TRouteContextFn, TBeforeLoadFn>>;
104
+ location: ParsedLocation;
105
+ /**
106
+ * @deprecated Use `throw redirect({ to: '/somewhere' })` instead
107
+ **/
108
+ navigate: (opts: NavigateOptions<AnyRouter>) => Promise<void> | void;
109
+ parentMatchPromise: TId extends RootRouteId ? never : Promise<MakeRouteMatchFromRoute<TParentRoute>>;
110
+ cause: 'preload' | 'enter' | 'stay';
111
+ route: Route;
112
+ }
113
+ export interface AnyRoute extends Route<any, any, any, any, any, any, any, any, any, any, any, any, any, any> {
114
+ }
115
+ export type AnyRouteWithContext<TContext> = AnyRoute & {
116
+ types: {
117
+ allContext: TContext;
118
+ };
119
+ };
120
+ export type RouteConstraints = {
121
+ TParentRoute: AnyRoute;
122
+ TPath: string;
123
+ TFullPath: string;
124
+ TCustomId: string;
125
+ TId: string;
126
+ TSearchSchema: AnySchema;
127
+ TFullSearchSchema: AnySchema;
128
+ TParams: Record<string, any>;
129
+ TAllParams: Record<string, any>;
130
+ TParentContext: AnyContext;
131
+ TRouteContext: RouteContext;
132
+ TAllContext: AnyContext;
133
+ TRouterContext: AnyContext;
134
+ TChildren: unknown;
135
+ TRouteTree: AnyRoute;
136
+ };
137
+ export type RouteTypesById<TRouter extends AnyRouter, TId> = RouteById<TRouter['routeTree'], TId>['types'];
138
+ export declare function getRouteApi<const TId, TRouter extends AnyRouter = RegisteredRouter>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>): RouteApi<TId, TRouter>;
139
+ export declare class RouteApi<TId, TRouter extends AnyRouter = RegisteredRouter> {
140
+ id: TId;
141
+ /**
142
+ * @deprecated Use the `getRouteApi` function instead.
143
+ */
144
+ constructor({ id }: {
145
+ id: TId;
146
+ });
147
+ useMatch: UseMatchRoute<TId>;
148
+ useRouteContext: UseRouteContextRoute<TId>;
149
+ useSearch: UseSearchRoute<TId>;
150
+ useParams: UseParamsRoute<TId>;
151
+ useLoaderDeps: UseLoaderDepsRoute<TId>;
152
+ useLoaderData: UseLoaderDataRoute<TId>;
153
+ useNavigate: () => UseNavigateResult<RouteTypesById<TRouter, TId>["fullPath"]>;
154
+ notFound: (opts?: NotFoundError) => NotFoundError;
155
+ }
156
+ export declare class Route<in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, in out TPath extends RouteConstraints['TPath'] = '/', in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, in out TCustomId extends RouteConstraints['TCustomId'] = string, in out TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, in out TSearchValidator = undefined, in out TParams = ResolveParams<TPath>, in out TRouterContext = AnyContext, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TLoaderDeps extends Record<string, any> = {}, in out TLoaderFn = undefined, in out TChildren = unknown, in out TFileRouteTypes = unknown> implements CoreRoute<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes> {
157
+ isRoot: TParentRoute extends Route<any> ? true : false;
158
+ options: RouteOptions<TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn>;
159
+ parentRoute: TParentRoute;
160
+ private _id;
161
+ private _path;
162
+ private _fullPath;
163
+ private _to;
164
+ private _ssr;
165
+ get to(): TrimPathRight<TFullPath>;
166
+ get id(): TId;
167
+ get path(): TPath;
168
+ get fullPath(): TFullPath;
169
+ get ssr(): boolean;
170
+ children?: TChildren;
171
+ originalIndex?: number;
172
+ rank: number;
173
+ lazyFn?: () => Promise<LazyRoute<any>>;
174
+ _lazyPromise?: Promise<void>;
175
+ _componentsPromise?: Promise<Array<void>>;
176
+ /**
177
+ * @deprecated Use the `createRoute` function instead.
178
+ */
179
+ constructor(options?: RouteOptions<TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn>);
180
+ types: RouteTypes<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes>;
181
+ init: (opts: {
182
+ originalIndex: number;
183
+ defaultSsr?: boolean;
184
+ }) => void;
185
+ addChildren<const TNewChildren>(children: Constrain<TNewChildren, ReadonlyArray<AnyRoute> | Record<string, AnyRoute>>): Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TNewChildren, TFileRouteTypes>;
186
+ _addFileChildren<const TNewChildren>(children: TNewChildren): Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TNewChildren, TFileRouteTypes>;
187
+ updateLoader: <TNewLoaderFn>(options: {
188
+ loader: Constrain<TNewLoaderFn, RouteLoaderFn<TParentRoute, TCustomId, TParams, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn>>;
189
+ }) => Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TNewLoaderFn, TChildren, TFileRouteTypes>;
190
+ update: (options: UpdatableRouteOptions<TParentRoute, TCustomId, TFullPath, TParams, TSearchValidator, TLoaderFn, TLoaderDeps, TRouterContext, TRouteContextFn, TBeforeLoadFn>) => this;
191
+ lazy: (lazyFn: () => Promise<LazyRoute<any>>) => this;
192
+ useMatch: UseMatchRoute<TId>;
193
+ useRouteContext: UseRouteContextRoute<TId>;
194
+ useSearch: UseSearchRoute<TId>;
195
+ useParams: UseParamsRoute<TId>;
196
+ useLoaderDeps: UseLoaderDepsRoute<TId>;
197
+ useLoaderData: UseLoaderDataRoute<TId>;
198
+ useNavigate: () => UseNavigateResult<TFullPath>;
199
+ }
200
+ export declare function createRoute<TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute, TPath extends RouteConstraints['TPath'] = '/', TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<TParentRoute, TPath>, TCustomId extends RouteConstraints['TCustomId'] = string, TId extends RouteConstraints['TId'] = ResolveId<TParentRoute, TCustomId, TPath>, TSearchValidator = undefined, TParams = ResolveParams<TPath>, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TChildren = unknown>(options: RouteOptions<TParentRoute, TId, TCustomId, TFullPath, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, AnyContext, TRouteContextFn, TBeforeLoadFn>): Route<TParentRoute, TPath, TFullPath, TCustomId, TId, TSearchValidator, TParams, AnyContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, unknown>;
201
+ export type AnyRootRoute = RootRoute<any, any, any, any, any, any, any, any>;
202
+ export type RootRouteOptions<TSearchValidator = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined> = Omit<RouteOptions<any, // TParentRoute
203
+ RootRouteId, // TId
204
+ RootRouteId, // TCustomId
205
+ '', // TFullPath
206
+ '', // TPath
207
+ TSearchValidator, {}, // TParams
208
+ TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn>, 'path' | 'id' | 'getParentRoute' | 'caseSensitive' | 'parseParams' | 'stringifyParams' | 'params'>;
209
+ export declare function createRootRouteWithContext<TRouterContext extends {}>(): <TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSearchValidator = undefined, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined>(options?: RootRouteOptions<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn>) => RootRoute<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, unknown, unknown>;
210
+ /**
211
+ * @deprecated Use the `createRootRouteWithContext` function instead.
212
+ */
213
+ export declare const rootRouteWithContext: typeof createRootRouteWithContext;
214
+ export declare class RootRoute<in out TSearchValidator = undefined, in out TRouterContext = {}, in out TRouteContextFn = AnyContext, in out TBeforeLoadFn = AnyContext, in out TLoaderDeps extends Record<string, any> = {}, in out TLoaderFn = undefined, in out TChildren = unknown, in out TFileRouteTypes = unknown> extends Route<any, // TParentRoute
215
+ '/', // TPath
216
+ '/', // TFullPath
217
+ string, // TCustomId
218
+ RootRouteId, // TId
219
+ TSearchValidator, // TSearchValidator
220
+ {}, // TParams
221
+ TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, // TChildren
222
+ TFileRouteTypes> implements CoreRootRoute<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes> {
223
+ /**
224
+ * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
225
+ */
226
+ constructor(options?: RootRouteOptions<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn>);
227
+ addChildren<const TNewChildren>(children: Constrain<TNewChildren, ReadonlyArray<AnyRoute> | Record<string, AnyRoute>>): RootRoute<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TNewChildren, TFileRouteTypes>;
228
+ _addFileChildren<const TNewChildren>(children: TNewChildren): RootRoute<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TNewChildren, TFileRouteTypes>;
229
+ _addFileTypes<TFileRouteTypes>(): RootRoute<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, TFileRouteTypes>;
230
+ }
231
+ export declare function createRootRoute<TSearchValidator = undefined, TRouterContext = {}, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined>(options?: RootRouteOptions<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn>): RootRoute<TSearchValidator, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, unknown, unknown>;
232
+ export type ResolveFullPath<TParentRoute extends AnyRoute, TPath extends string, TPrefixed = RoutePrefix<TParentRoute['fullPath'], TPath>> = TPrefixed extends RootRouteId ? '/' : TPrefixed;
233
+ export type RouteMask<TRouteTree extends AnyRoute> = {
234
+ routeTree: TRouteTree;
235
+ from: RoutePaths<TRouteTree>;
236
+ to?: any;
237
+ params?: any;
238
+ search?: any;
239
+ hash?: any;
240
+ state?: any;
241
+ unmaskOnReload?: boolean;
242
+ };
243
+ export declare function createRouteMask<TRouteTree extends AnyRoute, TFrom extends string, TTo extends string>(opts: {
244
+ routeTree: TRouteTree;
245
+ } & ToMaskOptions<Router<TRouteTree, 'never'>, TFrom, TTo>): RouteMask<TRouteTree>;
246
+ export type SolidNode = Solid.JSX.Element;
247
+ export type SyncRouteComponent<TProps> = (props: TProps) => Solid.JSX.Element;
248
+ export type AsyncRouteComponent<TProps> = SyncRouteComponent<TProps> & {
249
+ preload?: () => Promise<void>;
250
+ };
251
+ export type RouteComponent<TProps = any> = AsyncRouteComponent<TProps>;
252
+ export type ErrorRouteComponent = RouteComponent<ErrorComponentProps>;
253
+ export type NotFoundRouteComponent = SyncRouteComponent<NotFoundRouteProps>;
254
+ export declare class NotFoundRoute<TParentRoute extends AnyRootRoute, TRouterContext = AnyContext, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TSearchValidator = undefined, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TChildren = unknown> extends Route<TParentRoute, '/404', '/404', '404', '404', TSearchValidator, {}, TRouterContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren> {
255
+ constructor(options: Omit<RouteOptions<TParentRoute, string, string, string, string, TSearchValidator, {}, TLoaderDeps, TLoaderFn, TRouterContext, TRouteContextFn, TBeforeLoadFn>, 'caseSensitive' | 'parseParams' | 'stringifyParams' | 'path' | 'id' | 'params'>);
256
+ }
257
+ export {};
@@ -0,0 +1,240 @@
1
+ import invariant from 'tiny-invariant';
2
+ import { joinPaths, rootRouteId, trimPathLeft } from '@tanstack/router-core';
3
+ import { useLoaderData } from './useLoaderData';
4
+ import { useLoaderDeps } from './useLoaderDeps';
5
+ import { useParams } from './useParams';
6
+ import { useSearch } from './useSearch';
7
+ import { notFound } from './not-found';
8
+ import { useNavigate } from './useNavigate';
9
+ import { useMatch } from './useMatch';
10
+ export function getRouteApi(id) {
11
+ return new RouteApi({ id });
12
+ }
13
+ export class RouteApi {
14
+ /**
15
+ * @deprecated Use the `getRouteApi` function instead.
16
+ */
17
+ constructor({ id }) {
18
+ this.useMatch = (opts) => {
19
+ return useMatch({
20
+ select: opts?.select,
21
+ from: this.id,
22
+ });
23
+ };
24
+ this.useRouteContext = (opts) => {
25
+ return useMatch({
26
+ from: this.id,
27
+ select: (d) => (opts?.select ? opts.select(d.context) : d.context),
28
+ });
29
+ };
30
+ this.useSearch = (opts) => {
31
+ return useSearch({
32
+ select: opts?.select,
33
+ from: this.id,
34
+ });
35
+ };
36
+ this.useParams = (opts) => {
37
+ return useParams({
38
+ select: opts?.select,
39
+ from: this.id,
40
+ });
41
+ };
42
+ this.useLoaderDeps = (opts) => {
43
+ return useLoaderDeps({ ...opts, from: this.id, strict: false });
44
+ };
45
+ this.useLoaderData = (opts) => {
46
+ return useLoaderData({ ...opts, from: this.id, strict: false });
47
+ };
48
+ this.useNavigate = () => {
49
+ return useNavigate({ from: this.id });
50
+ };
51
+ this.notFound = (opts) => {
52
+ return notFound({ routeId: this.id, ...opts });
53
+ };
54
+ this.id = id;
55
+ }
56
+ }
57
+ export class Route {
58
+ get to() {
59
+ /* invariant(
60
+ this._to,
61
+ `trying to access property 'to' on a route which is not initialized yet. Route properties are only available after 'createRouter' completed.`,
62
+ )*/
63
+ return this._to;
64
+ }
65
+ get id() {
66
+ /* invariant(
67
+ this._id,
68
+ `trying to access property 'id' on a route which is not initialized yet. Route properties are only available after 'createRouter' completed.`,
69
+ )*/
70
+ return this._id;
71
+ }
72
+ get path() {
73
+ /* invariant(
74
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
75
+ this.isRoot || this._id || this._path,
76
+ `trying to access property 'path' on a route which is not initialized yet. Route properties are only available after 'createRouter' completed.`,
77
+ )*/
78
+ return this._path;
79
+ }
80
+ get fullPath() {
81
+ /* invariant(
82
+ this._fullPath,
83
+ `trying to access property 'fullPath' on a route which is not initialized yet. Route properties are only available after 'createRouter' completed.`,
84
+ )*/
85
+ return this._fullPath;
86
+ }
87
+ get ssr() {
88
+ return this._ssr;
89
+ }
90
+ /**
91
+ * @deprecated Use the `createRoute` function instead.
92
+ */
93
+ constructor(options) {
94
+ this.init = (opts) => {
95
+ this.originalIndex = opts.originalIndex;
96
+ const options = this.options;
97
+ const isRoot = !options?.path && !options?.id;
98
+ this.parentRoute = this.options.getParentRoute?.();
99
+ if (isRoot) {
100
+ this._path = rootRouteId;
101
+ }
102
+ else {
103
+ invariant(this.parentRoute, `Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);
104
+ }
105
+ let path = isRoot ? rootRouteId : options.path;
106
+ // If the path is anything other than an index path, trim it up
107
+ if (path && path !== '/') {
108
+ path = trimPathLeft(path);
109
+ }
110
+ const customId = options?.id || path;
111
+ // Strip the parentId prefix from the first level of children
112
+ let id = isRoot
113
+ ? rootRouteId
114
+ : joinPaths([
115
+ this.parentRoute.id === rootRouteId ? '' : this.parentRoute.id,
116
+ customId,
117
+ ]);
118
+ if (path === rootRouteId) {
119
+ path = '/';
120
+ }
121
+ if (id !== rootRouteId) {
122
+ id = joinPaths(['/', id]);
123
+ }
124
+ const fullPath = id === rootRouteId ? '/' : joinPaths([this.parentRoute.fullPath, path]);
125
+ this._path = path;
126
+ this._id = id;
127
+ // this.customId = customId as TCustomId
128
+ this._fullPath = fullPath;
129
+ this._to = fullPath;
130
+ this._ssr = options?.ssr ?? opts.defaultSsr ?? true;
131
+ };
132
+ this.updateLoader = (options) => {
133
+ Object.assign(this.options, options);
134
+ return this;
135
+ };
136
+ this.update = (options) => {
137
+ Object.assign(this.options, options);
138
+ return this;
139
+ };
140
+ this.lazy = (lazyFn) => {
141
+ this.lazyFn = lazyFn;
142
+ return this;
143
+ };
144
+ this.useMatch = (opts) => {
145
+ return useMatch({
146
+ select: opts?.select,
147
+ from: this.id,
148
+ });
149
+ };
150
+ this.useRouteContext = (opts) => {
151
+ return useMatch({
152
+ ...opts,
153
+ from: this.id,
154
+ select: (d) => (opts?.select ? opts.select(d.context) : d.context),
155
+ });
156
+ };
157
+ this.useSearch = (opts) => {
158
+ return useSearch({
159
+ select: opts?.select,
160
+ from: this.id,
161
+ });
162
+ };
163
+ this.useParams = (opts) => {
164
+ return useParams({
165
+ select: opts?.select,
166
+ from: this.id,
167
+ });
168
+ };
169
+ this.useLoaderDeps = (opts) => {
170
+ return useLoaderDeps({ ...opts, from: this.id });
171
+ };
172
+ this.useLoaderData = (opts) => {
173
+ return useLoaderData({ ...opts, from: this.id });
174
+ };
175
+ this.useNavigate = () => {
176
+ return useNavigate({ from: this.id });
177
+ };
178
+ this.options = options || {};
179
+ this.isRoot = !options?.getParentRoute;
180
+ invariant(!(options?.id && options?.path), `Route cannot have both an 'id' and a 'path' option.`);
181
+ }
182
+ addChildren(children) {
183
+ return this._addFileChildren(children);
184
+ }
185
+ _addFileChildren(children) {
186
+ if (Array.isArray(children)) {
187
+ this.children = children;
188
+ }
189
+ if (typeof children === 'object' && children !== null) {
190
+ this.children = Object.values(children);
191
+ }
192
+ return this;
193
+ }
194
+ }
195
+ export function createRoute(options) {
196
+ return new Route(options);
197
+ }
198
+ export function createRootRouteWithContext() {
199
+ return (options) => {
200
+ return createRootRoute(options);
201
+ };
202
+ }
203
+ /**
204
+ * @deprecated Use the `createRootRouteWithContext` function instead.
205
+ */
206
+ export const rootRouteWithContext = createRootRouteWithContext;
207
+ export class RootRoute extends Route {
208
+ /**
209
+ * @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
210
+ */
211
+ constructor(options) {
212
+ super(options);
213
+ }
214
+ addChildren(children) {
215
+ super.addChildren(children);
216
+ return this;
217
+ }
218
+ _addFileChildren(children) {
219
+ super._addFileChildren(children);
220
+ return this;
221
+ }
222
+ _addFileTypes() {
223
+ return this;
224
+ }
225
+ }
226
+ export function createRootRoute(options) {
227
+ return new RootRoute(options);
228
+ }
229
+ export function createRouteMask(opts) {
230
+ return opts;
231
+ }
232
+ export class NotFoundRoute extends Route {
233
+ constructor(options) {
234
+ super({
235
+ ...options,
236
+ id: '404',
237
+ });
238
+ }
239
+ }
240
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.js","sourceRoot":"","sources":["../../src/route.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAukBrC,MAAM,UAAU,WAAW,CAGzB,EAAyD;IACzD,OAAO,IAAI,QAAQ,CAAe,EAAE,EAAE,EAAE,CAAC,CAAA;AAC3C,CAAC;AAED,MAAM,OAAO,QAAQ;IAGnB;;OAEG;IACH,YAAY,EAAE,EAAE,EAAe;QAI/B,aAAQ,GAAuB,CAAC,IAAI,EAAE,EAAE;YACtC,OAAO,QAAQ,CAAC;gBACd,MAAM,EAAE,IAAI,EAAE,MAAM;gBACpB,IAAI,EAAE,IAAI,CAAC,EAAE;aACP,CAAQ,CAAA;QAClB,CAAC,CAAA;QAED,oBAAe,GAA8B,CAAC,IAAI,EAAE,EAAE;YACpD,OAAO,QAAQ,CAAC;gBACd,IAAI,EAAE,IAAI,CAAC,EAAS;gBACpB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,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