@real-router/core 0.78.0 → 0.79.1
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/README.md +1 -1
- package/dist/cjs/Router-DGUed2F4.js +2 -0
- package/dist/cjs/Router-DGUed2F4.js.map +1 -0
- package/dist/cjs/{Router-BG5yNYUG.d.ts → Router.d.ts} +5 -4
- package/dist/cjs/Router.d.ts.map +1 -0
- package/dist/cjs/Router.js +2 -0
- package/dist/cjs/Router.js.map +1 -0
- package/dist/cjs/RouterError.d.ts +182 -0
- package/dist/cjs/RouterError.d.ts.map +1 -0
- package/dist/cjs/RouterError.js +2 -0
- package/dist/cjs/RouterError.js.map +1 -0
- package/dist/cjs/api/cloneRouter.d.ts +86 -0
- package/dist/cjs/api/cloneRouter.d.ts.map +1 -0
- package/dist/cjs/api/cloneRouter.js +2 -0
- package/dist/cjs/api/cloneRouter.js.map +1 -0
- package/dist/cjs/api/getDependenciesApi.d.ts +7 -0
- package/dist/cjs/api/getDependenciesApi.d.ts.map +1 -0
- package/dist/cjs/api/getDependenciesApi.js +2 -0
- package/dist/cjs/api/getDependenciesApi.js.map +1 -0
- package/dist/cjs/api/getLifecycleApi.d.ts +7 -0
- package/dist/cjs/api/getLifecycleApi.d.ts.map +1 -0
- package/dist/cjs/api/getLifecycleApi.js +2 -0
- package/dist/cjs/api/getLifecycleApi.js.map +1 -0
- package/dist/cjs/api/getPluginApi.d.ts +7 -0
- package/dist/cjs/api/getPluginApi.d.ts.map +1 -0
- package/dist/cjs/api/getPluginApi.js +2 -0
- package/dist/cjs/api/getPluginApi.js.map +1 -0
- package/dist/cjs/api/getRoutesApi.d.ts +7 -0
- package/dist/cjs/api/getRoutesApi.d.ts.map +1 -0
- package/dist/cjs/api/getRoutesApi.js +2 -0
- package/dist/cjs/api/getRoutesApi.js.map +1 -0
- package/dist/cjs/api/helpers.js +2 -0
- package/dist/cjs/api/helpers.js.map +1 -0
- package/dist/cjs/api/types.d.ts +9 -0
- package/dist/cjs/api/types.d.ts.map +1 -0
- package/dist/cjs/api.d.ts +8 -105
- package/dist/cjs/api.js +1 -1
- package/dist/cjs/api.js.map +1 -1
- package/dist/cjs/buildParamMeta-DniluAIV.js +2 -0
- package/dist/cjs/buildParamMeta-DniluAIV.js.map +1 -0
- package/dist/cjs/{cloneRouter-a6LJt-zh.js → cloneRouter-Ch25z3Z2.js} +2 -2
- package/dist/cjs/{cloneRouter-a6LJt-zh.js.map → cloneRouter-Ch25z3Z2.js.map} +1 -1
- package/dist/cjs/constants.d.ts +25 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +2 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/createRouter.d.ts +23 -0
- package/dist/cjs/createRouter.d.ts.map +1 -0
- package/dist/cjs/createRouter.js +2 -0
- package/dist/cjs/createRouter.js.map +1 -0
- package/dist/cjs/engine/builder/buildTree.js +2 -0
- package/dist/cjs/engine/builder/buildTree.js.map +1 -0
- package/dist/cjs/engine/builder/computeCaches.js +2 -0
- package/dist/cjs/engine/builder/computeCaches.js.map +1 -0
- package/dist/cjs/engine/builder/createRouteTree.js +2 -0
- package/dist/cjs/engine/builder/createRouteTree.js.map +1 -0
- package/dist/cjs/engine/builder/types.d.ts +48 -0
- package/dist/cjs/engine/builder/types.d.ts.map +1 -0
- package/dist/cjs/engine/createMatcher.d.ts +29 -0
- package/dist/cjs/engine/createMatcher.d.ts.map +1 -0
- package/dist/cjs/engine/createMatcher.js +2 -0
- package/dist/cjs/engine/createMatcher.js.map +1 -0
- package/dist/cjs/engine/operations/routeTreeToDefinitions.js +2 -0
- package/dist/cjs/engine/operations/routeTreeToDefinitions.js.map +1 -0
- package/dist/cjs/engine/path-matcher/SegmentMatcher.d.ts +16 -0
- package/dist/cjs/engine/path-matcher/SegmentMatcher.d.ts.map +1 -0
- package/dist/cjs/engine/path-matcher/SegmentMatcher.js +2 -0
- package/dist/cjs/engine/path-matcher/SegmentMatcher.js.map +1 -0
- package/dist/cjs/engine/path-matcher/buildParamMeta.js +2 -0
- package/dist/cjs/engine/path-matcher/buildParamMeta.js.map +1 -0
- package/dist/cjs/engine/path-matcher/encoding.js +2 -0
- package/dist/cjs/engine/path-matcher/encoding.js.map +1 -0
- package/dist/cjs/engine/path-matcher/parseSegment.js +2 -0
- package/dist/cjs/engine/path-matcher/parseSegment.js.map +1 -0
- package/dist/cjs/engine/path-matcher/pathUtils.js +2 -0
- package/dist/cjs/engine/path-matcher/pathUtils.js.map +1 -0
- package/dist/cjs/engine/path-matcher/percentEncoding.js +2 -0
- package/dist/cjs/engine/path-matcher/percentEncoding.js.map +1 -0
- package/dist/cjs/engine/path-matcher/registration/buildParts.js +2 -0
- package/dist/cjs/engine/path-matcher/registration/buildParts.js.map +1 -0
- package/dist/cjs/engine/path-matcher/registration/context.js +2 -0
- package/dist/cjs/engine/path-matcher/registration/context.js.map +1 -0
- package/dist/cjs/engine/path-matcher/registration/errors.js +2 -0
- package/dist/cjs/engine/path-matcher/registration/errors.js.map +1 -0
- package/dist/cjs/engine/path-matcher/registration/index.js +2 -0
- package/dist/cjs/engine/path-matcher/registration/index.js.map +1 -0
- package/dist/cjs/engine/path-matcher/registration/trie.js +2 -0
- package/dist/cjs/engine/path-matcher/registration/trie.js.map +1 -0
- package/dist/cjs/engine/path-matcher/registration/trieNodes.js +2 -0
- package/dist/cjs/engine/path-matcher/registration/trieNodes.js.map +1 -0
- package/dist/cjs/{types-xg2zHVF6.d.ts → engine/path-matcher/types.d.ts} +2 -80
- package/dist/cjs/engine/path-matcher/types.d.ts.map +1 -0
- package/dist/cjs/engine/search-params/decode.js +2 -0
- package/dist/cjs/engine/search-params/decode.js.map +1 -0
- package/dist/cjs/engine/search-params/encode.js +2 -0
- package/dist/cjs/engine/search-params/encode.js.map +1 -0
- package/dist/cjs/engine/search-params/searchParams.js +2 -0
- package/dist/cjs/engine/search-params/searchParams.js.map +1 -0
- package/dist/cjs/engine/search-params/strategies/array.js +2 -0
- package/dist/cjs/engine/search-params/strategies/array.js.map +1 -0
- package/dist/cjs/engine/search-params/strategies/boolean.js +2 -0
- package/dist/cjs/engine/search-params/strategies/boolean.js.map +1 -0
- package/dist/cjs/engine/search-params/strategies/index.js +2 -0
- package/dist/cjs/engine/search-params/strategies/index.js.map +1 -0
- package/dist/cjs/engine/search-params/strategies/null.js +2 -0
- package/dist/cjs/engine/search-params/strategies/null.js.map +1 -0
- package/dist/cjs/engine/search-params/strategies/number.js +2 -0
- package/dist/cjs/engine/search-params/strategies/number.js.map +1 -0
- package/dist/cjs/engine/search-params/types.d.ts +72 -0
- package/dist/cjs/engine/search-params/types.d.ts.map +1 -0
- package/dist/cjs/engine/search-params/utils.js +2 -0
- package/dist/cjs/engine/search-params/utils.js.map +1 -0
- package/dist/cjs/engine/validation/route-batch.d.ts +38 -0
- package/dist/cjs/engine/validation/route-batch.d.ts.map +1 -0
- package/dist/cjs/engine/validation/route-batch.js +2 -0
- package/dist/cjs/engine/validation/route-batch.js.map +1 -0
- package/dist/cjs/engine/validation/routes.js +2 -0
- package/dist/cjs/engine/validation/routes.js.map +1 -0
- package/dist/cjs/foundation/event-emitter/EventEmitter.js +2 -0
- package/dist/cjs/foundation/event-emitter/EventEmitter.js.map +1 -0
- package/dist/cjs/foundation/fsm/fsm.js +2 -0
- package/dist/cjs/foundation/fsm/fsm.js.map +1 -0
- package/dist/cjs/foundation/logger/RouterLogger.js +2 -0
- package/dist/cjs/foundation/logger/RouterLogger.js.map +1 -0
- package/dist/cjs/foundation/logger/constants.js +2 -0
- package/dist/cjs/foundation/logger/constants.js.map +1 -0
- package/dist/cjs/getNavigator.d.ts +6 -0
- package/dist/cjs/getNavigator.d.ts.map +1 -0
- package/dist/cjs/getNavigator.js +2 -0
- package/dist/cjs/getNavigator.js.map +1 -0
- package/dist/cjs/guards.js +2 -0
- package/dist/cjs/guards.js.map +1 -0
- package/dist/cjs/helpers.js +2 -0
- package/dist/cjs/helpers.js.map +1 -0
- package/dist/cjs/index.d.ts +17 -239
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internals.d.ts +99 -0
- package/dist/cjs/internals.d.ts.map +1 -0
- package/dist/cjs/internals.js +2 -0
- package/dist/cjs/internals.js.map +1 -0
- package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.d.ts +10 -0
- package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.d.ts.map +1 -0
- package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.js +2 -0
- package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.js.map +1 -0
- package/dist/cjs/namespaces/EventBusNamespace/EventBusNamespace.js +2 -0
- package/dist/cjs/namespaces/EventBusNamespace/EventBusNamespace.js.map +1 -0
- package/dist/cjs/namespaces/NavigationNamespace/NavigationNamespace.js +2 -0
- package/dist/cjs/namespaces/NavigationNamespace/NavigationNamespace.js.map +1 -0
- package/dist/cjs/namespaces/NavigationNamespace/constants.js +2 -0
- package/dist/cjs/namespaces/NavigationNamespace/constants.js.map +1 -0
- package/dist/cjs/namespaces/NavigationNamespace/transition/completeTransition.js +2 -0
- package/dist/cjs/namespaces/NavigationNamespace/transition/completeTransition.js.map +1 -0
- package/dist/cjs/namespaces/NavigationNamespace/transition/errorHandling.js +2 -0
- package/dist/cjs/namespaces/NavigationNamespace/transition/errorHandling.js.map +1 -0
- package/dist/cjs/namespaces/NavigationNamespace/transition/guardPhase.js +2 -0
- package/dist/cjs/namespaces/NavigationNamespace/transition/guardPhase.js.map +1 -0
- package/dist/cjs/namespaces/OptionsNamespace/OptionsNamespace.js +2 -0
- package/dist/cjs/namespaces/OptionsNamespace/OptionsNamespace.js.map +1 -0
- package/dist/cjs/namespaces/OptionsNamespace/constants.js +2 -0
- package/dist/cjs/namespaces/OptionsNamespace/constants.js.map +1 -0
- package/dist/cjs/namespaces/OptionsNamespace/helpers.js +2 -0
- package/dist/cjs/namespaces/OptionsNamespace/helpers.js.map +1 -0
- package/dist/cjs/namespaces/OptionsNamespace/validators.js +2 -0
- package/dist/cjs/namespaces/OptionsNamespace/validators.js.map +1 -0
- package/dist/cjs/namespaces/PluginsNamespace/PluginsNamespace.js +2 -0
- package/dist/cjs/namespaces/PluginsNamespace/PluginsNamespace.js.map +1 -0
- package/dist/cjs/namespaces/PluginsNamespace/constants.js +2 -0
- package/dist/cjs/namespaces/PluginsNamespace/constants.js.map +1 -0
- package/dist/cjs/namespaces/PluginsNamespace/validators.js +2 -0
- package/dist/cjs/namespaces/PluginsNamespace/validators.js.map +1 -0
- package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.ts +174 -0
- package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.ts.map +1 -0
- package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.js +2 -0
- package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.js.map +1 -0
- package/dist/cjs/namespaces/RouteLifecycleNamespace/types.d.ts +17 -0
- package/dist/cjs/namespaces/RouteLifecycleNamespace/types.d.ts.map +1 -0
- package/dist/cjs/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.js +2 -0
- package/dist/cjs/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.js.map +1 -0
- package/dist/cjs/namespaces/RouterLifecycleNamespace/constants.js +2 -0
- package/dist/cjs/namespaces/RouterLifecycleNamespace/constants.js.map +1 -0
- package/dist/cjs/namespaces/RoutesNamespace/RoutesNamespace.js +2 -0
- package/dist/cjs/namespaces/RoutesNamespace/RoutesNamespace.js.map +1 -0
- package/dist/cjs/namespaces/RoutesNamespace/constants.js +2 -0
- package/dist/cjs/namespaces/RoutesNamespace/constants.js.map +1 -0
- package/dist/cjs/namespaces/RoutesNamespace/forwardChain.d.ts +5 -0
- package/dist/cjs/namespaces/RoutesNamespace/forwardChain.d.ts.map +1 -0
- package/dist/cjs/namespaces/RoutesNamespace/forwardChain.js +2 -0
- package/dist/cjs/namespaces/RoutesNamespace/forwardChain.js.map +1 -0
- package/dist/cjs/namespaces/RoutesNamespace/helpers.js +2 -0
- package/dist/cjs/namespaces/RoutesNamespace/helpers.js.map +1 -0
- package/dist/cjs/namespaces/RoutesNamespace/routeGuards.js +2 -0
- package/dist/cjs/namespaces/RoutesNamespace/routeGuards.js.map +1 -0
- package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts +42 -0
- package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts.map +1 -0
- package/dist/cjs/namespaces/RoutesNamespace/routesStore.js +2 -0
- package/dist/cjs/namespaces/RoutesNamespace/routesStore.js.map +1 -0
- package/dist/cjs/namespaces/RoutesNamespace/types.d.ts +57 -0
- package/dist/cjs/namespaces/RoutesNamespace/types.d.ts.map +1 -0
- package/dist/cjs/namespaces/StateNamespace/StateNamespace.js +2 -0
- package/dist/cjs/namespaces/StateNamespace/StateNamespace.js.map +1 -0
- package/dist/cjs/namespaces/StateNamespace/helpers.js +2 -0
- package/dist/cjs/namespaces/StateNamespace/helpers.js.map +1 -0
- package/dist/cjs/routerFSM.js +2 -0
- package/dist/cjs/routerFSM.js.map +1 -0
- package/dist/cjs/stateMetaStore.js +2 -0
- package/dist/cjs/stateMetaStore.js.map +1 -0
- package/dist/cjs/transitionPath.js +2 -0
- package/dist/cjs/transitionPath.js.map +1 -0
- package/dist/cjs/{RouterValidator-CZ8kPkrI.d.ts → types/RouterValidator.d.ts} +2 -2
- package/dist/cjs/types/RouterValidator.d.ts.map +1 -0
- package/dist/cjs/types/api.d.ts +184 -0
- package/dist/cjs/types/api.d.ts.map +1 -0
- package/dist/cjs/types/base.d.ts +86 -0
- package/dist/cjs/types/base.d.ts.map +1 -0
- package/dist/cjs/types/constants.d.ts +72 -0
- package/dist/cjs/types/constants.d.ts.map +1 -0
- package/dist/cjs/types/internal.d.ts +9 -0
- package/dist/cjs/types/internal.d.ts.map +1 -0
- package/dist/cjs/types/limits.d.ts +45 -0
- package/dist/cjs/types/limits.d.ts.map +1 -0
- package/dist/cjs/types/route-node-types.d.ts +46 -0
- package/dist/cjs/types/route-node-types.d.ts.map +1 -0
- package/dist/cjs/types/router.d.ts +313 -0
- package/dist/cjs/types/router.d.ts.map +1 -0
- package/dist/cjs/types/tree-changed.d.ts +55 -0
- package/dist/cjs/types/tree-changed.d.ts.map +1 -0
- package/dist/cjs/types.d.ts +208 -2
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/utils/createRequestScope.d.ts +111 -0
- package/dist/cjs/utils/createRequestScope.d.ts.map +1 -0
- package/dist/cjs/utils/createRequestScope.js +2 -0
- package/dist/cjs/utils/createRequestScope.js.map +1 -0
- package/dist/cjs/utils/getStaticPaths.d.ts +7 -0
- package/dist/cjs/utils/getStaticPaths.d.ts.map +1 -0
- package/dist/cjs/utils/getStaticPaths.js +2 -0
- package/dist/cjs/utils/getStaticPaths.js.map +1 -0
- package/dist/cjs/utils/hydrateRouter.d.ts +69 -0
- package/dist/cjs/utils/hydrateRouter.d.ts.map +1 -0
- package/dist/cjs/utils/hydrateRouter.js +2 -0
- package/dist/cjs/utils/hydrateRouter.js.map +1 -0
- package/dist/cjs/utils/serializeRouterState.d.ts +84 -0
- package/dist/cjs/utils/serializeRouterState.d.ts.map +1 -0
- package/dist/cjs/utils/serializeRouterState.js +2 -0
- package/dist/cjs/utils/serializeRouterState.js.map +1 -0
- package/dist/cjs/utils/serializeState.d.ts +50 -0
- package/dist/cjs/utils/serializeState.d.ts.map +1 -0
- package/dist/cjs/utils/serializeState.js +2 -0
- package/dist/cjs/utils/serializeState.js.map +1 -0
- package/dist/cjs/utils.d.ts +5 -1
- package/dist/cjs/utils.js +1 -1
- package/dist/cjs/validation.d.ts +6 -518
- package/dist/cjs/validation.js +1 -1
- package/dist/cjs/validation.js.map +1 -1
- package/dist/cjs/wiring/wireNamespaces.js +2 -0
- package/dist/cjs/wiring/wireNamespaces.js.map +1 -0
- package/dist/esm/Router-Bk6PfSE8.mjs +2 -0
- package/dist/esm/Router-Bk6PfSE8.mjs.map +1 -0
- package/dist/esm/{Router-Cy75qbgU.d.mts → Router.d.mts} +5 -4
- package/dist/esm/Router.d.mts.map +1 -0
- package/dist/esm/RouterError.d.mts +182 -0
- package/dist/esm/RouterError.d.mts.map +1 -0
- package/dist/esm/api/cloneRouter.d.mts +86 -0
- package/dist/esm/api/cloneRouter.d.mts.map +1 -0
- package/dist/esm/api/getDependenciesApi.d.mts +7 -0
- package/dist/esm/api/getDependenciesApi.d.mts.map +1 -0
- package/dist/esm/api/getLifecycleApi.d.mts +7 -0
- package/dist/esm/api/getLifecycleApi.d.mts.map +1 -0
- package/dist/esm/api/getPluginApi.d.mts +7 -0
- package/dist/esm/api/getPluginApi.d.mts.map +1 -0
- package/dist/esm/api/getRoutesApi.d.mts +7 -0
- package/dist/esm/api/getRoutesApi.d.mts.map +1 -0
- package/dist/esm/api/types.d.mts +9 -0
- package/dist/esm/api/types.d.mts.map +1 -0
- package/dist/esm/api.d.mts +8 -105
- package/dist/esm/api.mjs +1 -1
- package/dist/esm/api.mjs.map +1 -1
- package/dist/esm/buildParamMeta-bOLhLF9h.mjs +2 -0
- package/dist/esm/buildParamMeta-bOLhLF9h.mjs.map +1 -0
- package/dist/esm/{cloneRouter-CqS4kTs8.mjs → cloneRouter-D4rnqmi9.mjs} +2 -2
- package/dist/esm/{cloneRouter-CqS4kTs8.mjs.map → cloneRouter-D4rnqmi9.mjs.map} +1 -1
- package/dist/esm/constants.d.mts +25 -0
- package/dist/esm/constants.d.mts.map +1 -0
- package/dist/esm/createRouter.d.mts +23 -0
- package/dist/esm/createRouter.d.mts.map +1 -0
- package/dist/esm/engine/builder/types.d.mts +48 -0
- package/dist/esm/engine/builder/types.d.mts.map +1 -0
- package/dist/esm/engine/createMatcher.d.mts +29 -0
- package/dist/esm/engine/createMatcher.d.mts.map +1 -0
- package/dist/esm/engine/path-matcher/SegmentMatcher.d.mts +16 -0
- package/dist/esm/engine/path-matcher/SegmentMatcher.d.mts.map +1 -0
- package/dist/esm/{types-xg2zHVF6.d.mts → engine/path-matcher/types.d.mts} +2 -80
- package/dist/esm/engine/path-matcher/types.d.mts.map +1 -0
- package/dist/esm/engine/search-params/types.d.mts +72 -0
- package/dist/esm/engine/search-params/types.d.mts.map +1 -0
- package/dist/esm/engine/validation/route-batch.d.mts +38 -0
- package/dist/esm/engine/validation/route-batch.d.mts.map +1 -0
- package/dist/esm/getNavigator.d.mts +6 -0
- package/dist/esm/getNavigator.d.mts.map +1 -0
- package/dist/esm/index.d.mts +17 -239
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internals.d.mts +99 -0
- package/dist/esm/internals.d.mts.map +1 -0
- package/dist/esm/namespaces/DependenciesNamespace/dependenciesStore.d.mts +10 -0
- package/dist/esm/namespaces/DependenciesNamespace/dependenciesStore.d.mts.map +1 -0
- package/dist/esm/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.mts +174 -0
- package/dist/esm/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.mts.map +1 -0
- package/dist/esm/namespaces/RouteLifecycleNamespace/types.d.mts +17 -0
- package/dist/esm/namespaces/RouteLifecycleNamespace/types.d.mts.map +1 -0
- package/dist/esm/namespaces/RoutesNamespace/forwardChain.d.mts +5 -0
- package/dist/esm/namespaces/RoutesNamespace/forwardChain.d.mts.map +1 -0
- package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts +42 -0
- package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts.map +1 -0
- package/dist/esm/namespaces/RoutesNamespace/types.d.mts +57 -0
- package/dist/esm/namespaces/RoutesNamespace/types.d.mts.map +1 -0
- package/dist/esm/{RouterValidator-CZ8kPkrI.d.mts → types/RouterValidator.d.mts} +2 -2
- package/dist/esm/types/RouterValidator.d.mts.map +1 -0
- package/dist/esm/types/api.d.mts +184 -0
- package/dist/esm/types/api.d.mts.map +1 -0
- package/dist/esm/types/base.d.mts +86 -0
- package/dist/esm/types/base.d.mts.map +1 -0
- package/dist/esm/types/constants.d.mts +72 -0
- package/dist/esm/types/constants.d.mts.map +1 -0
- package/dist/esm/types/internal.d.mts +9 -0
- package/dist/esm/types/internal.d.mts.map +1 -0
- package/dist/esm/types/limits.d.mts +45 -0
- package/dist/esm/types/limits.d.mts.map +1 -0
- package/dist/esm/types/route-node-types.d.mts +46 -0
- package/dist/esm/types/route-node-types.d.mts.map +1 -0
- package/dist/esm/types/router.d.mts +313 -0
- package/dist/esm/types/router.d.mts.map +1 -0
- package/dist/esm/types/tree-changed.d.mts +55 -0
- package/dist/esm/types/tree-changed.d.mts.map +1 -0
- package/dist/esm/types.d.mts +208 -2
- package/dist/esm/types.d.mts.map +1 -0
- package/dist/esm/utils/createRequestScope.d.mts +111 -0
- package/dist/esm/utils/createRequestScope.d.mts.map +1 -0
- package/dist/esm/utils/getStaticPaths.d.mts +7 -0
- package/dist/esm/utils/getStaticPaths.d.mts.map +1 -0
- package/dist/esm/utils/hydrateRouter.d.mts +69 -0
- package/dist/esm/utils/hydrateRouter.d.mts.map +1 -0
- package/dist/esm/utils/serializeRouterState.d.mts +84 -0
- package/dist/esm/utils/serializeRouterState.d.mts.map +1 -0
- package/dist/esm/utils/serializeState.d.mts +50 -0
- package/dist/esm/utils/serializeState.d.mts.map +1 -0
- package/dist/esm/utils.d.mts +5 -1
- package/dist/esm/utils.mjs +1 -1
- package/dist/esm/validation.d.mts +6 -518
- package/dist/esm/validation.mjs +1 -1
- package/dist/esm/validation.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/cjs/Router-BG5yNYUG.d.ts.map +0 -1
- package/dist/cjs/Router-D6NzRxBA.js +0 -2
- package/dist/cjs/Router-D6NzRxBA.js.map +0 -1
- package/dist/cjs/RouterValidator-CZ8kPkrI.d.ts.map +0 -1
- package/dist/cjs/api.d.ts.map +0 -1
- package/dist/cjs/buildParamMeta-CkG6cUIl.js +0 -2
- package/dist/cjs/buildParamMeta-CkG6cUIl.js.map +0 -1
- package/dist/cjs/index-CAnGQpnz.d.ts +0 -974
- package/dist/cjs/index-CAnGQpnz.d.ts.map +0 -1
- package/dist/cjs/index-DDrryY2U.d.ts +0 -309
- package/dist/cjs/index-DDrryY2U.d.ts.map +0 -1
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/types-xg2zHVF6.d.ts.map +0 -1
- package/dist/cjs/validation.d.ts.map +0 -1
- package/dist/esm/Router-Cy75qbgU.d.mts.map +0 -1
- package/dist/esm/Router-De0Gr9Ll.mjs +0 -2
- package/dist/esm/Router-De0Gr9Ll.mjs.map +0 -1
- package/dist/esm/RouterValidator-CZ8kPkrI.d.mts.map +0 -1
- package/dist/esm/api.d.mts.map +0 -1
- package/dist/esm/buildParamMeta-Bl0uORu6.mjs +0 -2
- package/dist/esm/buildParamMeta-Bl0uORu6.mjs.map +0 -1
- package/dist/esm/index-CAnGQpnz.d.mts +0 -974
- package/dist/esm/index-CAnGQpnz.d.mts.map +0 -1
- package/dist/esm/index-DnSU6huX.d.mts +0 -309
- package/dist/esm/index-DnSU6huX.d.mts.map +0 -1
- package/dist/esm/index.d.mts.map +0 -1
- package/dist/esm/types-xg2zHVF6.d.mts.map +0 -1
- package/dist/esm/validation.d.mts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../src/engine/builder/types.ts"],"mappings":";;;;;UAiBiB;GACd;EACD;EACA;EACA,WAAW;;;;;;;;;;;;UAiBI;;WAIN;;WAGA;;WAGA;;WAGA,UAAU,oBAAoB;;WAG9B,WAAW;;WAKX,QAAQ;;WAGR,8BAA8B;;WAG9B;;;;;;WAOA,cAAc,SAAS"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Options } from "./search-params/types.mjs";
|
|
2
|
+
import { SegmentMatcher } from "./path-matcher/SegmentMatcher.mjs";
|
|
3
|
+
//#region src/engine/createMatcher.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Query string formatting options.
|
|
6
|
+
*
|
|
7
|
+
* Controls how arrays, booleans, nulls, and numbers are serialized in query strings.
|
|
8
|
+
*/
|
|
9
|
+
type QueryParamsConfig = Readonly<Options>;
|
|
10
|
+
/**
|
|
11
|
+
* Options for creating a path matcher.
|
|
12
|
+
*/
|
|
13
|
+
interface CreateMatcherOptions {
|
|
14
|
+
readonly caseSensitive?: boolean;
|
|
15
|
+
readonly strictTrailingSlash?: boolean;
|
|
16
|
+
readonly strictQueryParams?: boolean;
|
|
17
|
+
readonly urlParamsEncoding?: "default" | "uri" | "uriComponent" | "none";
|
|
18
|
+
readonly queryParams?: QueryParamsConfig;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Path matcher instance type.
|
|
22
|
+
*
|
|
23
|
+
* Opaque type — consumers use methods (match, buildPath, hasRoute, etc.)
|
|
24
|
+
* without knowing the underlying SegmentMatcher implementation.
|
|
25
|
+
*/
|
|
26
|
+
type Matcher = SegmentMatcher;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { CreateMatcherOptions, Matcher, QueryParamsConfig };
|
|
29
|
+
//# sourceMappingURL=createMatcher.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createMatcher.d.mts","names":[],"sources":["../../../src/engine/createMatcher.ts"],"mappings":";;;;;;;;KAwBY,oBAAoB,SAAS;;;;UAKxB;WACN;WACA;WACA;WACA;WACA,cAAc;;;;;;;;KASb,UAAU"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BuildPathOptions, MatchResult, MatcherInputNode, ResolvedMatcherOptions, SegmentMatcherOptions } from "./types.mjs";
|
|
2
|
+
//#region src/engine/path-matcher/SegmentMatcher.d.ts
|
|
3
|
+
declare class SegmentMatcher {
|
|
4
|
+
#private;
|
|
5
|
+
get options(): ResolvedMatcherOptions;
|
|
6
|
+
constructor(options: SegmentMatcherOptions);
|
|
7
|
+
registerTree(node: MatcherInputNode): void;
|
|
8
|
+
match(path: string): MatchResult | undefined;
|
|
9
|
+
buildPath(name: string, params?: Record<string, unknown>, options?: BuildPathOptions): string;
|
|
10
|
+
getSegmentsByName(name: string): readonly MatcherInputNode[] | undefined;
|
|
11
|
+
getMetaByName(name: string): Readonly<Record<string, Record<string, "url" | "query">>> | undefined;
|
|
12
|
+
hasRoute(name: string): boolean;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { SegmentMatcher };
|
|
16
|
+
//# sourceMappingURL=SegmentMatcher.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentMatcher.d.mts","names":[],"sources":["../../../../src/engine/path-matcher/SegmentMatcher.ts"],"mappings":";;cA6Da;;MACP,WAAW;EA2BH,YAAA,SAAS;EAiBrB,aAAa,MAAM;EAiBnB,MAAM,eAAe;EAqDrB,UACE,cACA,SAAS,yBACT,UAAU;EAmBZ,kBAAkB,wBAAwB;EAO1C,cACE,eACC,SAAS,eAAe;EAI3B,SAAS"}
|
|
@@ -6,23 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module path-matcher/types
|
|
8
8
|
*/
|
|
9
|
-
/**
|
|
10
|
-
* Constraint pattern for a URL parameter.
|
|
11
|
-
*/
|
|
12
|
-
interface ConstraintPattern {
|
|
13
|
-
/**
|
|
14
|
-
* Compiled RegExp for validating the parameter value.
|
|
15
|
-
*
|
|
16
|
-
* @example /^(\d+)$/ for constraint "<\\d+>"
|
|
17
|
-
*/
|
|
18
|
-
readonly pattern: RegExp;
|
|
19
|
-
/**
|
|
20
|
-
* Raw constraint string from the route pattern.
|
|
21
|
-
*
|
|
22
|
-
* @example "<\\d+>"
|
|
23
|
-
*/
|
|
24
|
-
readonly constraint: string;
|
|
25
|
-
}
|
|
26
9
|
/**
|
|
27
10
|
* Parameter metadata extracted from a route path pattern.
|
|
28
11
|
*/
|
|
@@ -51,22 +34,6 @@ interface ParamMeta {
|
|
|
51
34
|
* @example { id: "url", q: "query" }
|
|
52
35
|
*/
|
|
53
36
|
readonly paramTypeMap: Readonly<Record<string, "url" | "query">>;
|
|
54
|
-
/**
|
|
55
|
-
* Map of parameter names to their constraint patterns.
|
|
56
|
-
*
|
|
57
|
-
* Only includes parameters with explicit constraints (e.g., `:id<\\d+>`).
|
|
58
|
-
* Parameters without constraints are not included in this map.
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* buildParamMeta("/users/:id<\\d+>").constraintPatterns.get("id")
|
|
63
|
-
* // → { pattern: /^(\d+)$/, constraint: "<\\d+>" }
|
|
64
|
-
*
|
|
65
|
-
* buildParamMeta("/users/:id").constraintPatterns.size
|
|
66
|
-
* // → 0 (no constraints)
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
readonly constraintPatterns: ReadonlyMap<string, ConstraintPattern>;
|
|
70
37
|
/**
|
|
71
38
|
* Path pattern without query string, pre-computed for buildPath.
|
|
72
39
|
*
|
|
@@ -122,50 +89,5 @@ interface ResolvedMatcherOptions {
|
|
|
122
89
|
readonly buildQueryString: (params: Record<string, unknown>) => string;
|
|
123
90
|
}
|
|
124
91
|
//#endregion
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
* Definition of a route for configuration.
|
|
128
|
-
*/
|
|
129
|
-
interface RouteDefinition {
|
|
130
|
-
[key: string]: unknown;
|
|
131
|
-
name: string;
|
|
132
|
-
path: string;
|
|
133
|
-
children?: RouteDefinition[] | undefined;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Immutable route tree node.
|
|
137
|
-
*
|
|
138
|
-
* This is the core data structure of the new route-tree architecture.
|
|
139
|
-
* It contains only data (no methods) and is created by the builder.
|
|
140
|
-
*
|
|
141
|
-
* All caches are pre-computed at build time:
|
|
142
|
-
* - nonAbsoluteChildren: filtered children without absolute paths
|
|
143
|
-
* - fullName: pre-computed "users.profile" instead of runtime join
|
|
144
|
-
*/
|
|
145
|
-
interface RouteTree {
|
|
146
|
-
/** Route segment name (e.g., "users" in "users.profile") */
|
|
147
|
-
readonly name: string;
|
|
148
|
-
/** Route path pattern (e.g., "/users/:id") */
|
|
149
|
-
readonly path: string;
|
|
150
|
-
/** Whether this route uses absolute path matching (path starts with "~") */
|
|
151
|
-
readonly absolute: boolean;
|
|
152
|
-
/** Child route nodes (Map for O(1) lookup by name) */
|
|
153
|
-
readonly children: ReadonlyMap<string, RouteTree>;
|
|
154
|
-
/** Parameter metadata extracted from path pattern (replaces parser dependency) */
|
|
155
|
-
readonly paramMeta: ParamMeta;
|
|
156
|
-
/** Parent node (null for root) */
|
|
157
|
-
readonly parent: RouteTree | null;
|
|
158
|
-
/** Children without absolute paths (for regular matching) */
|
|
159
|
-
readonly nonAbsoluteChildren: readonly RouteTree[];
|
|
160
|
-
/** Pre-computed full name (e.g., "users.profile") */
|
|
161
|
-
readonly fullName: string;
|
|
162
|
-
/**
|
|
163
|
-
* Pre-computed parameter type map for this segment.
|
|
164
|
-
* Cached to avoid recomputing on every navigation.
|
|
165
|
-
* Maps param name → "url" | "query".
|
|
166
|
-
*/
|
|
167
|
-
readonly paramTypeMap: Readonly<Record<string, "url" | "query">>;
|
|
168
|
-
}
|
|
169
|
-
//#endregion
|
|
170
|
-
export { MatcherInputNode as a, MatchResult as i, RouteTree as n, ResolvedMatcherOptions as o, BuildPathOptions as r, SegmentMatcherOptions as s, RouteDefinition as t };
|
|
171
|
-
//# sourceMappingURL=types-xg2zHVF6.d.mts.map
|
|
92
|
+
export { BuildPathOptions, MatchResult, MatcherInputNode, ParamMeta, ResolvedMatcherOptions, SegmentMatcherOptions, URLParamsEncodingType };
|
|
93
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../src/engine/path-matcher/types.ts"],"mappings":";;;;;;;;;;;UAWiB;;;;;;WAMN;;;;;;WAOA;;;;;;WAOA;;;;;;WAOA,cAAc,SAAS;;;;;;WAOvB;;;;;;;;;;KAeC;UAMK;WACN;WACA;WACA;WACA;WACA,UAAU,oBAAoB;WAC9B,8BAA8B;WAC9B,WAAW;WACX,cAAc,SAAS;;;;;UAqCjB;WACN;WACA;;UA0BM;WACN,mBAAmB;WACnB,QAAQ,SAAS;WACjB,MAAM,SAAS,eAAe;;UAOxB;EACf;EACA;EACA;EACA,oBAAoB;EACpB,mBAAmB,wBAAwB;EAC3C,mBAAmB,QAAQ;;UAGZ;WACN;WACA;WACA;WACA,mBAAmB;WACnB,mBAAmB,wBAAwB;WAC3C,mBAAmB,QAAQ"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//#region src/engine/search-params/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Search Params Type Definitions.
|
|
4
|
+
*
|
|
5
|
+
* Consolidated interfaces and type aliases for the search-params module.
|
|
6
|
+
*
|
|
7
|
+
* @module search-params/types
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Array parameter encoding format.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* - `none` - repeated keys: `a=1&a=2`
|
|
14
|
+
* - `brackets` - bracket notation: `a[]=1&a[]=2`
|
|
15
|
+
* - `index` - indexed notation: `a[0]=1&a[1]=2`
|
|
16
|
+
* - `comma` - comma-separated: `a=1,2`
|
|
17
|
+
*/
|
|
18
|
+
type ArrayFormat = "none" | "brackets" | "index" | "comma";
|
|
19
|
+
/**
|
|
20
|
+
* Boolean parameter encoding format.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* - `none` - no special handling
|
|
24
|
+
* - `auto` - auto-detect "true"/"false" strings as boolean values
|
|
25
|
+
* - `empty-true` - true values have no value: `?flag` instead of `?flag=true`
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Under `empty-true` the bare-key wire form (`?flag`) is reserved for `true`, so
|
|
29
|
+
* a `null` value with `nullFormat: "default"` (which also encodes to a bare key)
|
|
30
|
+
* is **not representable**: it round-trips back as `true`, not `null`. Both null
|
|
31
|
+
* and true collapse to the same token and only `true` decodes back. Pair
|
|
32
|
+
* `empty-true` with `nullFormat: "hidden"`, or avoid null query values.
|
|
33
|
+
*/
|
|
34
|
+
type BooleanFormat = "none" | "auto" | "empty-true";
|
|
35
|
+
/**
|
|
36
|
+
* Null parameter encoding format.
|
|
37
|
+
*
|
|
38
|
+
* @remarks
|
|
39
|
+
* - `default` - key only: `?key` (collides with `booleanFormat: "empty-true"`,
|
|
40
|
+
* which reserves the bare-key form for `true` — null then decodes as `true`)
|
|
41
|
+
* - `hidden` - omit from query string
|
|
42
|
+
*/
|
|
43
|
+
type NullFormat = "default" | "hidden";
|
|
44
|
+
/**
|
|
45
|
+
* Number parameter encoding format.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* - `none` - no special handling
|
|
49
|
+
* - `auto` - decode canonical decimal numbers (`/^-?(0|[1-9]\d*)(\.\d+)?$/`) to
|
|
50
|
+
* `Number()`. Recognizes negatives so the parsed type matches what
|
|
51
|
+
* `build`/`navigate` produce; rejects leading zeros (`"007"`), exponent
|
|
52
|
+
* notation, unsafe integers, and negative zero (`"-0"` — the grammar matches
|
|
53
|
+
* it, but an `Object.is` guard rejects it since `build(-0)` emits `"0"`, #898)
|
|
54
|
+
* — those keep their exact text as strings.
|
|
55
|
+
*/
|
|
56
|
+
type NumberFormat = "none" | "auto";
|
|
57
|
+
/**
|
|
58
|
+
* Options for search-params parsing and building.
|
|
59
|
+
*/
|
|
60
|
+
interface Options {
|
|
61
|
+
/** Array parameter encoding format. @default "none" */
|
|
62
|
+
arrayFormat?: ArrayFormat;
|
|
63
|
+
/** Boolean parameter encoding format. @default "auto" */
|
|
64
|
+
booleanFormat?: BooleanFormat;
|
|
65
|
+
/** Null parameter encoding format. @default "default" */
|
|
66
|
+
nullFormat?: NullFormat;
|
|
67
|
+
/** Number parameter encoding format. @default "auto" */
|
|
68
|
+
numberFormat?: NumberFormat;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { ArrayFormat, BooleanFormat, NullFormat, NumberFormat, Options };
|
|
72
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../../../../src/engine/search-params/types.ts"],"mappings":";;;;;;;;;;;;;;;;;KAqBY;;;;;;;;;;;;;;;;KAiBA;;;;;;;;;KAUA;;;;;;;;;;;;;KAcA;;;;UASK;;EAEf,cAAc;;EAEd,gBAAgB;;EAEhB,aAAa;;EAEb,eAAe"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { RouteDefinition, RouteTree } from "../builder/types.mjs";
|
|
2
|
+
//#region src/engine/validation/route-batch.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Validates route structure for add operations.
|
|
5
|
+
*
|
|
6
|
+
* Performs comprehensive validation including:
|
|
7
|
+
* - Type check (must be object)
|
|
8
|
+
* - Name validation
|
|
9
|
+
* - Path validation
|
|
10
|
+
* - Duplicate name detection (in tree and batch)
|
|
11
|
+
* - Duplicate path detection (in tree and batch)
|
|
12
|
+
* - Recursive children validation
|
|
13
|
+
*
|
|
14
|
+
* @param route - Route to validate
|
|
15
|
+
* @param methodName - Calling method for error context
|
|
16
|
+
* @param rootNode - Optional root node for duplicate checking
|
|
17
|
+
* @param parentName - Parent route name for building full path (used in recursion)
|
|
18
|
+
* @param seenNames - Set of names already seen in this batch
|
|
19
|
+
* @param seenPathsByParent - Map of paths by parent for path duplicate detection
|
|
20
|
+
* @throws {TypeError} If route structure is invalid
|
|
21
|
+
* @throws {Error} If route already exists (duplicate)
|
|
22
|
+
* @throws {Error} If path already defined (duplicate)
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const seenNames = new Set<string>();
|
|
27
|
+
* const seenPaths = new Map<string, Set<string>>();
|
|
28
|
+
*
|
|
29
|
+
* // Validate routes before adding
|
|
30
|
+
* for (const route of routes) {
|
|
31
|
+
* validateRoute(route, "add", rootNode, "", seenNames, seenPaths);
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare function validateRoute(route: unknown, methodName: string, rootNode?: RouteTree, parentName?: string, seenNames?: Set<string>, seenPathsByParent?: Map<string, Set<string>>): asserts route is RouteDefinition;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { validateRoute };
|
|
38
|
+
//# sourceMappingURL=route-batch.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-batch.d.mts","names":[],"sources":["../../../../src/engine/validation/route-batch.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0YgB,cACd,gBACA,oBACA,WAAW,WACX,qBACA,YAAY,aACZ,oBAAoB,YAAY,uBACvB,SAAS"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DefaultDependencies, Navigator, Router } from "./types/router.mjs";
|
|
2
|
+
//#region src/getNavigator.d.ts
|
|
3
|
+
declare const getNavigator: <Dependencies extends DefaultDependencies = DefaultDependencies>(router: Router<Dependencies>) => Navigator;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { getNavigator };
|
|
6
|
+
//# sourceMappingURL=getNavigator.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNavigator.d.mts","names":[],"sources":["../../src/getNavigator.ts"],"mappings":";;cAIa,eACX,qBAAqB,sBAAsB,qBAE3C,QAAQ,OAAO,kBACd"}
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -1,239 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
* Special route names and identifiers.
|
|
19
|
-
*/
|
|
20
|
-
declare const UNKNOWN_ROUTE = "@@router/UNKNOWN_ROUTE";
|
|
21
|
-
declare const constants: Constants;
|
|
22
|
-
/**
|
|
23
|
-
* Event names for router event system.
|
|
24
|
-
* Used with addEventListener/removeEventListener for reactive subscriptions.
|
|
25
|
-
*/
|
|
26
|
-
declare const events: EventToNameMap;
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/RouterError.d.ts
|
|
29
|
-
declare class RouterError extends Error {
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
readonly segment: string | undefined;
|
|
32
|
-
readonly path: string | undefined;
|
|
33
|
-
code: string;
|
|
34
|
-
/**
|
|
35
|
-
* Creates a new RouterError instance.
|
|
36
|
-
*
|
|
37
|
-
* The options object accepts built-in fields (message, segment, path)
|
|
38
|
-
* and any additional custom fields, which will all be attached to the error instance.
|
|
39
|
-
*
|
|
40
|
-
* @param code - The error code (e.g., "ROUTE_NOT_FOUND", "CANNOT_ACTIVATE")
|
|
41
|
-
* @param options - Optional configuration object
|
|
42
|
-
* @param options.message - Custom error message (defaults to code if not provided)
|
|
43
|
-
* @param options.segment - The route segment where the error occurred
|
|
44
|
-
* @param options.path - The full path where the error occurred
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* // Basic error
|
|
49
|
-
* const err1 = new RouterError("ROUTE_NOT_FOUND");
|
|
50
|
-
*
|
|
51
|
-
* // Error with custom message
|
|
52
|
-
* const err2 = new RouterError("ERR", { message: "Something went wrong" });
|
|
53
|
-
*
|
|
54
|
-
* // Error with context and custom fields
|
|
55
|
-
* const err3 = new RouterError("CANNOT_ACTIVATE", {
|
|
56
|
-
* message: "Insufficient permissions",
|
|
57
|
-
* segment: "admin",
|
|
58
|
-
* path: "/admin/users",
|
|
59
|
-
* userId: "123" // custom field
|
|
60
|
-
* });
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
constructor(code: string, {
|
|
64
|
-
message,
|
|
65
|
-
segment,
|
|
66
|
-
path,
|
|
67
|
-
...rest
|
|
68
|
-
}?: {
|
|
69
|
-
[key: string]: unknown;
|
|
70
|
-
message?: string | undefined;
|
|
71
|
-
segment?: string | undefined;
|
|
72
|
-
path?: string | undefined;
|
|
73
|
-
});
|
|
74
|
-
/**
|
|
75
|
-
* Updates the error code and conditionally updates the message.
|
|
76
|
-
*
|
|
77
|
-
* If the current message is one of the standard error code values
|
|
78
|
-
* (e.g., "ROUTE_NOT_FOUND", "SAME_STATES"), it will be replaced with the new code.
|
|
79
|
-
* This allows keeping error messages in sync with codes when using standard error codes.
|
|
80
|
-
*
|
|
81
|
-
* If the message is custom (not a standard error code), it will be preserved.
|
|
82
|
-
*
|
|
83
|
-
* @param newCode - The new error code to set
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* // Message follows code (standard error code as message)
|
|
87
|
-
* const err = new RouterError("ROUTE_NOT_FOUND", { message: "ROUTE_NOT_FOUND" });
|
|
88
|
-
* err.setCode("CUSTOM_ERROR"); // message becomes "CUSTOM_ERROR"
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* // Custom message is preserved
|
|
92
|
-
* const err = new RouterError("ERR", { message: "Custom error message" });
|
|
93
|
-
* err.setCode("NEW_CODE"); // message stays "Custom error message"
|
|
94
|
-
*/
|
|
95
|
-
setCode(newCode: string): void;
|
|
96
|
-
/**
|
|
97
|
-
* Copies properties from another Error instance to this RouterError.
|
|
98
|
-
*
|
|
99
|
-
* This method updates the message, cause, and stack trace from the provided error.
|
|
100
|
-
* Useful for wrapping native errors while preserving error context.
|
|
101
|
-
*
|
|
102
|
-
* @param err - The Error instance to copy properties from
|
|
103
|
-
* @throws {TypeError} If err is null or undefined
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```typescript
|
|
107
|
-
* const routerErr = new RouterError("TRANSITION_ERR");
|
|
108
|
-
* try {
|
|
109
|
-
* // some operation that might fail
|
|
110
|
-
* } catch (nativeErr) {
|
|
111
|
-
* routerErr.setErrorInstance(nativeErr);
|
|
112
|
-
* throw routerErr;
|
|
113
|
-
* }
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
setErrorInstance(err: Error): void;
|
|
117
|
-
/**
|
|
118
|
-
* Adds custom fields to the error object.
|
|
119
|
-
*
|
|
120
|
-
* This method allows attaching arbitrary data to the error for debugging or logging purposes.
|
|
121
|
-
* All fields become accessible as properties on the error instance and are included in JSON serialization.
|
|
122
|
-
*
|
|
123
|
-
* Reserved method names (setCode, setErrorInstance, setAdditionalFields, hasField, getField, toJSON)
|
|
124
|
-
* are automatically filtered out to prevent accidental overwriting of class methods.
|
|
125
|
-
*
|
|
126
|
-
* @param fields - Object containing custom fields to add to the error
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* ```typescript
|
|
130
|
-
* const err = new RouterError("CANNOT_ACTIVATE");
|
|
131
|
-
* err.setAdditionalFields({
|
|
132
|
-
* userId: "123",
|
|
133
|
-
* attemptedRoute: "/admin",
|
|
134
|
-
* reason: "insufficient permissions"
|
|
135
|
-
* });
|
|
136
|
-
*
|
|
137
|
-
* console.log(err.userId); // "123"
|
|
138
|
-
* console.log(JSON.stringify(err)); // includes all custom fields
|
|
139
|
-
* ```
|
|
140
|
-
*/
|
|
141
|
-
setAdditionalFields(fields: Record<string, unknown>): void;
|
|
142
|
-
/**
|
|
143
|
-
* Checks if a custom field exists on the error object.
|
|
144
|
-
*
|
|
145
|
-
* This method checks for both custom fields added via setAdditionalFields()
|
|
146
|
-
* and built-in fields (code, message, segment, etc.).
|
|
147
|
-
*
|
|
148
|
-
* @param key - The field name to check
|
|
149
|
-
* @returns `true` if the field exists, `false` otherwise
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* ```typescript
|
|
153
|
-
* const err = new RouterError("ERR", { segment: "users" });
|
|
154
|
-
* err.setAdditionalFields({ userId: "123" });
|
|
155
|
-
*
|
|
156
|
-
* err.hasField("userId"); // true
|
|
157
|
-
* err.hasField("segment"); // true
|
|
158
|
-
* err.hasField("unknown"); // false
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
hasField(key: string): boolean;
|
|
162
|
-
/**
|
|
163
|
-
* Retrieves a custom field value from the error object.
|
|
164
|
-
*
|
|
165
|
-
* This method can access both custom fields and built-in fields.
|
|
166
|
-
* Returns `undefined` if the field doesn't exist.
|
|
167
|
-
*
|
|
168
|
-
* @param key - The field name to retrieve
|
|
169
|
-
* @returns The field value, or `undefined` if it doesn't exist
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* ```typescript
|
|
173
|
-
* const err = new RouterError("ERR");
|
|
174
|
-
* err.setAdditionalFields({ userId: "123", role: "admin" });
|
|
175
|
-
*
|
|
176
|
-
* err.getField("userId"); // "123"
|
|
177
|
-
* err.getField("role"); // "admin"
|
|
178
|
-
* err.getField("code"); // "ERR" (built-in field)
|
|
179
|
-
* err.getField("unknown"); // undefined
|
|
180
|
-
* ```
|
|
181
|
-
*/
|
|
182
|
-
getField(key: string): unknown;
|
|
183
|
-
/**
|
|
184
|
-
* Serializes the error to a JSON-compatible object.
|
|
185
|
-
*
|
|
186
|
-
* This method is automatically called by JSON.stringify() and includes:
|
|
187
|
-
* - Built-in fields: code, message, segment (if set), path (if set)
|
|
188
|
-
* - All custom fields added via setAdditionalFields() or constructor
|
|
189
|
-
* - Excludes: stack trace (for security/cleanliness)
|
|
190
|
-
*
|
|
191
|
-
* @returns A plain object representation of the error, suitable for JSON serialization
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* ```typescript
|
|
195
|
-
* const err = new RouterError("ROUTE_NOT_FOUND", {
|
|
196
|
-
* message: "Route not found",
|
|
197
|
-
* path: "/admin/users/123"
|
|
198
|
-
* });
|
|
199
|
-
* err.setAdditionalFields({ userId: "123" });
|
|
200
|
-
*
|
|
201
|
-
* JSON.stringify(err);
|
|
202
|
-
* // {
|
|
203
|
-
* // "code": "ROUTE_NOT_FOUND",
|
|
204
|
-
* // "message": "Route not found",
|
|
205
|
-
* // "path": "/admin/users/123",
|
|
206
|
-
* // "userId": "123"
|
|
207
|
-
* // }
|
|
208
|
-
* ```
|
|
209
|
-
*/
|
|
210
|
-
toJSON(): Record<string, unknown>;
|
|
211
|
-
}
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region src/createRouter.d.ts
|
|
214
|
-
/**
|
|
215
|
-
* Creates a new router instance.
|
|
216
|
-
*
|
|
217
|
-
* @param routes - Array of route definitions
|
|
218
|
-
* @param options - Router configuration options
|
|
219
|
-
* @param dependencies - Dependencies to inject into the router
|
|
220
|
-
* @returns A new Router instance
|
|
221
|
-
*
|
|
222
|
-
* @example
|
|
223
|
-
* const router = createRouter([
|
|
224
|
-
* { name: 'home', path: '/' },
|
|
225
|
-
* { name: 'users', path: '/users' },
|
|
226
|
-
* ]);
|
|
227
|
-
*
|
|
228
|
-
* router.start('/');
|
|
229
|
-
*/
|
|
230
|
-
declare const createRouter: <Dependencies extends DefaultDependencies = DefaultDependencies>(routes?: Route<Dependencies>[], options?: Partial<Options>, dependencies?: Dependencies) => Router<Dependencies>;
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/getNavigator.d.ts
|
|
233
|
-
declare const getNavigator: <Dependencies extends DefaultDependencies = DefaultDependencies>(router: Router$1<Dependencies>) => Navigator;
|
|
234
|
-
//#endregion
|
|
235
|
-
//#region src/namespaces/RoutesNamespace/forwardChain.d.ts
|
|
236
|
-
declare function resolveForwardChain(startRoute: string, forwardMap: Record<string, string>, maxDepth?: number): string;
|
|
237
|
-
//#endregion
|
|
238
|
-
export { type Constants, type ContextNamespaceClaim, type DefaultDependencies, type DefaultParamsCallback, type DefaultRouteCallback, type DependenciesApi, type ErrorCodeKeys, type ErrorCodeToValueMap, type ErrorCodeValues, type ErrorCodes, type EventMethodMap, type EventName, type EventToNameMap, type EventToPluginMap, type EventsKeys, type ForwardToCallback, type GuardFn, type GuardFnFactory, type InterceptableMethodMap, type InterceptorFn, type LeaveFn, type LeaveState, type LifecycleApi, type LimitsConfig, type Listener, type LogCallback, type LogLevel, type LogLevelConfig, type LoggerConfig, type NavigationOptions, type Navigator, type Options, type Params, type Plugin, type PluginApi, type PluginFactory, type PluginMethod, type QueryParamsMode, type QueryParamsOptions, type Route, type RouteConfigUpdate, type RouteParams, type RouteTree, type RouteTreeState, Router, RouterError, type RouterLogger, type RouterValidator, type RoutesApi, type SimpleState, type State, type StateContext, type StateMetaInput, type SubscribeFn, type SubscribeState, type Subscription, type TransitionMeta, type TransitionPhase, type TransitionReason, type TreeChangedAdd, type TreeChangedClear, type TreeChangedEvent, type TreeChangedRemove, type TreeChangedReplace, type TreeChangedUpdate, type TreeStructuralPatch, UNKNOWN_ROUTE, type Unsubscribe, constants, createRouter, errorCodes, events, getNavigator, resolveForwardChain };
|
|
239
|
-
//# sourceMappingURL=index.d.mts.map
|
|
1
|
+
import { RouteTree } from "./engine/builder/types.mjs";
|
|
2
|
+
import { QueryParamsMode, QueryParamsOptions, RouteParams, RouteTreeState } from "./types/route-node-types.mjs";
|
|
3
|
+
import { Params, SimpleState, State, StateMetaInput, TransitionMeta, TransitionPhase, TransitionReason, Unsubscribe } from "./types/base.mjs";
|
|
4
|
+
import { LimitsConfig } from "./types/limits.mjs";
|
|
5
|
+
import { DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, ForwardToCallback, GuardFn, GuardFnFactory, LeaveFn, LeaveState, Listener, LogCallback, LogLevel, LogLevelConfig, LoggerConfig, Navigator, Options, Plugin, PluginFactory, Route, RouteConfigUpdate, RouterLogger, SubscribeFn, SubscribeState, Subscription } from "./types/router.mjs";
|
|
6
|
+
import { ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventMethodMap, EventName, EventToNameMap, EventToPluginMap, EventsKeys, PluginMethod } from "./types/constants.mjs";
|
|
7
|
+
import { TreeChangedAdd, TreeChangedClear, TreeChangedEvent, TreeChangedRemove, TreeChangedReplace, TreeChangedUpdate, TreeStructuralPatch } from "./types/tree-changed.mjs";
|
|
8
|
+
import { ContextNamespaceClaim, DependenciesApi, InterceptableMethodMap, InterceptorFn, LifecycleApi, PluginApi, RoutesApi } from "./types/api.mjs";
|
|
9
|
+
import { NavigationOptions, StateContext } from "./types.mjs";
|
|
10
|
+
import { Router } from "./Router.mjs";
|
|
11
|
+
import { RouterValidator } from "./types/RouterValidator.mjs";
|
|
12
|
+
import { Constants, ErrorCodes, UNKNOWN_ROUTE, constants, errorCodes, events } from "./constants.mjs";
|
|
13
|
+
import { RouterError } from "./RouterError.mjs";
|
|
14
|
+
import { createRouter } from "./createRouter.mjs";
|
|
15
|
+
import { getNavigator } from "./getNavigator.mjs";
|
|
16
|
+
import { resolveForwardChain } from "./namespaces/RoutesNamespace/forwardChain.mjs";
|
|
17
|
+
export { type Constants, type ContextNamespaceClaim, type DefaultDependencies, type DefaultParamsCallback, type DefaultRouteCallback, type DependenciesApi, type ErrorCodeKeys, type ErrorCodeToValueMap, type ErrorCodeValues, type ErrorCodes, type EventMethodMap, type EventName, type EventToNameMap, type EventToPluginMap, type EventsKeys, type ForwardToCallback, type GuardFn, type GuardFnFactory, type InterceptableMethodMap, type InterceptorFn, type LeaveFn, type LeaveState, type LifecycleApi, type LimitsConfig, type Listener, type LogCallback, type LogLevel, type LogLevelConfig, type LoggerConfig, type NavigationOptions, type Navigator, type Options, type Params, type Plugin, type PluginApi, type PluginFactory, type PluginMethod, type QueryParamsMode, type QueryParamsOptions, type Route, type RouteConfigUpdate, type RouteParams, type RouteTree, type RouteTreeState, Router, RouterError, type RouterLogger, type RouterValidator, type RoutesApi, type SimpleState, type State, type StateContext, type StateMetaInput, type SubscribeFn, type SubscribeState, type Subscription, type TransitionMeta, type TransitionPhase, type TransitionReason, type TreeChangedAdd, type TreeChangedClear, type TreeChangedEvent, type TreeChangedRemove, type TreeChangedReplace, type TreeChangedUpdate, type TreeStructuralPatch, UNKNOWN_ROUTE, type Unsubscribe, constants, createRouter, errorCodes, events, getNavigator, resolveForwardChain };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{C as e,E as t,T as n,g as r,n as i,t as a,w as o}from"./Router-
|
|
1
|
+
import{C as e,E as t,T as n,g as r,n as i,t as a,w as o}from"./Router-Bk6PfSE8.mjs";const s=(e=[],t={},n={})=>new a(e,t,n),c=new WeakMap,l=e=>{let t=c.get(e);return t||(t=Object.freeze({navigate:e.navigate,getState:e.getState,isActiveRoute:e.isActiveRoute,canNavigateTo:e.canNavigateTo,subscribe:e.subscribe,subscribeLeave:e.subscribeLeave,isLeaveApproved:e.isLeaveApproved}),c.set(e,t)),t};export{a as Router,i as RouterError,e as UNKNOWN_ROUTE,o as constants,s as createRouter,n as errorCodes,t as events,l as getNavigator,r as resolveForwardChain};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { RouteTree } from "./engine/builder/types.mjs";
|
|
2
|
+
import { RouteTreeState } from "./types/route-node-types.mjs";
|
|
3
|
+
import { Params, SimpleState, State, Unsubscribe } from "./types/base.mjs";
|
|
4
|
+
import { DefaultDependencies, LoggerConfig, Options, Plugin, PluginFactory, Router, RouterLogger } from "./types/router.mjs";
|
|
5
|
+
import { EventMethodMap, EventName } from "./types/constants.mjs";
|
|
6
|
+
import { TreeChangedEvent } from "./types/tree-changed.mjs";
|
|
7
|
+
import { NavigationOptions } from "./types.mjs";
|
|
8
|
+
import { RouterValidator } from "./types/RouterValidator.mjs";
|
|
9
|
+
import { SerializedRouterState } from "./utils/serializeRouterState.mjs";
|
|
10
|
+
import { DependenciesStore } from "./namespaces/DependenciesNamespace/dependenciesStore.mjs";
|
|
11
|
+
import { RoutesStore } from "./namespaces/RoutesNamespace/routesStore.mjs";
|
|
12
|
+
//#region src/internals.d.ts
|
|
13
|
+
interface RouterInternals<D extends DefaultDependencies = DefaultDependencies> {
|
|
14
|
+
readonly makeState: <P extends Params = Params>(name: string, params?: P, path?: string, meta?: Record<string, Record<string, "url" | "query">>) => State<P>;
|
|
15
|
+
readonly forwardState: <P extends Params = Params>(routeName: string, routeParams: P) => SimpleState<P>;
|
|
16
|
+
readonly buildStateResolved: (resolvedName: string, resolvedParams: Params) => RouteTreeState | undefined;
|
|
17
|
+
readonly matchPath: <P extends Params = Params>(path: string, options?: Options) => State<P> | undefined;
|
|
18
|
+
readonly getOptions: () => Options;
|
|
19
|
+
readonly addEventListener: <E extends EventName>(eventName: E, cb: Plugin[EventMethodMap[E]]) => Unsubscribe;
|
|
20
|
+
/**
|
|
21
|
+
* Route-tree mutation channel — internal access for the `getRoutesApi`
|
|
22
|
+
* wrapper. A dedicated bridge is required because the public
|
|
23
|
+
* `addEventListener<E extends EventName>` structurally rejects
|
|
24
|
+
* `"TREE_CHANGED"` (it is not in the public `EventName` union), is strict on
|
|
25
|
+
* duplicates, and exposes neither `emit` nor `listenerCount`.
|
|
26
|
+
*/
|
|
27
|
+
readonly treeChanged: {
|
|
28
|
+
readonly emit: (event: TreeChangedEvent) => void;
|
|
29
|
+
readonly subscribe: (handler: (event: TreeChangedEvent) => void) => Unsubscribe;
|
|
30
|
+
readonly listenerCount: () => number;
|
|
31
|
+
/**
|
|
32
|
+
* True while a `TREE_CHANGED` emit is on the stack — `getRoutesApi` reads it
|
|
33
|
+
* to reject reentrant route-CRUD from a `subscribeChanges` handler (#1032).
|
|
34
|
+
*/
|
|
35
|
+
readonly isEmitting: () => boolean;
|
|
36
|
+
};
|
|
37
|
+
readonly buildPath: (route: string, params?: Params) => string;
|
|
38
|
+
readonly emitTransitionError: (error: Error) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Emits `TRANSITION_SUCCESS` directly (no FSM transition) — used by
|
|
41
|
+
* `getRoutesApi().replace()` to notify `router.subscribe` listeners when a
|
|
42
|
+
* structural replace revalidates the active state (#950). Mirrors the success
|
|
43
|
+
* emission `completeTransition` / `navigateToNotFound` perform.
|
|
44
|
+
*/
|
|
45
|
+
readonly emitTransitionSuccess: (toState: State, fromState: State | undefined, opts?: NavigationOptions) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Commits the not-found (`UNKNOWN_ROUTE`) state for `path` and emits
|
|
48
|
+
* `TRANSITION_SUCCESS` — the `NavigationNamespace.navigateToNotFound`
|
|
49
|
+
* primitive. `replace()` uses it when a structural replace drops the active
|
|
50
|
+
* route, so subscribers are notified instead of the state silently clearing
|
|
51
|
+
* (#950).
|
|
52
|
+
*/
|
|
53
|
+
readonly navigateToNotFound: (path: string) => State;
|
|
54
|
+
readonly start: (path: string) => Promise<State>;
|
|
55
|
+
/**
|
|
56
|
+
* Plugin-only navigation entry point — delegates to
|
|
57
|
+
* `NavigationNamespace.navigateToState` (`getPluginApi(router).navigateToState`).
|
|
58
|
+
* Hidden from `Router`/`Navigator` to keep the userland surface minimal;
|
|
59
|
+
* see `core-types/src/api.ts` for usage docs.
|
|
60
|
+
*/
|
|
61
|
+
readonly navigateToState: (state: State, options?: NavigationOptions) => Promise<State>;
|
|
62
|
+
readonly interceptors: Map<string, ((next: (...args: any[]) => any, ...args: any[]) => any)[]>;
|
|
63
|
+
readonly setRootPath: (rootPath: string) => void;
|
|
64
|
+
readonly getRootPath: () => string;
|
|
65
|
+
readonly getTree: () => RouteTree;
|
|
66
|
+
readonly isDisposed: () => boolean;
|
|
67
|
+
validator: RouterValidator | null;
|
|
68
|
+
readonly logger: RouterLogger;
|
|
69
|
+
readonly dependenciesGetStore: () => DependenciesStore<D>;
|
|
70
|
+
readonly getCloneState: () => {
|
|
71
|
+
options: Options;
|
|
72
|
+
dependencies: Record<string, unknown>;
|
|
73
|
+
pluginFactories: PluginFactory<D>[];
|
|
74
|
+
loggerConfig: LoggerConfig;
|
|
75
|
+
};
|
|
76
|
+
readonly routeGetStore: () => RoutesStore<D>;
|
|
77
|
+
readonly getStateName: () => string | undefined;
|
|
78
|
+
readonly isTransitioning: () => boolean;
|
|
79
|
+
readonly clearState: () => void;
|
|
80
|
+
readonly setState: (state: State) => void;
|
|
81
|
+
readonly routerExtensions: {
|
|
82
|
+
keys: string[];
|
|
83
|
+
}[];
|
|
84
|
+
readonly contextClaimRecords: Set<string>;
|
|
85
|
+
/**
|
|
86
|
+
* One-shot hydration scratchpad populated by `hydrateRouter` immediately
|
|
87
|
+
* before delegating to `router.start(parsed.path)` and cleared in the
|
|
88
|
+
* matching `finally`. SSR loader plugins read this slot directly via
|
|
89
|
+
* `getInternals(router).hydrationState` to short-circuit their own loader
|
|
90
|
+
* call when the server-resolved namespace value is already present in the
|
|
91
|
+
* parsed state (#596). `null` outside of an active `hydrateRouter`
|
|
92
|
+
* invocation.
|
|
93
|
+
*/
|
|
94
|
+
hydrationState: SerializedRouterState | null;
|
|
95
|
+
}
|
|
96
|
+
declare function getInternals<D extends DefaultDependencies>(router: Router<D>): RouterInternals<D>;
|
|
97
|
+
//#endregion
|
|
98
|
+
export { RouterInternals, getInternals };
|
|
99
|
+
//# sourceMappingURL=internals.d.mts.map
|