@tanstack/router-core 1.121.0 → 1.121.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/index.d.cts +1 -1
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/cjs/router.d.cts +8 -9
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/router.d.ts +8 -9
- package/dist/esm/router.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/router.ts +8 -4
package/dist/cjs/router.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { Store } from '@tanstack/store';
|
|
|
2
2
|
import { SearchParser, SearchSerializer } from './searchParams.cjs';
|
|
3
3
|
import { AnyRedirect, ResolvedRedirect } from './redirect.cjs';
|
|
4
4
|
import { HistoryLocation, HistoryState, ParsedHistoryState, RouterHistory } from '@tanstack/history';
|
|
5
|
-
import { ControlledPromise, NoInfer, NonNullableUpdater, PickAsRequired, Updater } from './utils.cjs';
|
|
5
|
+
import { Awaitable, ControlledPromise, NoInfer, NonNullableUpdater, PickAsRequired, Updater } from './utils.cjs';
|
|
6
6
|
import { ParsedLocation } from './location.cjs';
|
|
7
7
|
import { DeferredPromiseState } from './defer.cjs';
|
|
8
8
|
import { AnyContext, AnyRoute, AnyRouteWithContext, MakeRemountDepsOptionsUnion, RouteMask } from './route.cjs';
|
|
@@ -206,12 +206,10 @@ export interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption
|
|
|
206
206
|
/**
|
|
207
207
|
* A function that will be called when the router is hydrated.
|
|
208
208
|
*
|
|
209
|
-
* The return value of this function will be serialized and stored in the router's dehydrated state.
|
|
210
|
-
*
|
|
211
209
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#hydrate-method)
|
|
212
210
|
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)
|
|
213
211
|
*/
|
|
214
|
-
hydrate?: (dehydrated: TDehydrated) => void
|
|
212
|
+
hydrate?: (dehydrated: TDehydrated) => Awaitable<void>;
|
|
215
213
|
/**
|
|
216
214
|
* An array of route masks that will be used to mask routes in the route tree.
|
|
217
215
|
*
|
|
@@ -604,14 +602,15 @@ interface RouteLike {
|
|
|
604
602
|
caseSensitive?: boolean;
|
|
605
603
|
};
|
|
606
604
|
}
|
|
607
|
-
export
|
|
608
|
-
routeTree: TRouteLike;
|
|
609
|
-
initRoute?: (route: TRouteLike, index: number) => void;
|
|
610
|
-
}): {
|
|
605
|
+
export type ProcessRouteTreeResult<TRouteLike extends RouteLike> = {
|
|
611
606
|
routesById: Record<string, TRouteLike>;
|
|
612
607
|
routesByPath: Record<string, TRouteLike>;
|
|
613
|
-
flatRoutes: TRouteLike
|
|
608
|
+
flatRoutes: Array<TRouteLike>;
|
|
614
609
|
};
|
|
610
|
+
export declare function processRouteTree<TRouteLike extends RouteLike>({ routeTree, initRoute, }: {
|
|
611
|
+
routeTree: TRouteLike;
|
|
612
|
+
initRoute?: (route: TRouteLike, index: number) => void;
|
|
613
|
+
}): ProcessRouteTreeResult<TRouteLike>;
|
|
615
614
|
export declare function getMatchedRoutes<TRouteLike extends RouteLike>({ pathname, routePathname, basepath, caseSensitive, routesByPath, routesById, flatRoutes, }: {
|
|
616
615
|
pathname: string;
|
|
617
616
|
routePathname?: string;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type { RootRouteId } from './root.js';
|
|
|
17
17
|
export { BaseRoute, BaseRouteApi, BaseRootRoute } from './route.js';
|
|
18
18
|
export type { AnyPathParams, SearchSchemaInput, AnyContext, RouteContext, PreloadableObj, RoutePathOptions, StaticDataRouteOption, RoutePathOptionsIntersection, SearchFilter, SearchMiddlewareContext, SearchMiddleware, ResolveId, InferFullSearchSchema, InferFullSearchSchemaInput, InferAllParams, InferAllContext, MetaDescriptor, RouteLinkEntry, SearchValidator, AnySearchValidator, DefaultSearchValidator, ErrorRouteProps, ErrorComponentProps, NotFoundRouteProps, ResolveParams, ParseParamsFn, StringifyParamsFn, ParamsOptions, UpdatableStaticRouteOption, ContextReturnType, ContextAsyncReturnType, ResolveRouteContext, ResolveLoaderData, RoutePrefix, TrimPath, TrimPathLeft, TrimPathRight, ResolveSearchSchemaFnInput, ResolveSearchSchemaInput, ResolveSearchSchemaFn, ResolveSearchSchema, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveAllContext, BeforeLoadContextParameter, RouteContextParameter, ResolveAllParamsFromParent, AnyRoute, Route, RouteTypes, FullSearchSchemaOption, RemountDepsOptions, MakeRemountDepsOptionsUnion, ResolveFullPath, AnyRouteWithContext, RouteOptions, FileBaseRouteOptions, BaseRouteOptions, UpdatableRouteOptions, RouteLoaderFn, LoaderFnContext, RouteContextFn, BeforeLoadFn, ContextOptions, RouteContextOptions, BeforeLoadContextOptions, RootRouteOptions, UpdatableRouteOptionsExtensions, RouteConstraints, RouteTypesById, RouteMask, RouteExtensions, RouteLazyFn, RouteAddChildrenFn, RouteAddFileChildrenFn, RouteAddFileTypesFn, ResolveOptionalParams, ResolveRequiredParams, RootRoute, } from './route.js';
|
|
19
19
|
export { defaultSerializeError, getLocationChangeInfo, RouterCore, componentTypes, lazyFn, SearchParamError, PathParamError, getInitialRouterState, processRouteTree, getMatchedRoutes, } from './router.js';
|
|
20
|
-
export type { ViewTransitionOptions, ExtractedBaseEntry, ExtractedStream, ExtractedPromise, ExtractedEntry, StreamState, TrailingSlashOption, Register, AnyRouter, AnyRouterWithContext, RegisteredRouter, RouterState, BuildNextOptions, RouterListener, RouterEvent, ListenerFn, RouterEvents, MatchRoutesOpts, RouterOptionsExtensions, DefaultRemountDepsFn, PreloadRouteFn, MatchRouteFn, RouterContextOptions, RouterOptions, RouterConstructorOptions, UpdateFn, ParseLocationFn, InvalidateFn, ControllablePromise, InjectedHtmlEntry, RouterErrorSerializer, EmitFn, LoadFn, GetMatchFn, SubscribeFn, UpdateMatchFn, CommitLocationFn, GetMatchRoutesFn, MatchRoutesFn, StartTransitionFn, LoadRouteChunkFn, ServerSrr, ClearCacheFn, CreateRouterFn, } from './router.js';
|
|
20
|
+
export type { ViewTransitionOptions, ExtractedBaseEntry, ExtractedStream, ExtractedPromise, ExtractedEntry, StreamState, TrailingSlashOption, Register, AnyRouter, AnyRouterWithContext, RegisteredRouter, RouterState, BuildNextOptions, RouterListener, RouterEvent, ListenerFn, RouterEvents, MatchRoutesOpts, RouterOptionsExtensions, DefaultRemountDepsFn, PreloadRouteFn, MatchRouteFn, RouterContextOptions, RouterOptions, RouterConstructorOptions, UpdateFn, ParseLocationFn, InvalidateFn, ControllablePromise, InjectedHtmlEntry, RouterErrorSerializer, EmitFn, LoadFn, GetMatchFn, SubscribeFn, UpdateMatchFn, CommitLocationFn, GetMatchRoutesFn, MatchRoutesFn, StartTransitionFn, LoadRouteChunkFn, ServerSrr, ClearCacheFn, CreateRouterFn, ProcessRouteTreeResult, } from './router.js';
|
|
21
21
|
export type { MatchLocation, CommitLocationOptions, NavigateFn, BuildLocationFn, } from './RouterProvider.js';
|
|
22
22
|
export { retainSearchParams, stripSearchParams } from './searchMiddleware.js';
|
|
23
23
|
export { defaultParseSearch, defaultStringifySearch, parseSearchWith, stringifySearchWith, } from './searchParams.js';
|
package/dist/esm/router.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Store } from '@tanstack/store';
|
|
|
2
2
|
import { SearchParser, SearchSerializer } from './searchParams.js';
|
|
3
3
|
import { AnyRedirect, ResolvedRedirect } from './redirect.js';
|
|
4
4
|
import { HistoryLocation, HistoryState, ParsedHistoryState, RouterHistory } from '@tanstack/history';
|
|
5
|
-
import { ControlledPromise, NoInfer, NonNullableUpdater, PickAsRequired, Updater } from './utils.js';
|
|
5
|
+
import { Awaitable, ControlledPromise, NoInfer, NonNullableUpdater, PickAsRequired, Updater } from './utils.js';
|
|
6
6
|
import { ParsedLocation } from './location.js';
|
|
7
7
|
import { DeferredPromiseState } from './defer.js';
|
|
8
8
|
import { AnyContext, AnyRoute, AnyRouteWithContext, MakeRemountDepsOptionsUnion, RouteMask } from './route.js';
|
|
@@ -206,12 +206,10 @@ export interface RouterOptions<TRouteTree extends AnyRoute, TTrailingSlashOption
|
|
|
206
206
|
/**
|
|
207
207
|
* A function that will be called when the router is hydrated.
|
|
208
208
|
*
|
|
209
|
-
* The return value of this function will be serialized and stored in the router's dehydrated state.
|
|
210
|
-
*
|
|
211
209
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#hydrate-method)
|
|
212
210
|
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)
|
|
213
211
|
*/
|
|
214
|
-
hydrate?: (dehydrated: TDehydrated) => void
|
|
212
|
+
hydrate?: (dehydrated: TDehydrated) => Awaitable<void>;
|
|
215
213
|
/**
|
|
216
214
|
* An array of route masks that will be used to mask routes in the route tree.
|
|
217
215
|
*
|
|
@@ -604,14 +602,15 @@ interface RouteLike {
|
|
|
604
602
|
caseSensitive?: boolean;
|
|
605
603
|
};
|
|
606
604
|
}
|
|
607
|
-
export
|
|
608
|
-
routeTree: TRouteLike;
|
|
609
|
-
initRoute?: (route: TRouteLike, index: number) => void;
|
|
610
|
-
}): {
|
|
605
|
+
export type ProcessRouteTreeResult<TRouteLike extends RouteLike> = {
|
|
611
606
|
routesById: Record<string, TRouteLike>;
|
|
612
607
|
routesByPath: Record<string, TRouteLike>;
|
|
613
|
-
flatRoutes: TRouteLike
|
|
608
|
+
flatRoutes: Array<TRouteLike>;
|
|
614
609
|
};
|
|
610
|
+
export declare function processRouteTree<TRouteLike extends RouteLike>({ routeTree, initRoute, }: {
|
|
611
|
+
routeTree: TRouteLike;
|
|
612
|
+
initRoute?: (route: TRouteLike, index: number) => void;
|
|
613
|
+
}): ProcessRouteTreeResult<TRouteLike>;
|
|
615
614
|
export declare function getMatchedRoutes<TRouteLike extends RouteLike>({ pathname, routePathname, basepath, caseSensitive, routesByPath, routesById, flatRoutes, }: {
|
|
616
615
|
pathname: string;
|
|
617
616
|
routePathname?: string;
|