@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/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/router.ts
CHANGED
|
@@ -38,6 +38,7 @@ import type {
|
|
|
38
38
|
RouterHistory,
|
|
39
39
|
} from '@tanstack/history'
|
|
40
40
|
import type {
|
|
41
|
+
Awaitable,
|
|
41
42
|
ControlledPromise,
|
|
42
43
|
NoInfer,
|
|
43
44
|
NonNullableUpdater,
|
|
@@ -290,12 +291,10 @@ export interface RouterOptions<
|
|
|
290
291
|
/**
|
|
291
292
|
* A function that will be called when the router is hydrated.
|
|
292
293
|
*
|
|
293
|
-
* The return value of this function will be serialized and stored in the router's dehydrated state.
|
|
294
|
-
*
|
|
295
294
|
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#hydrate-method)
|
|
296
295
|
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/external-data-loading#critical-dehydrationhydration)
|
|
297
296
|
*/
|
|
298
|
-
hydrate?: (dehydrated: TDehydrated) => void
|
|
297
|
+
hydrate?: (dehydrated: TDehydrated) => Awaitable<void>
|
|
299
298
|
/**
|
|
300
299
|
* An array of route masks that will be used to mask routes in the route tree.
|
|
301
300
|
*
|
|
@@ -3021,13 +3020,18 @@ interface RouteLike {
|
|
|
3021
3020
|
}
|
|
3022
3021
|
}
|
|
3023
3022
|
|
|
3023
|
+
export type ProcessRouteTreeResult<TRouteLike extends RouteLike> = {
|
|
3024
|
+
routesById: Record<string, TRouteLike>
|
|
3025
|
+
routesByPath: Record<string, TRouteLike>
|
|
3026
|
+
flatRoutes: Array<TRouteLike>
|
|
3027
|
+
}
|
|
3024
3028
|
export function processRouteTree<TRouteLike extends RouteLike>({
|
|
3025
3029
|
routeTree,
|
|
3026
3030
|
initRoute,
|
|
3027
3031
|
}: {
|
|
3028
3032
|
routeTree: TRouteLike
|
|
3029
3033
|
initRoute?: (route: TRouteLike, index: number) => void
|
|
3030
|
-
}) {
|
|
3034
|
+
}): ProcessRouteTreeResult<TRouteLike> {
|
|
3031
3035
|
const routesById = {} as Record<string, TRouteLike>
|
|
3032
3036
|
const routesByPath = {} as Record<string, TRouteLike>
|
|
3033
3037
|
|