@tanstack/solid-router 1.121.19 → 1.121.21
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/Asset.cjs +49 -0
- package/dist/cjs/Asset.cjs.map +1 -0
- package/dist/cjs/Asset.d.cts +2 -0
- package/dist/cjs/CatchBoundary.cjs +92 -0
- package/dist/cjs/CatchBoundary.cjs.map +1 -0
- package/dist/cjs/CatchBoundary.d.cts +11 -0
- package/dist/cjs/ClientOnly.cjs +36 -0
- package/dist/cjs/ClientOnly.cjs.map +1 -0
- package/dist/cjs/ClientOnly.d.cts +49 -0
- package/dist/cjs/HeadContent.cjs +146 -0
- package/dist/cjs/HeadContent.cjs.map +1 -0
- package/dist/cjs/HeadContent.d.cts +8 -0
- package/dist/cjs/Match.cjs +359 -0
- package/dist/cjs/Match.cjs.map +1 -0
- package/dist/cjs/Match.d.cts +8 -0
- package/dist/cjs/Matches.cjs +152 -0
- package/dist/cjs/Matches.cjs.map +1 -0
- package/dist/cjs/Matches.d.cts +24 -0
- package/dist/cjs/RouterProvider.cjs +45 -0
- package/dist/cjs/RouterProvider.cjs.map +1 -0
- package/dist/cjs/RouterProvider.d.cts +10 -0
- package/dist/cjs/SafeFragment.cjs +8 -0
- package/dist/cjs/SafeFragment.cjs.map +1 -0
- package/dist/cjs/SafeFragment.d.cts +1 -0
- package/dist/cjs/ScriptOnce.cjs +23 -0
- package/dist/cjs/ScriptOnce.cjs.map +1 -0
- package/dist/cjs/ScriptOnce.d.cts +5 -0
- package/dist/cjs/Scripts.cjs +48 -0
- package/dist/cjs/Scripts.cjs.map +1 -0
- package/dist/cjs/Scripts.d.cts +1 -0
- package/dist/cjs/ScrollRestoration.cjs +37 -0
- package/dist/cjs/ScrollRestoration.cjs.map +1 -0
- package/dist/cjs/ScrollRestoration.d.cts +14 -0
- package/dist/cjs/Transitioner.cjs +124 -0
- package/dist/cjs/Transitioner.cjs.map +1 -0
- package/dist/cjs/Transitioner.d.cts +1 -0
- package/dist/cjs/awaited.cjs +49 -0
- package/dist/cjs/awaited.cjs.map +1 -0
- package/dist/cjs/awaited.d.cts +11 -0
- package/dist/cjs/fileRoute.cjs +103 -0
- package/dist/cjs/fileRoute.cjs.map +1 -0
- package/dist/cjs/fileRoute.d.cts +54 -0
- package/dist/cjs/history.d.cts +8 -0
- package/dist/cjs/index.cjs +289 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +52 -0
- package/dist/cjs/lazyRouteComponent.cjs +73 -0
- package/dist/cjs/lazyRouteComponent.cjs.map +1 -0
- package/dist/cjs/lazyRouteComponent.d.cts +2 -0
- package/dist/cjs/link.cjs +287 -0
- package/dist/cjs/link.cjs.map +1 -0
- package/dist/cjs/link.d.cts +44 -0
- package/dist/cjs/matchContext.cjs +25 -0
- package/dist/cjs/matchContext.cjs.map +1 -0
- package/dist/cjs/matchContext.d.cts +3 -0
- package/dist/cjs/not-found.cjs +42 -0
- package/dist/cjs/not-found.cjs.map +1 -0
- package/dist/cjs/not-found.d.cts +8 -0
- package/dist/cjs/renderRouteNotFound.cjs +23 -0
- package/dist/cjs/renderRouteNotFound.cjs.map +1 -0
- package/dist/cjs/renderRouteNotFound.d.cts +2 -0
- package/dist/cjs/route.cjs +236 -0
- package/dist/cjs/route.cjs.map +1 -0
- package/dist/cjs/route.d.cts +95 -0
- package/dist/cjs/router.cjs +22 -0
- package/dist/cjs/router.cjs.map +1 -0
- package/dist/cjs/router.d.cts +69 -0
- package/dist/cjs/routerContext.cjs +33 -0
- package/dist/cjs/routerContext.cjs.map +1 -0
- package/dist/cjs/routerContext.d.cts +8 -0
- package/dist/cjs/scroll-restoration.cjs +23 -0
- package/dist/cjs/scroll-restoration.cjs.map +1 -0
- package/dist/cjs/scroll-restoration.d.cts +1 -0
- package/dist/cjs/typePrimitives.d.cts +10 -0
- package/dist/cjs/useBlocker.cjs +171 -0
- package/dist/cjs/useBlocker.cjs.map +1 -0
- package/dist/cjs/useBlocker.d.cts +67 -0
- package/dist/cjs/useCanGoBack.cjs +8 -0
- package/dist/cjs/useCanGoBack.cjs.map +1 -0
- package/dist/cjs/useCanGoBack.d.cts +1 -0
- package/dist/cjs/useLoaderData.cjs +14 -0
- package/dist/cjs/useLoaderData.cjs.map +1 -0
- package/dist/cjs/useLoaderData.d.cts +8 -0
- package/dist/cjs/useLoaderDeps.cjs +17 -0
- package/dist/cjs/useLoaderDeps.cjs.map +1 -0
- package/dist/cjs/useLoaderDeps.d.cts +7 -0
- package/dist/cjs/useLocation.cjs +10 -0
- package/dist/cjs/useLocation.cjs.map +1 -0
- package/dist/cjs/useLocation.d.cts +7 -0
- package/dist/cjs/useMatch.cjs +39 -0
- package/dist/cjs/useMatch.cjs.map +1 -0
- package/dist/cjs/useMatch.d.cts +10 -0
- package/dist/cjs/useNavigate.cjs +46 -0
- package/dist/cjs/useNavigate.cjs.map +1 -0
- package/dist/cjs/useNavigate.d.cts +5 -0
- package/dist/cjs/useParams.cjs +15 -0
- package/dist/cjs/useParams.cjs.map +1 -0
- package/dist/cjs/useParams.d.cts +9 -0
- package/dist/cjs/useRouteContext.cjs +11 -0
- package/dist/cjs/useRouteContext.cjs.map +1 -0
- package/dist/cjs/useRouteContext.d.cts +4 -0
- package/dist/cjs/useRouter.cjs +29 -0
- package/dist/cjs/useRouter.cjs.map +1 -0
- package/dist/cjs/useRouter.d.cts +4 -0
- package/dist/cjs/useRouterState.cjs +16 -0
- package/dist/cjs/useRouterState.cjs.map +1 -0
- package/dist/cjs/useRouterState.d.cts +8 -0
- package/dist/cjs/useSearch.cjs +15 -0
- package/dist/cjs/useSearch.cjs.map +1 -0
- package/dist/cjs/useSearch.d.cts +9 -0
- package/dist/cjs/utils.cjs +58 -0
- package/dist/cjs/utils.cjs.map +1 -0
- package/dist/cjs/utils.d.cts +34 -0
- package/dist/esm/Asset.d.ts +2 -0
- package/dist/esm/Asset.js +49 -0
- package/dist/esm/Asset.js.map +1 -0
- package/dist/esm/CatchBoundary.d.ts +11 -0
- package/dist/esm/CatchBoundary.js +75 -0
- package/dist/esm/CatchBoundary.js.map +1 -0
- package/dist/esm/ClientOnly.d.ts +49 -0
- package/dist/esm/ClientOnly.js +19 -0
- package/dist/esm/ClientOnly.js.map +1 -0
- package/dist/esm/HeadContent.d.ts +8 -0
- package/dist/esm/HeadContent.js +129 -0
- package/dist/esm/HeadContent.js.map +1 -0
- package/dist/esm/Match.d.ts +8 -0
- package/dist/esm/Match.js +342 -0
- package/dist/esm/Match.js.map +1 -0
- package/dist/esm/Matches.d.ts +24 -0
- package/dist/esm/Matches.js +135 -0
- package/dist/esm/Matches.js.map +1 -0
- package/dist/esm/RouterProvider.d.ts +10 -0
- package/dist/esm/RouterProvider.js +45 -0
- package/dist/esm/RouterProvider.js.map +1 -0
- package/dist/esm/SafeFragment.d.ts +1 -0
- package/dist/esm/SafeFragment.js +8 -0
- package/dist/esm/SafeFragment.js.map +1 -0
- package/dist/esm/ScriptOnce.d.ts +5 -0
- package/dist/esm/ScriptOnce.js +23 -0
- package/dist/esm/ScriptOnce.js.map +1 -0
- package/dist/esm/Scripts.d.ts +1 -0
- package/dist/esm/Scripts.js +48 -0
- package/dist/esm/Scripts.js.map +1 -0
- package/dist/esm/ScrollRestoration.d.ts +14 -0
- package/dist/esm/ScrollRestoration.js +37 -0
- package/dist/esm/ScrollRestoration.js.map +1 -0
- package/dist/esm/Transitioner.d.ts +1 -0
- package/dist/esm/Transitioner.js +107 -0
- package/dist/esm/Transitioner.js.map +1 -0
- package/dist/esm/awaited.d.ts +11 -0
- package/dist/esm/awaited.js +32 -0
- package/dist/esm/awaited.js.map +1 -0
- package/dist/esm/fileRoute.d.ts +54 -0
- package/dist/esm/fileRoute.js +103 -0
- package/dist/esm/fileRoute.js.map +1 -0
- package/dist/esm/history.d.ts +8 -0
- package/dist/esm/index.d.ts +52 -0
- package/dist/esm/index.js +151 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lazyRouteComponent.d.ts +2 -0
- package/dist/esm/lazyRouteComponent.js +73 -0
- package/dist/esm/lazyRouteComponent.js.map +1 -0
- package/dist/esm/link.d.ts +44 -0
- package/dist/esm/link.js +270 -0
- package/dist/esm/link.js.map +1 -0
- package/dist/esm/matchContext.d.ts +3 -0
- package/dist/esm/matchContext.js +8 -0
- package/dist/esm/matchContext.js.map +1 -0
- package/dist/esm/not-found.d.ts +8 -0
- package/dist/esm/not-found.js +42 -0
- package/dist/esm/not-found.js.map +1 -0
- package/dist/esm/renderRouteNotFound.d.ts +2 -0
- package/dist/esm/renderRouteNotFound.js +23 -0
- package/dist/esm/renderRouteNotFound.js.map +1 -0
- package/dist/esm/route.d.ts +95 -0
- package/dist/esm/route.js +236 -0
- package/dist/esm/route.js.map +1 -0
- package/dist/esm/router.d.ts +69 -0
- package/dist/esm/router.js +22 -0
- package/dist/esm/router.js.map +1 -0
- package/dist/esm/routerContext.d.ts +8 -0
- package/dist/esm/routerContext.js +16 -0
- package/dist/esm/routerContext.js.map +1 -0
- package/dist/esm/scroll-restoration.d.ts +1 -0
- package/dist/esm/scroll-restoration.js +23 -0
- package/dist/esm/scroll-restoration.js.map +1 -0
- package/dist/esm/typePrimitives.d.ts +10 -0
- package/dist/esm/useBlocker.d.ts +67 -0
- package/dist/esm/useBlocker.js +154 -0
- package/dist/esm/useBlocker.js.map +1 -0
- package/dist/esm/useCanGoBack.d.ts +1 -0
- package/dist/esm/useCanGoBack.js +8 -0
- package/dist/esm/useCanGoBack.js.map +1 -0
- package/dist/esm/useLoaderData.d.ts +8 -0
- package/dist/esm/useLoaderData.js +14 -0
- package/dist/esm/useLoaderData.js.map +1 -0
- package/dist/esm/useLoaderDeps.d.ts +7 -0
- package/dist/esm/useLoaderDeps.js +17 -0
- package/dist/esm/useLoaderDeps.js.map +1 -0
- package/dist/esm/useLocation.d.ts +7 -0
- package/dist/esm/useLocation.js +10 -0
- package/dist/esm/useLocation.js.map +1 -0
- package/dist/esm/useMatch.d.ts +10 -0
- package/dist/esm/useMatch.js +22 -0
- package/dist/esm/useMatch.js.map +1 -0
- package/dist/esm/useNavigate.d.ts +5 -0
- package/dist/esm/useNavigate.js +29 -0
- package/dist/esm/useNavigate.js.map +1 -0
- package/dist/esm/useParams.d.ts +9 -0
- package/dist/esm/useParams.js +15 -0
- package/dist/esm/useParams.js.map +1 -0
- package/dist/esm/useRouteContext.d.ts +4 -0
- package/dist/esm/useRouteContext.js +11 -0
- package/dist/esm/useRouteContext.js.map +1 -0
- package/dist/esm/useRouter.d.ts +4 -0
- package/dist/esm/useRouter.js +12 -0
- package/dist/esm/useRouter.js.map +1 -0
- package/dist/esm/useRouterState.d.ts +8 -0
- package/dist/esm/useRouterState.js +16 -0
- package/dist/esm/useRouterState.js.map +1 -0
- package/dist/esm/useSearch.d.ts +9 -0
- package/dist/esm/useSearch.js +15 -0
- package/dist/esm/useSearch.js.map +1 -0
- package/dist/esm/utils.d.ts +34 -0
- package/dist/esm/utils.js +41 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/source/Asset.d.ts +2 -0
- package/dist/source/Asset.jsx +23 -0
- package/dist/source/Asset.jsx.map +1 -0
- package/dist/source/CatchBoundary.d.ts +11 -0
- package/dist/source/CatchBoundary.jsx +43 -0
- package/dist/source/CatchBoundary.jsx.map +1 -0
- package/dist/source/ClientOnly.d.ts +49 -0
- package/dist/source/ClientOnly.jsx +51 -0
- package/dist/source/ClientOnly.jsx.map +1 -0
- package/dist/source/HeadContent.d.ts +8 -0
- package/dist/source/HeadContent.jsx +143 -0
- package/dist/source/HeadContent.jsx.map +1 -0
- package/dist/source/Match.d.ts +8 -0
- package/dist/source/Match.jsx +261 -0
- package/dist/source/Match.jsx.map +1 -0
- package/dist/source/Matches.d.ts +24 -0
- package/dist/source/Matches.jsx +104 -0
- package/dist/source/Matches.jsx.map +1 -0
- package/dist/source/RouterProvider.d.ts +10 -0
- package/dist/source/RouterProvider.jsx +27 -0
- package/dist/source/RouterProvider.jsx.map +1 -0
- package/dist/source/SafeFragment.d.ts +1 -0
- package/dist/source/SafeFragment.jsx +4 -0
- package/dist/source/SafeFragment.jsx.map +1 -0
- package/dist/source/ScriptOnce.d.ts +5 -0
- package/dist/source/ScriptOnce.jsx +17 -0
- package/dist/source/ScriptOnce.jsx.map +1 -0
- package/dist/source/Scripts.d.ts +1 -0
- package/dist/source/Scripts.jsx +49 -0
- package/dist/source/Scripts.jsx.map +1 -0
- package/dist/source/ScrollRestoration.d.ts +14 -0
- package/dist/source/ScrollRestoration.jsx +37 -0
- package/dist/source/ScrollRestoration.jsx.map +1 -0
- package/dist/source/Transitioner.d.ts +1 -0
- package/dist/source/Transitioner.jsx +102 -0
- package/dist/source/Transitioner.jsx.map +1 -0
- package/dist/source/awaited.d.ts +11 -0
- package/dist/source/awaited.jsx +19 -0
- package/dist/source/awaited.jsx.map +1 -0
- package/dist/source/fileRoute.d.ts +54 -0
- package/dist/source/fileRoute.js +98 -0
- package/dist/source/fileRoute.js.map +1 -0
- package/dist/source/history.d.ts +8 -0
- package/dist/source/history.js +2 -0
- package/dist/source/history.js.map +1 -0
- package/dist/source/index.d.ts +52 -0
- package/dist/source/index.jsx +43 -0
- package/dist/source/index.jsx.map +1 -0
- package/dist/source/lazyRouteComponent.d.ts +2 -0
- package/dist/source/lazyRouteComponent.jsx +83 -0
- package/dist/source/lazyRouteComponent.jsx.map +1 -0
- package/dist/source/link.d.ts +44 -0
- package/dist/source/link.jsx +338 -0
- package/dist/source/link.jsx.map +1 -0
- package/dist/source/matchContext.d.ts +3 -0
- package/dist/source/matchContext.jsx +5 -0
- package/dist/source/matchContext.jsx.map +1 -0
- package/dist/source/not-found.d.ts +8 -0
- package/dist/source/not-found.jsx +30 -0
- package/dist/source/not-found.jsx.map +1 -0
- package/dist/source/renderRouteNotFound.d.ts +2 -0
- package/dist/source/renderRouteNotFound.jsx +15 -0
- package/dist/source/renderRouteNotFound.jsx.map +1 -0
- package/dist/source/route.d.ts +96 -0
- package/dist/source/route.jsx +179 -0
- package/dist/source/route.jsx.map +1 -0
- package/dist/source/router.d.ts +70 -0
- package/dist/source/router.js +21 -0
- package/dist/source/router.js.map +1 -0
- package/dist/source/routerContext.d.ts +8 -0
- package/dist/source/routerContext.jsx +13 -0
- package/dist/source/routerContext.jsx.map +1 -0
- package/dist/source/scroll-restoration.d.ts +1 -0
- package/dist/source/scroll-restoration.jsx +16 -0
- package/dist/source/scroll-restoration.jsx.map +1 -0
- package/dist/source/typePrimitives.d.ts +10 -0
- package/dist/source/typePrimitives.js +2 -0
- package/dist/source/typePrimitives.js.map +1 -0
- package/dist/source/useBlocker.d.ts +67 -0
- package/dist/source/useBlocker.jsx +153 -0
- package/dist/source/useBlocker.jsx.map +1 -0
- package/dist/source/useCanGoBack.d.ts +1 -0
- package/dist/source/useCanGoBack.js +5 -0
- package/dist/source/useCanGoBack.js.map +1 -0
- package/dist/source/useLoaderData.d.ts +8 -0
- package/dist/source/useLoaderData.jsx +11 -0
- package/dist/source/useLoaderData.jsx.map +1 -0
- package/dist/source/useLoaderDeps.d.ts +7 -0
- package/dist/source/useLoaderDeps.jsx +11 -0
- package/dist/source/useLoaderDeps.jsx.map +1 -0
- package/dist/source/useLocation.d.ts +7 -0
- package/dist/source/useLocation.jsx +7 -0
- package/dist/source/useLocation.jsx.map +1 -0
- package/dist/source/useMatch.d.ts +10 -0
- package/dist/source/useMatch.jsx +19 -0
- package/dist/source/useMatch.jsx.map +1 -0
- package/dist/source/useNavigate.d.ts +5 -0
- package/dist/source/useNavigate.jsx +18 -0
- package/dist/source/useNavigate.jsx.map +1 -0
- package/dist/source/useParams.d.ts +9 -0
- package/dist/source/useParams.jsx +12 -0
- package/dist/source/useParams.jsx.map +1 -0
- package/dist/source/useRouteContext.d.ts +4 -0
- package/dist/source/useRouteContext.js +8 -0
- package/dist/source/useRouteContext.js.map +1 -0
- package/dist/source/useRouter.d.ts +4 -0
- package/dist/source/useRouter.jsx +9 -0
- package/dist/source/useRouter.jsx.map +1 -0
- package/dist/source/useRouterState.d.ts +8 -0
- package/dist/source/useRouterState.jsx +14 -0
- package/dist/source/useRouterState.jsx.map +1 -0
- package/dist/source/useSearch.d.ts +9 -0
- package/dist/source/useSearch.jsx +12 -0
- package/dist/source/useSearch.jsx.map +1 -0
- package/dist/source/utils.d.ts +34 -0
- package/dist/source/utils.js +59 -0
- package/dist/source/utils.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { UseParamsRoute } from './useParams.cjs';
|
|
2
|
+
import { UseMatchRoute } from './useMatch.cjs';
|
|
3
|
+
import { UseSearchRoute } from './useSearch.cjs';
|
|
4
|
+
import { AnyContext, AnyRoute, AnyRouter, Constrain, ConstrainLiteral, FileBaseRouteOptions, FileRoutesByPath, LazyRouteOptions, RegisteredRouter, ResolveParams, Route, RouteById, RouteConstraints, RouteIds, RouteLoaderFn, UpdatableRouteOptions, UseNavigateResult } from '@tanstack/router-core';
|
|
5
|
+
import { UseLoaderDepsRoute } from './useLoaderDeps.cjs';
|
|
6
|
+
import { UseLoaderDataRoute } from './useLoaderData.cjs';
|
|
7
|
+
import { UseRouteContextRoute } from './useRouteContext.cjs';
|
|
8
|
+
export declare function createFileRoute<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'], TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'], TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'], TFullPath extends RouteConstraints['TFullPath'] = FileRoutesByPath[TFilePath]['fullPath']>(path?: TFilePath): FileRoute<TFilePath, TParentRoute, TId, TPath, TFullPath>['createRoute'];
|
|
9
|
+
/**
|
|
10
|
+
@deprecated It's no longer recommended to use the `FileRoute` class directly.
|
|
11
|
+
Instead, use `createFileRoute('/path/to/file')(options)` to create a file route.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FileRoute<TFilePath extends keyof FileRoutesByPath, TParentRoute extends AnyRoute = FileRoutesByPath[TFilePath]['parentRoute'], TId extends RouteConstraints['TId'] = FileRoutesByPath[TFilePath]['id'], TPath extends RouteConstraints['TPath'] = FileRoutesByPath[TFilePath]['path'], TFullPath extends RouteConstraints['TFullPath'] = FileRoutesByPath[TFilePath]['fullPath']> {
|
|
14
|
+
path?: TFilePath | undefined;
|
|
15
|
+
silent?: boolean;
|
|
16
|
+
constructor(path?: TFilePath | undefined, _opts?: {
|
|
17
|
+
silent: boolean;
|
|
18
|
+
});
|
|
19
|
+
createRoute: <TSearchValidator = undefined, TParams = ResolveParams<TPath>, TRouteContextFn = AnyContext, TBeforeLoadFn = AnyContext, TLoaderDeps extends Record<string, any> = {}, TLoaderFn = undefined, TChildren = unknown>(options?: FileBaseRouteOptions<TParentRoute, TId, TPath, TSearchValidator, TParams, TLoaderDeps, TLoaderFn, AnyContext, TRouteContextFn, TBeforeLoadFn> & UpdatableRouteOptions<TParentRoute, TId, TFullPath, TParams, TSearchValidator, TLoaderFn, TLoaderDeps, AnyContext, TRouteContextFn, TBeforeLoadFn>) => Route<TParentRoute, TPath, TFullPath, TFilePath, TId, TSearchValidator, TParams, AnyContext, TRouteContextFn, TBeforeLoadFn, TLoaderDeps, TLoaderFn, TChildren, unknown>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
@deprecated It's recommended not to split loaders into separate files.
|
|
23
|
+
Instead, place the loader function in the the main route file, inside the
|
|
24
|
+
`createFileRoute('/path/to/file)(options)` options.
|
|
25
|
+
*/
|
|
26
|
+
export declare function FileRouteLoader<TFilePath extends keyof FileRoutesByPath, TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute']>(_path: TFilePath): <TLoaderFn>(loaderFn: Constrain<TLoaderFn, RouteLoaderFn<TRoute['parentRoute'], TRoute['types']['id'], TRoute['types']['params'], TRoute['types']['loaderDeps'], TRoute['types']['routerContext'], TRoute['types']['routeContextFn'], TRoute['types']['beforeLoadFn']>>) => TLoaderFn;
|
|
27
|
+
declare module '@tanstack/router-core' {
|
|
28
|
+
interface LazyRoute<in out TRoute extends AnyRoute> {
|
|
29
|
+
useMatch: UseMatchRoute<TRoute['id']>;
|
|
30
|
+
useRouteContext: UseRouteContextRoute<TRoute['id']>;
|
|
31
|
+
useSearch: UseSearchRoute<TRoute['id']>;
|
|
32
|
+
useParams: UseParamsRoute<TRoute['id']>;
|
|
33
|
+
useLoaderDeps: UseLoaderDepsRoute<TRoute['id']>;
|
|
34
|
+
useLoaderData: UseLoaderDataRoute<TRoute['id']>;
|
|
35
|
+
useNavigate: () => UseNavigateResult<TRoute['fullPath']>;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export declare class LazyRoute<TRoute extends AnyRoute> {
|
|
39
|
+
options: {
|
|
40
|
+
id: string;
|
|
41
|
+
} & LazyRouteOptions;
|
|
42
|
+
constructor(opts: {
|
|
43
|
+
id: string;
|
|
44
|
+
} & LazyRouteOptions);
|
|
45
|
+
useMatch: UseMatchRoute<TRoute['id']>;
|
|
46
|
+
useRouteContext: UseRouteContextRoute<TRoute['id']>;
|
|
47
|
+
useSearch: UseSearchRoute<TRoute['id']>;
|
|
48
|
+
useParams: UseParamsRoute<TRoute['id']>;
|
|
49
|
+
useLoaderDeps: UseLoaderDepsRoute<TRoute['id']>;
|
|
50
|
+
useLoaderData: UseLoaderDataRoute<TRoute['id']>;
|
|
51
|
+
useNavigate: () => UseNavigateResult<TRoute["fullPath"]>;
|
|
52
|
+
}
|
|
53
|
+
export declare function createLazyRoute<TRouter extends AnyRouter = RegisteredRouter, TId extends string = string, TRoute extends AnyRoute = RouteById<TRouter['routeTree'], TId>>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>): (opts: LazyRouteOptions) => LazyRoute<TRoute>;
|
|
54
|
+
export declare function createLazyFileRoute<TFilePath extends keyof FileRoutesByPath, TRoute extends FileRoutesByPath[TFilePath]['preLoaderRoute']>(id: TFilePath): (opts: LazyRouteOptions) => LazyRoute<TRoute>;
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const invariant = require("tiny-invariant");
|
|
4
|
+
const warning = require("tiny-warning");
|
|
5
|
+
const routerCore = require("@tanstack/router-core");
|
|
6
|
+
const history = require("@tanstack/history");
|
|
7
|
+
const awaited = require("./awaited.cjs");
|
|
8
|
+
const CatchBoundary = require("./CatchBoundary.cjs");
|
|
9
|
+
const ClientOnly = require("./ClientOnly.cjs");
|
|
10
|
+
const fileRoute = require("./fileRoute.cjs");
|
|
11
|
+
const lazyRouteComponent = require("./lazyRouteComponent.cjs");
|
|
12
|
+
const link = require("./link.cjs");
|
|
13
|
+
const Matches = require("./Matches.cjs");
|
|
14
|
+
const matchContext = require("./matchContext.cjs");
|
|
15
|
+
const Match = require("./Match.cjs");
|
|
16
|
+
const useMatch = require("./useMatch.cjs");
|
|
17
|
+
const useLoaderDeps = require("./useLoaderDeps.cjs");
|
|
18
|
+
const useLoaderData = require("./useLoaderData.cjs");
|
|
19
|
+
const route = require("./route.cjs");
|
|
20
|
+
const router = require("./router.cjs");
|
|
21
|
+
const RouterProvider = require("./RouterProvider.cjs");
|
|
22
|
+
const ScrollRestoration = require("./ScrollRestoration.cjs");
|
|
23
|
+
const useBlocker = require("./useBlocker.cjs");
|
|
24
|
+
const useNavigate = require("./useNavigate.cjs");
|
|
25
|
+
const useParams = require("./useParams.cjs");
|
|
26
|
+
const useSearch = require("./useSearch.cjs");
|
|
27
|
+
const routerContext = require("./routerContext.cjs");
|
|
28
|
+
const useRouteContext = require("./useRouteContext.cjs");
|
|
29
|
+
const useRouter = require("./useRouter.cjs");
|
|
30
|
+
const useRouterState = require("./useRouterState.cjs");
|
|
31
|
+
const useLocation = require("./useLocation.cjs");
|
|
32
|
+
const useCanGoBack = require("./useCanGoBack.cjs");
|
|
33
|
+
const utils = require("./utils.cjs");
|
|
34
|
+
const notFound = require("./not-found.cjs");
|
|
35
|
+
const ScriptOnce = require("./ScriptOnce.cjs");
|
|
36
|
+
const Asset = require("./Asset.cjs");
|
|
37
|
+
const HeadContent = require("./HeadContent.cjs");
|
|
38
|
+
const Scripts = require("./Scripts.cjs");
|
|
39
|
+
exports.invariant = invariant;
|
|
40
|
+
exports.warning = warning;
|
|
41
|
+
Object.defineProperty(exports, "PathParamError", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: () => routerCore.PathParamError
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "SearchParamError", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: () => routerCore.SearchParamError
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(exports, "TSR_DEFERRED_PROMISE", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: () => routerCore.TSR_DEFERRED_PROMISE
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(exports, "cleanPath", {
|
|
54
|
+
enumerable: true,
|
|
55
|
+
get: () => routerCore.cleanPath
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "componentTypes", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: () => routerCore.componentTypes
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "createControlledPromise", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: () => routerCore.createControlledPromise
|
|
64
|
+
});
|
|
65
|
+
Object.defineProperty(exports, "decode", {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: () => routerCore.decode
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "deepEqual", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: () => routerCore.deepEqual
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(exports, "defaultParseSearch", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
get: () => routerCore.defaultParseSearch
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "defaultSerializeError", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: () => routerCore.defaultSerializeError
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "defaultStringifySearch", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: () => routerCore.defaultStringifySearch
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(exports, "defer", {
|
|
86
|
+
enumerable: true,
|
|
87
|
+
get: () => routerCore.defer
|
|
88
|
+
});
|
|
89
|
+
Object.defineProperty(exports, "encode", {
|
|
90
|
+
enumerable: true,
|
|
91
|
+
get: () => routerCore.encode
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "escapeJSON", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: () => routerCore.escapeJSON
|
|
96
|
+
});
|
|
97
|
+
Object.defineProperty(exports, "functionalUpdate", {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: () => routerCore.functionalUpdate
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(exports, "getInitialRouterState", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: () => routerCore.getInitialRouterState
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, "interpolatePath", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: () => routerCore.interpolatePath
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(exports, "isMatch", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: () => routerCore.isMatch
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(exports, "isNotFound", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
get: () => routerCore.isNotFound
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, "isPlainArray", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: () => routerCore.isPlainArray
|
|
120
|
+
});
|
|
121
|
+
Object.defineProperty(exports, "isPlainObject", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
get: () => routerCore.isPlainObject
|
|
124
|
+
});
|
|
125
|
+
Object.defineProperty(exports, "isRedirect", {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
get: () => routerCore.isRedirect
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(exports, "joinPaths", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: () => routerCore.joinPaths
|
|
132
|
+
});
|
|
133
|
+
Object.defineProperty(exports, "lazyFn", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
get: () => routerCore.lazyFn
|
|
136
|
+
});
|
|
137
|
+
Object.defineProperty(exports, "matchByPath", {
|
|
138
|
+
enumerable: true,
|
|
139
|
+
get: () => routerCore.matchByPath
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(exports, "matchPathname", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
get: () => routerCore.matchPathname
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(exports, "notFound", {
|
|
146
|
+
enumerable: true,
|
|
147
|
+
get: () => routerCore.notFound
|
|
148
|
+
});
|
|
149
|
+
Object.defineProperty(exports, "parsePathname", {
|
|
150
|
+
enumerable: true,
|
|
151
|
+
get: () => routerCore.parsePathname
|
|
152
|
+
});
|
|
153
|
+
Object.defineProperty(exports, "parseSearchWith", {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
get: () => routerCore.parseSearchWith
|
|
156
|
+
});
|
|
157
|
+
Object.defineProperty(exports, "pick", {
|
|
158
|
+
enumerable: true,
|
|
159
|
+
get: () => routerCore.pick
|
|
160
|
+
});
|
|
161
|
+
Object.defineProperty(exports, "redirect", {
|
|
162
|
+
enumerable: true,
|
|
163
|
+
get: () => routerCore.redirect
|
|
164
|
+
});
|
|
165
|
+
Object.defineProperty(exports, "removeBasepath", {
|
|
166
|
+
enumerable: true,
|
|
167
|
+
get: () => routerCore.removeBasepath
|
|
168
|
+
});
|
|
169
|
+
Object.defineProperty(exports, "replaceEqualDeep", {
|
|
170
|
+
enumerable: true,
|
|
171
|
+
get: () => routerCore.replaceEqualDeep
|
|
172
|
+
});
|
|
173
|
+
Object.defineProperty(exports, "resolvePath", {
|
|
174
|
+
enumerable: true,
|
|
175
|
+
get: () => routerCore.resolvePath
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(exports, "retainSearchParams", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: () => routerCore.retainSearchParams
|
|
180
|
+
});
|
|
181
|
+
Object.defineProperty(exports, "rootRouteId", {
|
|
182
|
+
enumerable: true,
|
|
183
|
+
get: () => routerCore.rootRouteId
|
|
184
|
+
});
|
|
185
|
+
Object.defineProperty(exports, "shallow", {
|
|
186
|
+
enumerable: true,
|
|
187
|
+
get: () => routerCore.shallow
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(exports, "stringifySearchWith", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: () => routerCore.stringifySearchWith
|
|
192
|
+
});
|
|
193
|
+
Object.defineProperty(exports, "stripSearchParams", {
|
|
194
|
+
enumerable: true,
|
|
195
|
+
get: () => routerCore.stripSearchParams
|
|
196
|
+
});
|
|
197
|
+
Object.defineProperty(exports, "trimPath", {
|
|
198
|
+
enumerable: true,
|
|
199
|
+
get: () => routerCore.trimPath
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(exports, "trimPathLeft", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: () => routerCore.trimPathLeft
|
|
204
|
+
});
|
|
205
|
+
Object.defineProperty(exports, "trimPathRight", {
|
|
206
|
+
enumerable: true,
|
|
207
|
+
get: () => routerCore.trimPathRight
|
|
208
|
+
});
|
|
209
|
+
Object.defineProperty(exports, "createBrowserHistory", {
|
|
210
|
+
enumerable: true,
|
|
211
|
+
get: () => history.createBrowserHistory
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(exports, "createHashHistory", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: () => history.createHashHistory
|
|
216
|
+
});
|
|
217
|
+
Object.defineProperty(exports, "createHistory", {
|
|
218
|
+
enumerable: true,
|
|
219
|
+
get: () => history.createHistory
|
|
220
|
+
});
|
|
221
|
+
Object.defineProperty(exports, "createMemoryHistory", {
|
|
222
|
+
enumerable: true,
|
|
223
|
+
get: () => history.createMemoryHistory
|
|
224
|
+
});
|
|
225
|
+
exports.Await = awaited.Await;
|
|
226
|
+
exports.useAwaited = awaited.useAwaited;
|
|
227
|
+
exports.CatchBoundary = CatchBoundary.CatchBoundary;
|
|
228
|
+
exports.ErrorComponent = CatchBoundary.ErrorComponent;
|
|
229
|
+
exports.ClientOnly = ClientOnly.ClientOnly;
|
|
230
|
+
exports.FileRoute = fileRoute.FileRoute;
|
|
231
|
+
exports.FileRouteLoader = fileRoute.FileRouteLoader;
|
|
232
|
+
exports.LazyRoute = fileRoute.LazyRoute;
|
|
233
|
+
exports.createFileRoute = fileRoute.createFileRoute;
|
|
234
|
+
exports.createLazyFileRoute = fileRoute.createLazyFileRoute;
|
|
235
|
+
exports.createLazyRoute = fileRoute.createLazyRoute;
|
|
236
|
+
exports.lazyRouteComponent = lazyRouteComponent.lazyRouteComponent;
|
|
237
|
+
exports.Link = link.Link;
|
|
238
|
+
exports.createLink = link.createLink;
|
|
239
|
+
exports.linkOptions = link.linkOptions;
|
|
240
|
+
exports.useLinkProps = link.useLinkProps;
|
|
241
|
+
exports.MatchRoute = Matches.MatchRoute;
|
|
242
|
+
exports.Matches = Matches.Matches;
|
|
243
|
+
exports.useChildMatches = Matches.useChildMatches;
|
|
244
|
+
exports.useMatchRoute = Matches.useMatchRoute;
|
|
245
|
+
exports.useMatches = Matches.useMatches;
|
|
246
|
+
exports.useParentMatches = Matches.useParentMatches;
|
|
247
|
+
exports.matchContext = matchContext.matchContext;
|
|
248
|
+
exports.Match = Match.Match;
|
|
249
|
+
exports.Outlet = Match.Outlet;
|
|
250
|
+
exports.useMatch = useMatch.useMatch;
|
|
251
|
+
exports.useLoaderDeps = useLoaderDeps.useLoaderDeps;
|
|
252
|
+
exports.useLoaderData = useLoaderData.useLoaderData;
|
|
253
|
+
exports.NotFoundRoute = route.NotFoundRoute;
|
|
254
|
+
exports.RootRoute = route.RootRoute;
|
|
255
|
+
exports.Route = route.Route;
|
|
256
|
+
exports.RouteApi = route.RouteApi;
|
|
257
|
+
exports.createRootRoute = route.createRootRoute;
|
|
258
|
+
exports.createRootRouteWithContext = route.createRootRouteWithContext;
|
|
259
|
+
exports.createRoute = route.createRoute;
|
|
260
|
+
exports.createRouteMask = route.createRouteMask;
|
|
261
|
+
exports.getRouteApi = route.getRouteApi;
|
|
262
|
+
exports.rootRouteWithContext = route.rootRouteWithContext;
|
|
263
|
+
exports.Router = router.Router;
|
|
264
|
+
exports.createRouter = router.createRouter;
|
|
265
|
+
exports.RouterContextProvider = RouterProvider.RouterContextProvider;
|
|
266
|
+
exports.RouterProvider = RouterProvider.RouterProvider;
|
|
267
|
+
exports.ScrollRestoration = ScrollRestoration.ScrollRestoration;
|
|
268
|
+
exports.useElementScrollRestoration = ScrollRestoration.useElementScrollRestoration;
|
|
269
|
+
exports.Block = useBlocker.Block;
|
|
270
|
+
exports.useBlocker = useBlocker.useBlocker;
|
|
271
|
+
exports.Navigate = useNavigate.Navigate;
|
|
272
|
+
exports.useNavigate = useNavigate.useNavigate;
|
|
273
|
+
exports.useParams = useParams.useParams;
|
|
274
|
+
exports.useSearch = useSearch.useSearch;
|
|
275
|
+
exports.getRouterContext = routerContext.getRouterContext;
|
|
276
|
+
exports.useRouteContext = useRouteContext.useRouteContext;
|
|
277
|
+
exports.useRouter = useRouter.useRouter;
|
|
278
|
+
exports.useRouterState = useRouterState.useRouterState;
|
|
279
|
+
exports.useLocation = useLocation.useLocation;
|
|
280
|
+
exports.useCanGoBack = useCanGoBack.useCanGoBack;
|
|
281
|
+
exports.useLayoutEffect = utils.useLayoutEffect;
|
|
282
|
+
exports.CatchNotFound = notFound.CatchNotFound;
|
|
283
|
+
exports.DefaultGlobalNotFound = notFound.DefaultGlobalNotFound;
|
|
284
|
+
exports.ScriptOnce = ScriptOnce.ScriptOnce;
|
|
285
|
+
exports.Asset = Asset.Asset;
|
|
286
|
+
exports.HeadContent = HeadContent.HeadContent;
|
|
287
|
+
exports.useTags = HeadContent.useTags;
|
|
288
|
+
exports.Scripts = Scripts.Scripts;
|
|
289
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { default as invariant } from 'tiny-invariant';
|
|
2
|
+
export { default as warning } from 'tiny-warning';
|
|
3
|
+
export { defer, TSR_DEFERRED_PROMISE, isMatch, joinPaths, cleanPath, trimPathLeft, trimPathRight, trimPath, resolvePath, parsePathname, interpolatePath, matchPathname, removeBasepath, matchByPath, encode, decode, rootRouteId, defaultSerializeError, defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, escapeJSON, // SSR
|
|
4
|
+
pick, functionalUpdate, replaceEqualDeep, isPlainObject, isPlainArray, deepEqual, shallow, createControlledPromise, retainSearchParams, stripSearchParams, } from '@tanstack/router-core';
|
|
5
|
+
export type { StartSerializer, Serializable, SerializerParse, SerializerParseBy, SerializerStringify, SerializerStringifyBy, DeferredPromiseState, DeferredPromise, ParsedLocation, RemoveTrailingSlashes, RemoveLeadingSlashes, ActiveOptions, Segment, ResolveRelativePath, RootRouteId, AnyPathParams, ResolveParams, ResolveOptionalParams, ResolveRequiredParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, UpdatableStaticRouteOption, MetaDescriptor, RouteLinkEntry, ParseParamsFn, SearchFilter, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, TrimPath, TrimPathLeft, TrimPathRight, StringifyParamsFn, ParamsOptions, InferAllParams, InferAllContext, LooseReturnType, LooseAsyncReturnType, ContextReturnType, ContextAsyncReturnType, ResolveLoaderData, ResolveRouteContext, SearchSerializer, SearchParser, TrailingSlashOption, ExtractedEntry, ExtractedStream, ExtractedPromise, StreamState, Manifest, RouterManagedTag, ControlledPromise, Constrain, Expand, MergeAll, Assign, IntersectAssign, ResolveValidatorInput, ResolveValidatorOutput, AnyValidator, DefaultValidator, ValidatorFn, AnySchema, AnyValidatorAdapter, AnyValidatorFn, AnyValidatorObj, ResolveValidatorInputFn, ResolveValidatorOutputFn, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, Validator, ValidatorAdapter, ValidatorObj, NavigateFn, BuildLocationFn, InferDescendantToPaths, RelativeToPath, RelativeToParentPath, RelativeToCurrentPath, Register, AbsoluteToPath, RelativeToPathAutoComplete, NavigateOptions, ToOptions, ToMaskOptions, ToSubOptions, ResolveRoute, SearchParamOptions, PathParamOptions, ToPathOption, LinkOptions, MakeOptionalPathParams, AnyRouterWithContext, ParseRoute, RoutesById, RouteById, RouteIds, RoutesByPath, RouteByPath, RoutePaths, FullSearchSchema, AllParams, AllLoaderData, FullSearchSchemaInput, AllContext, CommitLocationOptions, MatchLocation, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllParamsFromParent, RouteContextParameter, BeforeLoadContextParameter, ResolveAllContext, FullSearchSchemaOption, MakeRemountDepsOptionsUnion, RemountDepsOptions, FileRouteTypes, FileRoutesByPath, UseNavigateResult, AnyRedirect, Redirect, ResolvedRedirect, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, RouteMatch, AnyRouteMatch, RouteContextFn, RouteContextOptions, BeforeLoadFn, BeforeLoadContextOptions, ContextOptions, RootRouteOptions, AnyRouteWithContext, LazyRouteOptions, AnyRoute, ResolveFullPath, RouteConstraints, RouterState, ListenerFn, BuildNextOptions, AnyRouter, RegisteredRouter, RouterEvents, RouterEvent, RouterListener, MatchRouteOptions, RouteMask, RouterContextOptions, RouterOptions, RouterConstructorOptions, ControllablePromise, InjectedHtmlEntry, RouterErrorSerializer, SerializerExtensions, CreateFileRoute, CreateLazyFileRoute, } from '@tanstack/router-core';
|
|
6
|
+
export { createHistory, createBrowserHistory, createHashHistory, createMemoryHistory, } from '@tanstack/history';
|
|
7
|
+
export type { BlockerFn, HistoryLocation, RouterHistory, ParsedPath, HistoryState, } from '@tanstack/history';
|
|
8
|
+
export { useAwaited, Await } from './awaited.cjs';
|
|
9
|
+
export type { AwaitOptions } from './awaited.cjs';
|
|
10
|
+
export { CatchBoundary, ErrorComponent } from './CatchBoundary.cjs';
|
|
11
|
+
export { ClientOnly } from './ClientOnly.cjs';
|
|
12
|
+
export { FileRoute, createFileRoute, FileRouteLoader, LazyRoute, createLazyRoute, createLazyFileRoute, } from './fileRoute.cjs';
|
|
13
|
+
export * from './history.cjs';
|
|
14
|
+
export { lazyRouteComponent } from './lazyRouteComponent.cjs';
|
|
15
|
+
export { useLinkProps, createLink, Link, linkOptions } from './link.cjs';
|
|
16
|
+
export type { UseLinkPropsOptions, ActiveLinkOptions, LinkProps, LinkComponent, LinkComponentProps, CreateLinkProps, } from './link.cjs';
|
|
17
|
+
export { Matches, useMatchRoute, MatchRoute, useMatches, useParentMatches, useChildMatches, } from './Matches.cjs';
|
|
18
|
+
export type { UseMatchRouteOptions, MakeMatchRouteOptions } from './Matches.cjs';
|
|
19
|
+
export { matchContext } from './matchContext.cjs';
|
|
20
|
+
export { Match, Outlet } from './Match.cjs';
|
|
21
|
+
export { useMatch } from './useMatch.cjs';
|
|
22
|
+
export { useLoaderDeps } from './useLoaderDeps.cjs';
|
|
23
|
+
export { useLoaderData } from './useLoaderData.cjs';
|
|
24
|
+
export { redirect, isRedirect } from '@tanstack/router-core';
|
|
25
|
+
export { RouteApi, getRouteApi, Route, createRoute, RootRoute, rootRouteWithContext, createRootRoute, createRootRouteWithContext, createRouteMask, NotFoundRoute, } from './route.cjs';
|
|
26
|
+
export type { AnyRootRoute, SolidNode, SyncRouteComponent, AsyncRouteComponent, RouteComponent, ErrorRouteComponent, NotFoundRouteComponent, } from './route.cjs';
|
|
27
|
+
export { createRouter, Router } from './router.cjs';
|
|
28
|
+
export { componentTypes, lazyFn, SearchParamError, PathParamError, getInitialRouterState, } from '@tanstack/router-core';
|
|
29
|
+
export { RouterProvider, RouterContextProvider } from './RouterProvider.cjs';
|
|
30
|
+
export type { RouterProps } from './RouterProvider.cjs';
|
|
31
|
+
export { useElementScrollRestoration, ScrollRestoration, } from './ScrollRestoration.cjs';
|
|
32
|
+
export type { UseBlockerOpts, ShouldBlockFn } from './useBlocker.cjs';
|
|
33
|
+
export { useBlocker, Block } from './useBlocker.cjs';
|
|
34
|
+
export { useNavigate, Navigate } from './useNavigate.cjs';
|
|
35
|
+
export { useParams } from './useParams.cjs';
|
|
36
|
+
export { useSearch } from './useSearch.cjs';
|
|
37
|
+
export { getRouterContext, } from './routerContext.cjs';
|
|
38
|
+
export { useRouteContext } from './useRouteContext.cjs';
|
|
39
|
+
export { useRouter } from './useRouter.cjs';
|
|
40
|
+
export { useRouterState } from './useRouterState.cjs';
|
|
41
|
+
export { useLocation } from './useLocation.cjs';
|
|
42
|
+
export { useCanGoBack } from './useCanGoBack.cjs';
|
|
43
|
+
export { useLayoutEffect } from './utils.cjs';
|
|
44
|
+
export { CatchNotFound, DefaultGlobalNotFound } from './not-found.cjs';
|
|
45
|
+
export { notFound, isNotFound } from '@tanstack/router-core';
|
|
46
|
+
export type { NotFoundError } from '@tanstack/router-core';
|
|
47
|
+
export type { ValidateLinkOptions, ValidateUseSearchOptions, ValidateUseParamsOptions, ValidateLinkOptionsArray, } from './typePrimitives.cjs';
|
|
48
|
+
export type { ValidateFromPath, ValidateToPath, ValidateSearch, ValidateParams, InferFrom, InferTo, InferMaskTo, InferMaskFrom, ValidateNavigateOptions, ValidateNavigateOptionsArray, ValidateRedirectOptions, ValidateRedirectOptionsArray, ValidateId, InferStrict, InferShouldThrow, InferSelected, ValidateUseSearchResult, ValidateUseParamsResult, } from '@tanstack/router-core';
|
|
49
|
+
export { ScriptOnce } from './ScriptOnce.cjs';
|
|
50
|
+
export { Asset } from './Asset.cjs';
|
|
51
|
+
export { HeadContent, useTags } from './HeadContent.cjs';
|
|
52
|
+
export { Scripts } from './Scripts.cjs';
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const web = require("solid-js/web");
|
|
4
|
+
const Solid = require("solid-js");
|
|
5
|
+
const Match = require("./Match.cjs");
|
|
6
|
+
const ClientOnly = require("./ClientOnly.cjs");
|
|
7
|
+
function isModuleNotFoundError(error) {
|
|
8
|
+
return typeof (error == null ? void 0 : error.message) === "string" && /Failed to fetch dynamically imported module/.test(error.message);
|
|
9
|
+
}
|
|
10
|
+
function lazyRouteComponent(importer, exportName, ssr) {
|
|
11
|
+
let loadPromise;
|
|
12
|
+
let comp;
|
|
13
|
+
let error;
|
|
14
|
+
const load = () => {
|
|
15
|
+
if (typeof document === "undefined" && (ssr == null ? void 0 : ssr()) === false) {
|
|
16
|
+
comp = () => null;
|
|
17
|
+
return Promise.resolve(comp);
|
|
18
|
+
}
|
|
19
|
+
if (!loadPromise) {
|
|
20
|
+
loadPromise = importer().then((res) => {
|
|
21
|
+
loadPromise = void 0;
|
|
22
|
+
comp = res[exportName ?? "default"];
|
|
23
|
+
return comp;
|
|
24
|
+
}).catch((err) => {
|
|
25
|
+
error = err;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return loadPromise;
|
|
29
|
+
};
|
|
30
|
+
const lazyComp = function Lazy(props) {
|
|
31
|
+
if (error) {
|
|
32
|
+
if (isModuleNotFoundError(error)) {
|
|
33
|
+
if (error instanceof Error && typeof window !== "undefined" && typeof sessionStorage !== "undefined") {
|
|
34
|
+
const storageKey = `tanstack_router_reload:${error.message}`;
|
|
35
|
+
if (!sessionStorage.getItem(storageKey)) {
|
|
36
|
+
sessionStorage.setItem(storageKey, "1");
|
|
37
|
+
window.location.reload();
|
|
38
|
+
return {
|
|
39
|
+
default: () => null
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
if (!comp) {
|
|
47
|
+
const [compResource] = Solid.createResource(load, {
|
|
48
|
+
initialValue: comp,
|
|
49
|
+
ssrLoadFrom: "initial"
|
|
50
|
+
});
|
|
51
|
+
return web.memo(compResource);
|
|
52
|
+
}
|
|
53
|
+
if ((ssr == null ? void 0 : ssr()) === false) {
|
|
54
|
+
return web.createComponent(ClientOnly.ClientOnly, {
|
|
55
|
+
get fallback() {
|
|
56
|
+
return web.createComponent(Match.Outlet, {});
|
|
57
|
+
},
|
|
58
|
+
get children() {
|
|
59
|
+
return web.createComponent(web.Dynamic, web.mergeProps({
|
|
60
|
+
component: comp
|
|
61
|
+
}, props));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return web.createComponent(web.Dynamic, web.mergeProps({
|
|
66
|
+
component: comp
|
|
67
|
+
}, props));
|
|
68
|
+
};
|
|
69
|
+
lazyComp.preload = load;
|
|
70
|
+
return lazyComp;
|
|
71
|
+
}
|
|
72
|
+
exports.lazyRouteComponent = lazyRouteComponent;
|
|
73
|
+
//# sourceMappingURL=lazyRouteComponent.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazyRouteComponent.cjs","sources":["../../src/lazyRouteComponent.tsx"],"sourcesContent":["import { Dynamic } from 'solid-js/web'\nimport { createResource } from 'solid-js'\nimport { Outlet } from './Match'\nimport { ClientOnly } from './ClientOnly'\nimport type { AsyncRouteComponent } from './route'\n\n// If the load fails due to module not found, it may mean a new version of\n// the build was deployed and the user's browser is still using an old version.\n// If this happens, the old version in the user's browser would have an outdated\n// URL to the lazy module.\n// In that case, we want to attempt one window refresh to get the latest.\nfunction isModuleNotFoundError(error: any): boolean {\n return (\n typeof error?.message === 'string' &&\n /Failed to fetch dynamically imported module/.test(error.message)\n )\n}\n\nexport function lazyRouteComponent<\n T extends Record<string, any>,\n TKey extends keyof T = 'default',\n>(\n importer: () => Promise<T>,\n exportName?: TKey,\n ssr?: () => boolean,\n): T[TKey] extends (props: infer TProps) => any\n ? AsyncRouteComponent<TProps>\n : never {\n let loadPromise: Promise<any> | undefined\n let comp: T[TKey] | T['default']\n let error: any\n\n const load = () => {\n if (typeof document === 'undefined' && ssr?.() === false) {\n comp = (() => null) as any\n return Promise.resolve(comp)\n }\n if (!loadPromise) {\n loadPromise = importer()\n .then((res) => {\n loadPromise = undefined\n comp = res[exportName ?? 'default']\n return comp\n })\n .catch((err) => {\n error = err\n })\n }\n\n return loadPromise\n }\n\n const lazyComp = function Lazy(props: any) {\n // Now that we're out of preload and into actual render path,\n // throw the error if it was a module not found error during preload\n if (error) {\n if (isModuleNotFoundError(error)) {\n // We don't want an error thrown from preload in this case, because\n // there's nothing we want to do about module not found during preload.\n // Record the error, recover the promise with a null return,\n // and we will attempt module not found resolution during the render path.\n\n if (\n error instanceof Error &&\n typeof window !== 'undefined' &&\n typeof sessionStorage !== 'undefined'\n ) {\n // Again, we want to reload one time on module not found error and not enter\n // a reload loop if there is some other issue besides an old deploy.\n // That's why we store our reload attempt in sessionStorage.\n // Use error.message as key because it contains the module path that failed.\n const storageKey = `tanstack_router_reload:${error.message}`\n if (!sessionStorage.getItem(storageKey)) {\n sessionStorage.setItem(storageKey, '1')\n window.location.reload()\n\n // Return empty component while we wait for window to reload\n return {\n default: () => null,\n }\n }\n }\n }\n\n // Otherwise, just throw the error\n throw error\n }\n\n if (!comp) {\n const [compResource] = createResource(load, {\n initialValue: comp,\n ssrLoadFrom: 'initial',\n })\n return <>{compResource()}</>\n }\n\n if (ssr?.() === false) {\n return (\n <ClientOnly fallback={<Outlet />}>\n <Dynamic component={comp} {...props} />\n </ClientOnly>\n )\n }\n return <Dynamic component={comp} {...props} />\n }\n\n ;(lazyComp as any).preload = load\n\n return lazyComp as any\n}\n"],"names":["isModuleNotFoundError","error","message","test","lazyRouteComponent","importer","exportName","ssr","loadPromise","comp","load","document","Promise","resolve","then","res","undefined","catch","err","lazyComp","Lazy","props","Error","window","sessionStorage","storageKey","getItem","setItem","location","reload","default","compResource","createResource","initialValue","ssrLoadFrom","_$memo","_$createComponent","ClientOnly","fallback","Outlet","children","Dynamic","_$mergeProps","component","preload"],"mappings":";;;;;;AAWA,SAASA,sBAAsBC,OAAqB;AAClD,SACE,QAAOA,+BAAOC,aAAY,YAC1B,8CAA8CC,KAAKF,MAAMC,OAAO;AAEpE;AAEgBE,SAAAA,mBAIdC,UACAC,YACAC,KAGQ;AACJC,MAAAA;AACAC,MAAAA;AACAR,MAAAA;AAEJ,QAAMS,OAAOA,MAAM;AACjB,QAAI,OAAOC,aAAa,gBAAeJ,kCAAY,OAAO;AACxDE,aAAQ,MAAM;AACPG,aAAAA,QAAQC,QAAQJ,IAAI;AAAA,IAAA;AAE7B,QAAI,CAACD,aAAa;AACFH,oBAAAA,SAAAA,EACXS,KAAMC,CAAQ,QAAA;AACCC,sBAAAA;AACPD,eAAAA,IAAIT,cAAc,SAAS;AAC3BG,eAAAA;AAAAA,MAAAA,CACR,EACAQ,MAAOC,CAAQ,QAAA;AACNA,gBAAAA;AAAAA,MAAAA,CACT;AAAA,IAAA;AAGEV,WAAAA;AAAAA,EACT;AAEMW,QAAAA,WAAW,SAASC,KAAKC,OAAY;AAGzC,QAAIpB,OAAO;AACLD,UAAAA,sBAAsBC,KAAK,GAAG;AAMhC,YACEA,iBAAiBqB,SACjB,OAAOC,WAAW,eAClB,OAAOC,mBAAmB,aAC1B;AAKMC,gBAAAA,aAAa,0BAA0BxB,MAAMC,OAAO;AAC1D,cAAI,CAACsB,eAAeE,QAAQD,UAAU,GAAG;AACxBE,2BAAAA,QAAQF,YAAY,GAAG;AACtCF,mBAAOK,SAASC,OAAO;AAGhB,mBAAA;AAAA,cACLC,SAASA,MAAM;AAAA,YACjB;AAAA,UAAA;AAAA,QACF;AAAA,MACF;AAII7B,YAAAA;AAAAA,IAAAA;AAGR,QAAI,CAACQ,MAAM;AACT,YAAM,CAACsB,YAAY,IAAIC,MAAAA,eAAetB,MAAM;AAAA,QAC1CuB,cAAcxB;AAAAA,QACdyB,aAAa;AAAA,MAAA,CACd;AACD,aAAAC,IAAAA,KAAUJ,YAAY;AAAA,IAAA;AAGpBxB,SAAAA,kCAAY,OAAO;AACrB,aAAA6B,IAAAA,gBACGC,WAAAA,YAAU;AAAA,QAAA,IAACC,WAAQ;AAAAF,iBAAAA,IAAAA,gBAAGG,MAAM,QAAA,EAAA;AAAA,QAAA;AAAA,QAAA,IAAAC,WAAA;AAAAJ,iBAAAA,IAAAA,gBAC1BK,aAAOC,eAAA;AAAA,YAACC,WAAWlC;AAAAA,UAAI,GAAMY,KAAK,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA;AAAA,IAAA;AAIzCe,WAAAA,IAAAA,gBAAQK,aAAOC,eAAA;AAAA,MAACC,WAAWlC;AAAAA,IAAI,GAAMY,KAAK,CAAA;AAAA,EAC5C;AAEEF,WAAiByB,UAAUlC;AAEtBS,SAAAA;AACT;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AsyncRouteComponent } from './route.cjs';
|
|
2
|
+
export declare function lazyRouteComponent<T extends Record<string, any>, TKey extends keyof T = 'default'>(importer: () => Promise<T>, exportName?: TKey, ssr?: () => boolean): T[TKey] extends (props: infer TProps) => any ? AsyncRouteComponent<TProps> : never;
|