@tanstack/solid-router 1.112.10 → 1.112.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Match.cjs.map +1 -1
- package/dist/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/Matches.d.cts +1 -8
- package/dist/cjs/RouterProvider.cjs.map +1 -1
- package/dist/cjs/RouterProvider.d.cts +4 -4
- package/dist/cjs/Transitioner.cjs +1 -1
- package/dist/cjs/Transitioner.cjs.map +1 -1
- package/dist/cjs/fileRoute.cjs.map +1 -1
- package/dist/cjs/fileRoute.d.cts +4 -7
- package/dist/cjs/index.d.cts +3 -5
- package/dist/cjs/link.cjs.map +1 -1
- package/dist/cjs/link.d.cts +1 -2
- package/dist/cjs/not-found.cjs.map +1 -1
- package/dist/cjs/not-found.d.cts +1 -2
- package/dist/cjs/redirects.cjs.map +1 -1
- package/dist/cjs/redirects.d.cts +1 -2
- package/dist/cjs/renderRouteNotFound.cjs.map +1 -1
- package/dist/cjs/renderRouteNotFound.d.cts +1 -2
- package/dist/cjs/route.cjs +15 -23
- package/dist/cjs/route.cjs.map +1 -1
- package/dist/cjs/route.d.cts +19 -50
- package/dist/cjs/router.cjs +25 -25
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +84 -454
- package/dist/cjs/routerContext.cjs.map +1 -1
- package/dist/cjs/routerContext.d.cts +2 -2
- package/dist/cjs/scroll-restoration.cjs.map +1 -1
- package/dist/cjs/scroll-restoration.d.cts +1 -2
- package/dist/cjs/typePrimitives.d.cts +1 -2
- package/dist/cjs/useBlocker.cjs.map +1 -1
- package/dist/cjs/useBlocker.d.cts +2 -3
- package/dist/cjs/useLoaderData.cjs.map +1 -1
- package/dist/cjs/useLoaderData.d.cts +1 -3
- package/dist/cjs/useLoaderDeps.cjs.map +1 -1
- package/dist/cjs/useLoaderDeps.d.cts +1 -3
- package/dist/cjs/useLocation.cjs.map +1 -1
- package/dist/cjs/useLocation.d.cts +1 -1
- package/dist/cjs/useMatch.cjs.map +1 -1
- package/dist/cjs/useMatch.d.cts +1 -3
- package/dist/cjs/useNavigate.cjs.map +1 -1
- package/dist/cjs/useNavigate.d.cts +1 -2
- package/dist/cjs/useParams.cjs.map +1 -1
- package/dist/cjs/useParams.d.cts +1 -3
- package/dist/cjs/useRouteContext.cjs.map +1 -1
- package/dist/cjs/useRouteContext.d.cts +1 -2
- package/dist/cjs/useRouter.cjs.map +1 -1
- package/dist/cjs/useRouter.d.cts +1 -1
- package/dist/cjs/useRouterState.cjs.map +1 -1
- package/dist/cjs/useRouterState.d.cts +1 -1
- package/dist/cjs/useSearch.cjs.map +1 -1
- package/dist/cjs/useSearch.d.cts +1 -3
- package/dist/cjs/utils.cjs.map +1 -1
- package/dist/cjs/utils.d.cts +0 -9
- package/dist/esm/Match.js.map +1 -1
- package/dist/esm/Matches.d.ts +1 -8
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/RouterProvider.d.ts +4 -4
- package/dist/esm/RouterProvider.js.map +1 -1
- package/dist/esm/Transitioner.js +1 -1
- package/dist/esm/Transitioner.js.map +1 -1
- package/dist/esm/fileRoute.d.ts +4 -7
- package/dist/esm/fileRoute.js.map +1 -1
- package/dist/esm/index.d.ts +3 -5
- package/dist/esm/link.d.ts +1 -2
- package/dist/esm/link.js.map +1 -1
- package/dist/esm/not-found.d.ts +1 -2
- package/dist/esm/not-found.js.map +1 -1
- package/dist/esm/redirects.d.ts +1 -2
- package/dist/esm/redirects.js.map +1 -1
- package/dist/esm/renderRouteNotFound.d.ts +1 -2
- package/dist/esm/renderRouteNotFound.js.map +1 -1
- package/dist/esm/route.d.ts +19 -50
- package/dist/esm/route.js +15 -23
- package/dist/esm/route.js.map +1 -1
- package/dist/esm/router.d.ts +84 -454
- package/dist/esm/router.js +25 -25
- package/dist/esm/router.js.map +1 -1
- package/dist/esm/routerContext.d.ts +2 -2
- package/dist/esm/routerContext.js.map +1 -1
- package/dist/esm/scroll-restoration.d.ts +1 -2
- package/dist/esm/scroll-restoration.js.map +1 -1
- package/dist/esm/typePrimitives.d.ts +1 -2
- package/dist/esm/useBlocker.d.ts +2 -3
- package/dist/esm/useBlocker.js.map +1 -1
- package/dist/esm/useLoaderData.d.ts +1 -3
- package/dist/esm/useLoaderData.js.map +1 -1
- package/dist/esm/useLoaderDeps.d.ts +1 -3
- package/dist/esm/useLoaderDeps.js.map +1 -1
- package/dist/esm/useLocation.d.ts +1 -1
- package/dist/esm/useLocation.js.map +1 -1
- package/dist/esm/useMatch.d.ts +1 -3
- package/dist/esm/useMatch.js.map +1 -1
- package/dist/esm/useNavigate.d.ts +1 -2
- package/dist/esm/useNavigate.js.map +1 -1
- package/dist/esm/useParams.d.ts +1 -3
- package/dist/esm/useParams.js.map +1 -1
- package/dist/esm/useRouteContext.d.ts +1 -2
- package/dist/esm/useRouteContext.js.map +1 -1
- package/dist/esm/useRouter.d.ts +1 -1
- package/dist/esm/useRouter.js.map +1 -1
- package/dist/esm/useRouterState.d.ts +1 -1
- package/dist/esm/useRouterState.js.map +1 -1
- package/dist/esm/useSearch.d.ts +1 -3
- package/dist/esm/useSearch.js.map +1 -1
- package/dist/esm/utils.d.ts +0 -9
- package/dist/esm/utils.js.map +1 -1
- package/dist/source/Matches.d.ts +1 -8
- package/dist/source/Matches.jsx.map +1 -1
- package/dist/source/RouterProvider.d.ts +4 -4
- package/dist/source/RouterProvider.jsx.map +1 -1
- package/dist/source/Transitioner.jsx +1 -1
- package/dist/source/Transitioner.jsx.map +1 -1
- package/dist/source/fileRoute.d.ts +4 -7
- package/dist/source/fileRoute.js.map +1 -1
- package/dist/source/index.d.ts +3 -5
- package/dist/source/index.jsx.map +1 -1
- package/dist/source/link.d.ts +1 -2
- package/dist/source/link.jsx.map +1 -1
- package/dist/source/not-found.d.ts +1 -2
- package/dist/source/not-found.jsx.map +1 -1
- package/dist/source/redirects.d.ts +1 -2
- package/dist/source/renderRouteNotFound.d.ts +1 -2
- package/dist/source/renderRouteNotFound.jsx.map +1 -1
- package/dist/source/route.d.ts +19 -50
- package/dist/source/route.js +15 -23
- package/dist/source/route.js.map +1 -1
- package/dist/source/router.d.ts +83 -454
- package/dist/source/router.js +33 -22
- package/dist/source/router.js.map +1 -1
- package/dist/source/routerContext.d.ts +2 -2
- package/dist/source/routerContext.jsx.map +1 -1
- package/dist/source/scroll-restoration.d.ts +1 -2
- package/dist/source/scroll-restoration.jsx.map +1 -1
- package/dist/source/typePrimitives.d.ts +1 -2
- package/dist/source/useBlocker.d.ts +2 -3
- package/dist/source/useBlocker.jsx.map +1 -1
- package/dist/source/useLoaderData.d.ts +1 -3
- package/dist/source/useLoaderData.jsx.map +1 -1
- package/dist/source/useLoaderDeps.d.ts +1 -3
- package/dist/source/useLoaderDeps.jsx.map +1 -1
- package/dist/source/useLocation.d.ts +1 -1
- package/dist/source/useLocation.jsx.map +1 -1
- package/dist/source/useMatch.d.ts +1 -3
- package/dist/source/useMatch.jsx.map +1 -1
- package/dist/source/useNavigate.d.ts +1 -2
- package/dist/source/useNavigate.jsx.map +1 -1
- package/dist/source/useParams.d.ts +1 -3
- package/dist/source/useParams.jsx.map +1 -1
- package/dist/source/useRouteContext.d.ts +1 -2
- package/dist/source/useRouter.d.ts +1 -1
- package/dist/source/useRouterState.d.ts +1 -1
- package/dist/source/useRouterState.jsx.map +1 -1
- package/dist/source/useSearch.d.ts +1 -3
- package/dist/source/useSearch.jsx.map +1 -1
- package/dist/source/utils.d.ts +1 -10
- package/dist/source/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/Match.tsx +1 -1
- package/src/Matches.tsx +4 -8
- package/src/RouterProvider.tsx +4 -7
- package/src/Transitioner.tsx +1 -1
- package/src/fileRoute.ts +9 -25
- package/src/index.tsx +22 -28
- package/src/link.tsx +2 -1
- package/src/not-found.tsx +1 -2
- package/src/redirects.ts +1 -1
- package/src/renderRouteNotFound.tsx +1 -2
- package/src/route.ts +93 -222
- package/src/router.ts +154 -596
- package/src/routerContext.tsx +3 -3
- package/src/scroll-restoration.tsx +6 -2
- package/src/typePrimitives.ts +2 -1
- package/src/useBlocker.tsx +7 -3
- package/src/useLoaderData.tsx +3 -2
- package/src/useLoaderDeps.tsx +3 -2
- package/src/useLocation.tsx +5 -1
- package/src/useMatch.tsx +3 -2
- package/src/useNavigate.tsx +2 -1
- package/src/useParams.tsx +3 -2
- package/src/useRouteContext.ts +2 -2
- package/src/useRouter.tsx +1 -1
- package/src/useRouterState.tsx +5 -1
- package/src/useSearch.tsx +3 -2
- package/src/utils.ts +0 -16
package/dist/cjs/router.d.cts
CHANGED
|
@@ -1,434 +1,77 @@
|
|
|
1
|
-
import { Store
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { MatchRouteOptions } from './Matches.cjs';
|
|
1
|
+
import { Store } from '@tanstack/solid-store';
|
|
2
|
+
import { RouterHistory } from '@tanstack/history';
|
|
3
|
+
import { AnyRedirect, AnyRoute, AnyRouteMatch, AnyRouter, BuildLocationFn, BuildNextOptions, ClearCacheFn, CommitLocationFn, CommitLocationOptions, ControlledPromise, Router as CoreRouter, EmitFn, FullSearchSchema, GetMatchFn, GetMatchRoutesFn, InjectedHtmlEntry, InvalidateFn, LoadFn, MakeRouteMatch, Manifest, MatchRouteFn, MatchRoutesFn, NavigateFn, ParseLocationFn, ParsedLocation, PickAsRequired, PreloadRouteFn, ResolvedRedirect, RouterConstructorOptions, RouterEvent, RouterListener, RouterOptions, RouterState, RoutesById, RoutesByPath, StartSerializer, StartTransitionFn, SubscribeFn, TrailingSlashOption, UpdateFn, UpdateMatchFn, ViewTransitionOptions } from '@tanstack/router-core';
|
|
4
|
+
import { ErrorRouteComponent, NotFoundRouteComponent, RouteComponent } from './route.cjs';
|
|
6
5
|
import { NotFoundError } from './not-found.cjs';
|
|
7
6
|
import type * as Solid from 'solid-js';
|
|
8
|
-
declare
|
|
9
|
-
interface
|
|
10
|
-
__TSR_ROUTER__?: AnyRouter;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export type AnyRouter = Router<any, any, any, any, any>;
|
|
14
|
-
export type RegisteredRouter = Register extends {
|
|
15
|
-
router: infer TRouter extends AnyRouter;
|
|
16
|
-
} ? TRouter : AnyRouter;
|
|
17
|
-
export type InferRouterContext<TRouteTree extends AnyRoute> = TRouteTree extends RootRoute<any, infer TRouterContext extends AnyContext, any, any, any, any, any, any> ? TRouterContext : AnyContext;
|
|
18
|
-
export type ControllablePromise<T = any> = Promise<T> & {
|
|
19
|
-
resolve: (value: T) => void;
|
|
20
|
-
reject: (value?: any) => void;
|
|
21
|
-
};
|
|
22
|
-
export type RouterContextOptions<TRouteTree extends AnyRoute> = AnyContext extends InferRouterContext<TRouteTree> ? {
|
|
23
|
-
context?: InferRouterContext<TRouteTree>;
|
|
24
|
-
} : {
|
|
25
|
-
context: InferRouterContext<TRouteTree>;
|
|
26
|
-
};
|
|
27
|
-
export type InjectedHtmlEntry = Promise<string>;
|
|
28
|
-
export interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TRouterHistory extends RouterHistory = RouterHistory, TDehydrated extends Record<string, any> = Record<string, any>> {
|
|
29
|
-
/**
|
|
30
|
-
* The history object that will be used to manage the browser history.
|
|
31
|
-
*
|
|
32
|
-
* If not provided, a new createBrowserHistory instance will be created and used.
|
|
33
|
-
*
|
|
34
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#history-property)
|
|
35
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/history-types)
|
|
36
|
-
*/
|
|
37
|
-
history?: TRouterHistory;
|
|
38
|
-
/**
|
|
39
|
-
* A function that will be used to stringify search params when generating links.
|
|
40
|
-
*
|
|
41
|
-
* @default defaultStringifySearch
|
|
42
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#stringifysearch-method)
|
|
43
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization)
|
|
44
|
-
*/
|
|
45
|
-
stringifySearch?: SearchSerializer;
|
|
46
|
-
/**
|
|
47
|
-
* A function that will be used to parse search params when parsing the current location.
|
|
48
|
-
*
|
|
49
|
-
* @default defaultParseSearch
|
|
50
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#parsesearch-method)
|
|
51
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization)
|
|
52
|
-
*/
|
|
53
|
-
parseSearch?: SearchParser;
|
|
54
|
-
/**
|
|
55
|
-
* If `false`, routes will not be preloaded by default in any way.
|
|
56
|
-
*
|
|
57
|
-
* If `'intent'`, routes will be preloaded by default when the user hovers over a link or a `touchstart` event is detected on a `<Link>`.
|
|
58
|
-
*
|
|
59
|
-
* If `'viewport'`, routes will be preloaded by default when they are within the viewport.
|
|
60
|
-
*
|
|
61
|
-
* @default false
|
|
62
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreload-property)
|
|
63
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
|
|
64
|
-
*/
|
|
65
|
-
defaultPreload?: false | 'intent' | 'viewport' | 'render';
|
|
66
|
-
/**
|
|
67
|
-
* The delay in milliseconds that a route must be hovered over or touched before it is preloaded.
|
|
68
|
-
*
|
|
69
|
-
* @default 50
|
|
70
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloaddelay-property)
|
|
71
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading#preload-delay)
|
|
72
|
-
*/
|
|
73
|
-
defaultPreloadDelay?: number;
|
|
74
|
-
/**
|
|
75
|
-
* The default `component` a route should use if no component is provided.
|
|
76
|
-
*
|
|
77
|
-
* @default Outlet
|
|
78
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultcomponent-property)
|
|
79
|
-
*/
|
|
80
|
-
defaultComponent?: RouteComponent;
|
|
81
|
-
/**
|
|
82
|
-
* The default `errorComponent` a route should use if no error component is provided.
|
|
83
|
-
*
|
|
84
|
-
* @default ErrorComponent
|
|
85
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulterrorcomponent-property)
|
|
86
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)
|
|
87
|
-
*/
|
|
88
|
-
defaultErrorComponent?: ErrorRouteComponent;
|
|
89
|
-
/**
|
|
90
|
-
* The default `pendingComponent` a route should use if no pending component is provided.
|
|
91
|
-
*
|
|
92
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingcomponent-property)
|
|
93
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#showing-a-pending-component)
|
|
94
|
-
*/
|
|
95
|
-
defaultPendingComponent?: RouteComponent;
|
|
96
|
-
/**
|
|
97
|
-
* The default `pendingMs` a route should use if no pendingMs is provided.
|
|
98
|
-
*
|
|
99
|
-
* @default 1000
|
|
100
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingms-property)
|
|
101
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#avoiding-pending-component-flash)
|
|
102
|
-
*/
|
|
103
|
-
defaultPendingMs?: number;
|
|
104
|
-
/**
|
|
105
|
-
* The default `pendingMinMs` a route should use if no pendingMinMs is provided.
|
|
106
|
-
*
|
|
107
|
-
* @default 500
|
|
108
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingminms-property)
|
|
109
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#avoiding-pending-component-flash)
|
|
110
|
-
*/
|
|
111
|
-
defaultPendingMinMs?: number;
|
|
112
|
-
/**
|
|
113
|
-
* The default `staleTime` a route should use if no staleTime is provided. This is the time in milliseconds that a route will be considered fresh.
|
|
114
|
-
*
|
|
115
|
-
* @default 0
|
|
116
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultstaletime-property)
|
|
117
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options)
|
|
118
|
-
*/
|
|
119
|
-
defaultStaleTime?: number;
|
|
120
|
-
/**
|
|
121
|
-
* The default `preloadStaleTime` a route should use if no preloadStaleTime is provided.
|
|
122
|
-
*
|
|
123
|
-
* @default 30_000 `(30 seconds)`
|
|
124
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadstaletime-property)
|
|
125
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
|
|
126
|
-
*/
|
|
127
|
-
defaultPreloadStaleTime?: number;
|
|
128
|
-
/**
|
|
129
|
-
* The default `defaultPreloadGcTime` a route should use if no preloadGcTime is provided.
|
|
130
|
-
*
|
|
131
|
-
* @default 1_800_000 `(30 minutes)`
|
|
132
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpreloadgctime-property)
|
|
133
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/preloading)
|
|
134
|
-
*/
|
|
135
|
-
defaultPreloadGcTime?: number;
|
|
136
|
-
/**
|
|
137
|
-
* The default `onCatch` handler for errors caught by the Router ErrorBoundary
|
|
138
|
-
*
|
|
139
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)
|
|
140
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)
|
|
141
|
-
*/
|
|
142
|
-
defaultOnCatch?: (error: Error) => void;
|
|
143
|
-
/**
|
|
144
|
-
* If `true`, route navigations will called using `document.startViewTransition()`.
|
|
145
|
-
*
|
|
146
|
-
* If the browser does not support this api, this option will be ignored.
|
|
147
|
-
*
|
|
148
|
-
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition) for more information on how this function works.
|
|
149
|
-
*
|
|
150
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultviewtransition-property)
|
|
151
|
-
*/
|
|
152
|
-
defaultViewTransition?: boolean | ViewTransitionOptions;
|
|
153
|
-
/**
|
|
154
|
-
* The default `hashScrollIntoView` a route should use if no hashScrollIntoView is provided while navigating
|
|
155
|
-
*
|
|
156
|
-
* See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) for more information on `ScrollIntoViewOptions`.
|
|
157
|
-
*
|
|
158
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulthashscrollintoview-property)
|
|
159
|
-
*/
|
|
160
|
-
defaultHashScrollIntoView?: boolean | ScrollIntoViewOptions;
|
|
161
|
-
/**
|
|
162
|
-
* @default 'fuzzy'
|
|
163
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#notfoundmode-property)
|
|
164
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#the-notfoundmode-option)
|
|
165
|
-
*/
|
|
166
|
-
notFoundMode?: 'root' | 'fuzzy';
|
|
167
|
-
/**
|
|
168
|
-
* The default `gcTime` a route should use if no gcTime is provided.
|
|
169
|
-
*
|
|
170
|
-
* @default 1_800_000 `(30 minutes)`
|
|
171
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultgctime-property)
|
|
172
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#key-options)
|
|
173
|
-
*/
|
|
174
|
-
defaultGcTime?: number;
|
|
175
|
-
/**
|
|
176
|
-
* If `true`, all routes will be matched as case-sensitive.
|
|
177
|
-
*
|
|
178
|
-
* @default false
|
|
179
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#casesensitive-property)
|
|
180
|
-
*/
|
|
181
|
-
caseSensitive?: boolean;
|
|
182
|
-
/**
|
|
183
|
-
*
|
|
184
|
-
* The route tree that will be used to configure the router instance.
|
|
185
|
-
*
|
|
186
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#routetree-property)
|
|
187
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/routing/route-trees)
|
|
188
|
-
*/
|
|
189
|
-
routeTree?: TRouteTree;
|
|
190
|
-
/**
|
|
191
|
-
* The basepath for then entire router. This is useful for mounting a router instance at a subpath.
|
|
192
|
-
*
|
|
193
|
-
* @default '/'
|
|
194
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#basepath-property)
|
|
195
|
-
*/
|
|
196
|
-
basepath?: string;
|
|
197
|
-
/**
|
|
198
|
-
* The root context that will be provided to all routes in the route tree.
|
|
199
|
-
*
|
|
200
|
-
* This can be used to provide a context to all routes in the tree without having to provide it to each route individually.
|
|
201
|
-
*
|
|
202
|
-
* Optional or required if the root route was created with [`createRootRouteWithContext()`](https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction).
|
|
203
|
-
*
|
|
204
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#context-property)
|
|
205
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/router-context)
|
|
206
|
-
*/
|
|
207
|
-
context?: InferRouterContext<TRouteTree>;
|
|
208
|
-
/**
|
|
209
|
-
* A function that will be called when the router is dehydrated.
|
|
210
|
-
*
|
|
211
|
-
* The return value of this function will be serialized and stored in the router's dehydrated state.
|
|
212
|
-
*
|
|
213
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#dehydrate-method)
|
|
214
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)
|
|
215
|
-
*/
|
|
216
|
-
dehydrate?: () => TDehydrated;
|
|
217
|
-
/**
|
|
218
|
-
* A function that will be called when the router is hydrated.
|
|
219
|
-
*
|
|
220
|
-
* The return value of this function will be serialized and stored in the router's dehydrated state.
|
|
221
|
-
*
|
|
222
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#hydrate-method)
|
|
223
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)
|
|
224
|
-
*/
|
|
225
|
-
hydrate?: (dehydrated: TDehydrated) => void;
|
|
226
|
-
/**
|
|
227
|
-
* An array of route masks that will be used to mask routes in the route tree.
|
|
228
|
-
*
|
|
229
|
-
* Route masking is when you display a route at a different path than the one it is configured to match, like a modal popup that when shared will unmask to the modal's content instead of the modal's context.
|
|
230
|
-
*
|
|
231
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#routemasks-property)
|
|
232
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-masking)
|
|
233
|
-
*/
|
|
234
|
-
routeMasks?: Array<RouteMask<TRouteTree>>;
|
|
235
|
-
/**
|
|
236
|
-
* If `true`, route masks will, by default, be removed when the page is reloaded.
|
|
237
|
-
*
|
|
238
|
-
* This can be overridden on a per-mask basis by setting the `unmaskOnReload` option on the mask, or on a per-navigation basis by setting the `unmaskOnReload` option in the `Navigate` options.
|
|
239
|
-
*
|
|
240
|
-
* @default false
|
|
241
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#unmaskonreload-property)
|
|
242
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/route-masking#unmasking-on-page-reload)
|
|
243
|
-
*/
|
|
244
|
-
unmaskOnReload?: boolean;
|
|
245
|
-
/**
|
|
246
|
-
* A component that will be used to wrap the entire router.
|
|
247
|
-
*
|
|
248
|
-
* This is useful for providing a context to the entire router.
|
|
249
|
-
*
|
|
250
|
-
* Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
|
|
251
|
-
*
|
|
252
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#wrap-property)
|
|
253
|
-
*/
|
|
254
|
-
Wrap?: (props: {
|
|
255
|
-
children: any;
|
|
256
|
-
}) => Solid.JSX.Element;
|
|
257
|
-
/**
|
|
258
|
-
* A component that will be used to wrap the inner contents of the router.
|
|
259
|
-
*
|
|
260
|
-
* This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.
|
|
261
|
-
*
|
|
262
|
-
* Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
|
|
263
|
-
*
|
|
264
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#innerwrap-property)
|
|
265
|
-
*/
|
|
266
|
-
InnerWrap?: (props: {
|
|
267
|
-
children: any;
|
|
268
|
-
}) => Solid.JSX.Element;
|
|
269
|
-
/**
|
|
270
|
-
* Use `notFoundComponent` instead.
|
|
271
|
-
*
|
|
272
|
-
* @deprecated
|
|
273
|
-
* See https://tanstack.com/router/v1/docs/guide/not-found-errors#migrating-from-notfoundroute for more info.
|
|
274
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#notfoundroute-property)
|
|
275
|
-
*/
|
|
276
|
-
notFoundRoute?: AnyRoute;
|
|
277
|
-
/**
|
|
278
|
-
* The default `notFoundComponent` a route should use if no notFound component is provided.
|
|
279
|
-
*
|
|
280
|
-
* @default NotFound
|
|
281
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultnotfoundcomponent-property)
|
|
282
|
-
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#default-router-wide-not-found-handling)
|
|
283
|
-
*/
|
|
284
|
-
defaultNotFoundComponent?: NotFoundRouteComponent;
|
|
285
|
-
/**
|
|
286
|
-
* Configures how trailing slashes are treated.
|
|
287
|
-
*
|
|
288
|
-
* - `'always'` will add a trailing slash if not present
|
|
289
|
-
* - `'never'` will remove the trailing slash if present
|
|
290
|
-
* - `'preserve'` will not modify the trailing slash.
|
|
291
|
-
*
|
|
292
|
-
* @default 'never'
|
|
293
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#trailingslash-property)
|
|
294
|
-
*/
|
|
295
|
-
trailingSlash?: TTrailingSlashOption;
|
|
296
|
-
/**
|
|
297
|
-
* While usually automatic, sometimes it can be useful to force the router into a server-side state, e.g. when using the router in a non-browser environment that has access to a global.document object.
|
|
298
|
-
*
|
|
299
|
-
* @default typeof document !== 'undefined'
|
|
300
|
-
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#isserver-property)
|
|
301
|
-
*/
|
|
302
|
-
isServer?: boolean;
|
|
303
|
-
defaultSsr?: boolean;
|
|
304
|
-
search?: {
|
|
7
|
+
declare module '@tanstack/router-core' {
|
|
8
|
+
interface RouterOptionsExtensions {
|
|
305
9
|
/**
|
|
306
|
-
*
|
|
10
|
+
* A component that will be used to wrap the entire router.
|
|
307
11
|
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
12
|
+
* This is useful for providing a context to the entire router.
|
|
13
|
+
*
|
|
14
|
+
* Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
|
|
15
|
+
*
|
|
16
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#wrap-property)
|
|
310
17
|
*/
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
export interface BuildNextOptions {
|
|
365
|
-
to?: string | number | null;
|
|
366
|
-
params?: true | Updater<unknown>;
|
|
367
|
-
search?: true | Updater<unknown>;
|
|
368
|
-
hash?: true | Updater<string>;
|
|
369
|
-
state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>;
|
|
370
|
-
mask?: {
|
|
371
|
-
to?: string | number | null;
|
|
372
|
-
params?: true | Updater<unknown>;
|
|
373
|
-
search?: true | Updater<unknown>;
|
|
374
|
-
hash?: true | Updater<string>;
|
|
375
|
-
state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>;
|
|
376
|
-
unmaskOnReload?: boolean;
|
|
377
|
-
};
|
|
378
|
-
from?: string;
|
|
379
|
-
_fromLocation?: ParsedLocation;
|
|
380
|
-
href?: string;
|
|
381
|
-
}
|
|
382
|
-
export interface MatchedRoutesResult {
|
|
383
|
-
matchedRoutes: Array<AnyRoute>;
|
|
384
|
-
routeParams: Record<string, string>;
|
|
18
|
+
Wrap?: (props: {
|
|
19
|
+
children: any;
|
|
20
|
+
}) => Solid.JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* A component that will be used to wrap the inner contents of the router.
|
|
23
|
+
*
|
|
24
|
+
* This is useful for providing a context to the inner contents of the router where you also need access to the router context and hooks.
|
|
25
|
+
*
|
|
26
|
+
* Only non-DOM-rendering components like providers should be used, anything else will cause a hydration error.
|
|
27
|
+
*
|
|
28
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#innerwrap-property)
|
|
29
|
+
*/
|
|
30
|
+
InnerWrap?: (props: {
|
|
31
|
+
children: any;
|
|
32
|
+
}) => Solid.JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* The default `component` a route should use if no component is provided.
|
|
35
|
+
*
|
|
36
|
+
* @default Outlet
|
|
37
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultcomponent-property)
|
|
38
|
+
*/
|
|
39
|
+
defaultComponent?: RouteComponent;
|
|
40
|
+
/**
|
|
41
|
+
* The default `errorComponent` a route should use if no error component is provided.
|
|
42
|
+
*
|
|
43
|
+
* @default ErrorComponent
|
|
44
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaulterrorcomponent-property)
|
|
45
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionserrorcomponent)
|
|
46
|
+
*/
|
|
47
|
+
defaultErrorComponent?: ErrorRouteComponent;
|
|
48
|
+
/**
|
|
49
|
+
* The default `pendingComponent` a route should use if no pending component is provided.
|
|
50
|
+
*
|
|
51
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultpendingcomponent-property)
|
|
52
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#showing-a-pending-component)
|
|
53
|
+
*/
|
|
54
|
+
defaultPendingComponent?: RouteComponent;
|
|
55
|
+
/**
|
|
56
|
+
* The default `notFoundComponent` a route should use if no notFound component is provided.
|
|
57
|
+
*
|
|
58
|
+
* @default NotFound
|
|
59
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultnotfoundcomponent-property)
|
|
60
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/not-found-errors#default-router-wide-not-found-handling)
|
|
61
|
+
*/
|
|
62
|
+
defaultNotFoundComponent?: NotFoundRouteComponent;
|
|
63
|
+
/**
|
|
64
|
+
* The default `onCatch` handler for errors caught by the Router ErrorBoundary
|
|
65
|
+
*
|
|
66
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#defaultoncatch-property)
|
|
67
|
+
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/data-loading#handling-errors-with-routeoptionsoncatch)
|
|
68
|
+
*/
|
|
69
|
+
defaultOnCatch?: (error: Error) => void;
|
|
70
|
+
}
|
|
385
71
|
}
|
|
386
|
-
export type RouterConstructorOptions<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TRouterHistory extends RouterHistory, TDehydrated extends Record<string, any>> = Omit<RouterOptions<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated>, 'context'> & RouterContextOptions<TRouteTree>;
|
|
387
72
|
export declare const componentTypes: readonly ["component", "errorComponent", "pendingComponent", "notFoundComponent"];
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
toLocation: ParsedLocation;
|
|
391
|
-
pathChanged: boolean;
|
|
392
|
-
hrefChanged: boolean;
|
|
393
|
-
hashChanged: boolean;
|
|
394
|
-
};
|
|
395
|
-
export type RouterEvents = {
|
|
396
|
-
onBeforeNavigate: {
|
|
397
|
-
type: 'onBeforeNavigate';
|
|
398
|
-
} & NavigationEventInfo;
|
|
399
|
-
onBeforeLoad: {
|
|
400
|
-
type: 'onBeforeLoad';
|
|
401
|
-
} & NavigationEventInfo;
|
|
402
|
-
onLoad: {
|
|
403
|
-
type: 'onLoad';
|
|
404
|
-
} & NavigationEventInfo;
|
|
405
|
-
onResolved: {
|
|
406
|
-
type: 'onResolved';
|
|
407
|
-
} & NavigationEventInfo;
|
|
408
|
-
onBeforeRouteMount: {
|
|
409
|
-
type: 'onBeforeRouteMount';
|
|
410
|
-
} & NavigationEventInfo;
|
|
411
|
-
onInjectedHtml: {
|
|
412
|
-
type: 'onInjectedHtml';
|
|
413
|
-
promise: Promise<string>;
|
|
414
|
-
};
|
|
415
|
-
onRendered: {
|
|
416
|
-
type: 'onRendered';
|
|
417
|
-
} & NavigationEventInfo;
|
|
418
|
-
};
|
|
419
|
-
export type RouterEvent = RouterEvents[keyof RouterEvents];
|
|
420
|
-
export type RouterListener<TRouterEvent extends RouterEvent> = {
|
|
421
|
-
eventType: TRouterEvent['type'];
|
|
422
|
-
fn: ListenerFn<TRouterEvent>;
|
|
423
|
-
};
|
|
424
|
-
export declare function createRouter<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TRouterHistory extends RouterHistory = RouterHistory, TDehydrated extends Record<string, any> = Record<string, any>, TSerializedError extends Record<string, any> = Record<string, any>>(options: undefined extends number ? 'strictNullChecks must be enabled in tsconfig.json' : RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated>): Router<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated, TSerializedError>;
|
|
425
|
-
type MatchRoutesOpts = {
|
|
426
|
-
preload?: boolean;
|
|
427
|
-
throwOnError?: boolean;
|
|
428
|
-
_buildLocation?: boolean;
|
|
429
|
-
dest?: BuildNextOptions;
|
|
430
|
-
};
|
|
431
|
-
export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>, in out TSerializedError extends Record<string, any> = Record<string, any>> {
|
|
73
|
+
export declare function createRouter<TRouteTree extends AnyRoute, TTrailingSlashOption extends TrailingSlashOption, TRouterHistory extends RouterHistory = RouterHistory, TDehydrated extends Record<string, any> = Record<string, any>>(options: undefined extends number ? 'strictNullChecks must be enabled in tsconfig.json' : RouterConstructorOptions<TRouteTree, TTrailingSlashOption, false, TRouterHistory, TDehydrated>): CoreRouter<TRouteTree, TTrailingSlashOption, false, TRouterHistory, TDehydrated>;
|
|
74
|
+
export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailingSlashOption extends TrailingSlashOption, in out TRouterHistory extends RouterHistory = RouterHistory, in out TDehydrated extends Record<string, any> = Record<string, any>> implements CoreRouter<TRouteTree, TTrailingSlashOption, false, TRouterHistory, TDehydrated> {
|
|
432
75
|
tempLocationKey: string | undefined;
|
|
433
76
|
resetNextScroll: boolean;
|
|
434
77
|
shouldViewTransition?: boolean | ViewTransitionOptions;
|
|
@@ -438,7 +81,7 @@ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailing
|
|
|
438
81
|
isScrollRestoring: boolean;
|
|
439
82
|
isScrollRestorationSetup: boolean;
|
|
440
83
|
__store: Store<RouterState<TRouteTree>>;
|
|
441
|
-
options: PickAsRequired<RouterOptions<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated>, 'stringifySearch' | 'parseSearch' | 'context'>;
|
|
84
|
+
options: PickAsRequired<RouterOptions<TRouteTree, TTrailingSlashOption, false, TRouterHistory, TDehydrated>, 'stringifySearch' | 'parseSearch' | 'context'>;
|
|
442
85
|
history: TRouterHistory;
|
|
443
86
|
latestLocation: ParsedLocation<FullSearchSchema<TRouteTree>>;
|
|
444
87
|
basepath: string;
|
|
@@ -451,14 +94,14 @@ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailing
|
|
|
451
94
|
/**
|
|
452
95
|
* @deprecated Use the `createRouter` function instead
|
|
453
96
|
*/
|
|
454
|
-
constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, TRouterHistory, TDehydrated>);
|
|
455
|
-
|
|
456
|
-
update:
|
|
97
|
+
constructor(options: RouterConstructorOptions<TRouteTree, TTrailingSlashOption, false, TRouterHistory, TDehydrated>);
|
|
98
|
+
startTransition: StartTransitionFn;
|
|
99
|
+
update: UpdateFn<TRouteTree, TTrailingSlashOption, false, TRouterHistory, TDehydrated>;
|
|
457
100
|
get state(): RouterState<TRouteTree, import('@tanstack/router-core').RouteMatch<any, any, any, any, any, any, any>>;
|
|
458
101
|
buildRouteTree: () => void;
|
|
459
|
-
subscribe:
|
|
460
|
-
emit:
|
|
461
|
-
parseLocation:
|
|
102
|
+
subscribe: SubscribeFn;
|
|
103
|
+
emit: EmitFn;
|
|
104
|
+
parseLocation: ParseLocationFn<TRouteTree>;
|
|
462
105
|
resolvePathWithBase: (from: string, path: string) => string;
|
|
463
106
|
get looseRoutesById(): Record<string, AnyRoute>;
|
|
464
107
|
/**
|
|
@@ -470,28 +113,21 @@ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailing
|
|
|
470
113
|
): Array<AnyRouteMatch>;
|
|
471
114
|
```
|
|
472
115
|
*/
|
|
473
|
-
matchRoutes
|
|
474
|
-
matchRoutes(next: ParsedLocation, opts?: MatchRoutesOpts): Array<AnyRouteMatch>;
|
|
116
|
+
matchRoutes: MatchRoutesFn;
|
|
475
117
|
private matchRoutesInternal;
|
|
476
|
-
getMatchedRoutes:
|
|
477
|
-
matchedRoutes: AnyRoute[];
|
|
478
|
-
routeParams: Record<string, string>;
|
|
479
|
-
foundRoute: AnyRoute | undefined;
|
|
480
|
-
};
|
|
118
|
+
getMatchedRoutes: GetMatchRoutesFn;
|
|
481
119
|
cancelMatch: (id: string) => void;
|
|
482
120
|
cancelMatches: () => void;
|
|
483
121
|
buildLocation: BuildLocationFn;
|
|
484
122
|
commitLocationPromise: undefined | ControlledPromise<void>;
|
|
485
|
-
commitLocation:
|
|
123
|
+
commitLocation: CommitLocationFn;
|
|
486
124
|
buildAndCommitLocation: ({ replace, resetScroll, hashScrollIntoView, viewTransition, ignoreBlocker, href, ...rest }?: BuildNextOptions & CommitLocationOptions) => Promise<void>;
|
|
487
125
|
navigate: NavigateFn;
|
|
488
126
|
latestLoadPromise: undefined | Promise<void>;
|
|
489
|
-
load:
|
|
490
|
-
sync?: boolean;
|
|
491
|
-
}) => Promise<void>;
|
|
127
|
+
load: LoadFn;
|
|
492
128
|
startViewTransition: (fn: () => Promise<void>) => void;
|
|
493
|
-
updateMatch:
|
|
494
|
-
getMatch:
|
|
129
|
+
updateMatch: UpdateMatchFn;
|
|
130
|
+
getMatch: GetMatchFn;
|
|
495
131
|
loadMatches: ({ location, matches, preload: allPreload, onReady, updateMatch, sync, }: {
|
|
496
132
|
location: ParsedLocation;
|
|
497
133
|
matches: Array<AnyRouteMatch>;
|
|
@@ -501,18 +137,13 @@ export declare class Router<in out TRouteTree extends AnyRoute, in out TTrailing
|
|
|
501
137
|
getMatch?: (matchId: string) => AnyRouteMatch | undefined;
|
|
502
138
|
sync?: boolean;
|
|
503
139
|
}) => Promise<Array<MakeRouteMatch>>;
|
|
504
|
-
invalidate: <
|
|
505
|
-
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
506
|
-
sync?: boolean;
|
|
507
|
-
}) => Promise<void>;
|
|
140
|
+
invalidate: InvalidateFn<this>;
|
|
508
141
|
resolveRedirect: (err: AnyRedirect) => ResolvedRedirect;
|
|
509
|
-
clearCache: <
|
|
510
|
-
filter?: (d: MakeRouteMatchUnion<TRouter>) => boolean;
|
|
511
|
-
}) => void;
|
|
142
|
+
clearCache: ClearCacheFn<this>;
|
|
512
143
|
clearExpiredCache: () => void;
|
|
513
144
|
loadRouteChunk: (route: AnyRoute) => Promise<void[]>;
|
|
514
|
-
preloadRoute: <
|
|
515
|
-
matchRoute: <
|
|
145
|
+
preloadRoute: PreloadRouteFn<TRouteTree, TTrailingSlashOption, false, TRouterHistory>;
|
|
146
|
+
matchRoute: MatchRouteFn<TRouteTree, TTrailingSlashOption, false, TRouterHistory>;
|
|
516
147
|
ssr?: {
|
|
517
148
|
manifest: Manifest | undefined;
|
|
518
149
|
serializer: StartSerializer;
|
|
@@ -544,4 +175,3 @@ export declare class SearchParamError extends Error {
|
|
|
544
175
|
export declare class PathParamError extends Error {
|
|
545
176
|
}
|
|
546
177
|
export declare function getInitialRouterState(location: ParsedLocation): RouterState<any>;
|
|
547
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routerContext.cjs","sources":["../../src/routerContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouter
|
|
1
|
+
{"version":3,"file":"routerContext.cjs","sources":["../../src/routerContext.tsx"],"sourcesContent":["import * as Solid from 'solid-js'\nimport type { AnyRouter } from '@tanstack/router-core'\n\ndeclare global {\n interface Window {\n __TSR_ROUTER_CONTEXT__?: Solid.Context<AnyRouter>\n }\n}\n\nconst routerContext = Solid.createContext<AnyRouter>(\n null as unknown as AnyRouter,\n)\n\nexport function getRouterContext() {\n if (typeof document === 'undefined') {\n return routerContext\n }\n\n if (window.__TSR_ROUTER_CONTEXT__) {\n return window.__TSR_ROUTER_CONTEXT__\n }\n\n window.__TSR_ROUTER_CONTEXT__ = routerContext as any\n\n return routerContext\n}\n"],"names":["routerContext","Solid","createContext","getRouterContext","document","window","__TSR_ROUTER_CONTEXT__"],"mappings":";;;;;;;;;;;;;;;;;;;;AASA,MAAMA,gBAAgBC,iBAAMC,cAC1B,IACF;AAEO,SAASC,mBAAmB;AAC7B,MAAA,OAAOC,aAAa,aAAa;AAC5BJ,WAAAA;AAAAA,EAAAA;AAGT,MAAIK,OAAOC,wBAAwB;AACjC,WAAOD,OAAOC;AAAAA,EAAAA;AAGhBD,SAAOC,yBAAyBN;AAEzBA,SAAAA;AACT;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnyRouter
|
|
1
|
+
import { AnyRouter } from '@tanstack/router-core';
|
|
2
2
|
import * as Solid from 'solid-js';
|
|
3
3
|
declare global {
|
|
4
4
|
interface Window {
|
|
5
5
|
__TSR_ROUTER_CONTEXT__?: Solid.Context<AnyRouter>;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
export declare function getRouterContext(): Solid.Context<AnyRouter
|
|
8
|
+
export declare function getRouterContext(): Solid.Context<AnyRouter>;
|