@real-router/core 0.126.5 → 0.126.6
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/Router-ChxUQY0x.js +2 -0
- package/dist/cjs/Router-ChxUQY0x.js.map +1 -0
- package/dist/cjs/Router.d.ts +1 -2
- package/dist/cjs/Router.d.ts.map +1 -1
- package/dist/cjs/RouterError.d.ts +2 -3
- package/dist/cjs/RouterError.d.ts.map +1 -1
- package/dist/cjs/api/cloneRouter.d.ts +2 -3
- package/dist/cjs/api/cloneRouter.d.ts.map +1 -1
- package/dist/cjs/api/getDependenciesApi.d.ts +1 -2
- package/dist/cjs/api/getDependenciesApi.d.ts.map +1 -1
- package/dist/cjs/api/getLifecycleApi.d.ts +1 -2
- package/dist/cjs/api/getLifecycleApi.d.ts.map +1 -1
- package/dist/cjs/api/getPluginApi.d.ts +1 -2
- package/dist/cjs/api/getPluginApi.d.ts.map +1 -1
- package/dist/cjs/api/getRoutesApi.d.ts +1 -2
- package/dist/cjs/api/getRoutesApi.d.ts.map +1 -1
- package/dist/cjs/api/types.d.ts +2 -2
- package/dist/cjs/api/types.d.ts.map +1 -1
- package/dist/cjs/api.js +1 -1
- package/dist/cjs/api.js.map +1 -1
- package/dist/cjs/constants.d.ts +7 -8
- package/dist/cjs/constants.d.ts.map +1 -1
- package/dist/cjs/createRouter.d.ts +1 -2
- package/dist/cjs/createRouter.d.ts.map +1 -1
- package/dist/cjs/engine/builder/types.d.ts +2 -3
- package/dist/cjs/engine/builder/types.d.ts.map +1 -1
- package/dist/cjs/engine/createMatcher.d.ts +4 -5
- package/dist/cjs/engine/createMatcher.d.ts.map +1 -1
- package/dist/cjs/engine/path-matcher/SegmentMatcher.d.ts +1 -2
- package/dist/cjs/engine/path-matcher/SegmentMatcher.d.ts.map +1 -1
- package/dist/cjs/engine/path-matcher/types.d.ts +7 -8
- package/dist/cjs/engine/path-matcher/types.d.ts.map +1 -1
- package/dist/cjs/engine/search-params/types.d.ts +5 -6
- package/dist/cjs/engine/search-params/types.d.ts.map +1 -1
- package/dist/cjs/engine/validation/route-batch.d.ts +1 -2
- package/dist/cjs/engine/validation/route-batch.d.ts.map +1 -1
- package/dist/cjs/getNavigator.d.ts +1 -2
- package/dist/cjs/getNavigator.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internals-BGTllfGV.js.map +1 -1
- package/dist/cjs/internals.d.ts +2 -3
- package/dist/cjs/internals.d.ts.map +1 -1
- package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.d.ts +1 -2
- package/dist/cjs/namespaces/DependenciesNamespace/dependenciesStore.d.ts.map +1 -1
- package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.ts +2 -3
- package/dist/cjs/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.ts.map +1 -1
- package/dist/cjs/namespaces/RouteLifecycleNamespace/types.d.ts +1 -2
- package/dist/cjs/namespaces/RouteLifecycleNamespace/types.d.ts.map +1 -1
- package/dist/cjs/namespaces/RoutesNamespace/forwardChain.d.ts +1 -2
- package/dist/cjs/namespaces/RoutesNamespace/forwardChain.d.ts.map +1 -1
- package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts +1 -2
- package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts.map +1 -1
- package/dist/cjs/namespaces/RoutesNamespace/types.d.ts +2 -3
- package/dist/cjs/namespaces/RoutesNamespace/types.d.ts.map +1 -1
- package/dist/cjs/pipeline/port.d.ts +1 -2
- package/dist/cjs/pipeline/port.d.ts.map +1 -1
- package/dist/cjs/types/RouterValidator.d.ts +1 -2
- package/dist/cjs/types/RouterValidator.d.ts.map +1 -1
- package/dist/cjs/types/api.d.ts +7 -8
- package/dist/cjs/types/api.d.ts.map +1 -1
- package/dist/cjs/types/base.d.ts +14 -15
- package/dist/cjs/types/base.d.ts.map +1 -1
- package/dist/cjs/types/constants.d.ts +9 -10
- package/dist/cjs/types/constants.d.ts.map +1 -1
- package/dist/cjs/types/internal.d.ts +1 -2
- package/dist/cjs/types/internal.d.ts.map +1 -1
- package/dist/cjs/types/limits.d.ts +1 -2
- package/dist/cjs/types/limits.d.ts.map +1 -1
- package/dist/cjs/types/route-node-types.d.ts +4 -5
- package/dist/cjs/types/route-node-types.d.ts.map +1 -1
- package/dist/cjs/types/router.d.ts +27 -28
- package/dist/cjs/types/router.d.ts.map +1 -1
- package/dist/cjs/types/tree-changed.d.ts +7 -8
- package/dist/cjs/types/tree-changed.d.ts.map +1 -1
- package/dist/cjs/types.d.ts +3 -3
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/utils/ingest.d.ts +2 -3
- package/dist/cjs/utils/ingest.d.ts.map +1 -1
- package/dist/esm/Router-BcMc2U5f.mjs +2 -0
- package/dist/esm/Router-BcMc2U5f.mjs.map +1 -0
- package/dist/esm/Router.d.mts +1 -2
- package/dist/esm/Router.d.mts.map +1 -1
- package/dist/esm/RouterError.d.mts +2 -3
- package/dist/esm/RouterError.d.mts.map +1 -1
- package/dist/esm/api/cloneRouter.d.mts +2 -3
- package/dist/esm/api/cloneRouter.d.mts.map +1 -1
- package/dist/esm/api/getDependenciesApi.d.mts +1 -2
- package/dist/esm/api/getDependenciesApi.d.mts.map +1 -1
- package/dist/esm/api/getLifecycleApi.d.mts +1 -2
- package/dist/esm/api/getLifecycleApi.d.mts.map +1 -1
- package/dist/esm/api/getPluginApi.d.mts +1 -2
- package/dist/esm/api/getPluginApi.d.mts.map +1 -1
- package/dist/esm/api/getRoutesApi.d.mts +1 -2
- package/dist/esm/api/getRoutesApi.d.mts.map +1 -1
- package/dist/esm/api/types.d.mts +2 -2
- package/dist/esm/api/types.d.mts.map +1 -1
- package/dist/esm/api.mjs +1 -1
- package/dist/esm/api.mjs.map +1 -1
- package/dist/esm/constants.d.mts +7 -8
- package/dist/esm/constants.d.mts.map +1 -1
- package/dist/esm/createRouter.d.mts +1 -2
- package/dist/esm/createRouter.d.mts.map +1 -1
- package/dist/esm/engine/builder/types.d.mts +2 -3
- package/dist/esm/engine/builder/types.d.mts.map +1 -1
- package/dist/esm/engine/createMatcher.d.mts +4 -5
- package/dist/esm/engine/createMatcher.d.mts.map +1 -1
- package/dist/esm/engine/path-matcher/SegmentMatcher.d.mts +1 -2
- package/dist/esm/engine/path-matcher/SegmentMatcher.d.mts.map +1 -1
- package/dist/esm/engine/path-matcher/types.d.mts +7 -8
- package/dist/esm/engine/path-matcher/types.d.mts.map +1 -1
- package/dist/esm/engine/search-params/types.d.mts +5 -6
- package/dist/esm/engine/search-params/types.d.mts.map +1 -1
- package/dist/esm/engine/validation/route-batch.d.mts +1 -2
- package/dist/esm/engine/validation/route-batch.d.mts.map +1 -1
- package/dist/esm/getNavigator.d.mts +1 -2
- package/dist/esm/getNavigator.d.mts.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internals-CcqRqpm9.mjs.map +1 -1
- package/dist/esm/internals.d.mts +2 -3
- package/dist/esm/internals.d.mts.map +1 -1
- package/dist/esm/namespaces/DependenciesNamespace/dependenciesStore.d.mts +1 -2
- package/dist/esm/namespaces/DependenciesNamespace/dependenciesStore.d.mts.map +1 -1
- package/dist/esm/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.mts +2 -3
- package/dist/esm/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.d.mts.map +1 -1
- package/dist/esm/namespaces/RouteLifecycleNamespace/types.d.mts +1 -2
- package/dist/esm/namespaces/RouteLifecycleNamespace/types.d.mts.map +1 -1
- package/dist/esm/namespaces/RoutesNamespace/forwardChain.d.mts +1 -2
- package/dist/esm/namespaces/RoutesNamespace/forwardChain.d.mts.map +1 -1
- package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts +1 -2
- package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts.map +1 -1
- package/dist/esm/namespaces/RoutesNamespace/types.d.mts +2 -3
- package/dist/esm/namespaces/RoutesNamespace/types.d.mts.map +1 -1
- package/dist/esm/pipeline/port.d.mts +1 -2
- package/dist/esm/pipeline/port.d.mts.map +1 -1
- package/dist/esm/types/RouterValidator.d.mts +1 -2
- package/dist/esm/types/RouterValidator.d.mts.map +1 -1
- package/dist/esm/types/api.d.mts +7 -8
- package/dist/esm/types/api.d.mts.map +1 -1
- package/dist/esm/types/base.d.mts +14 -15
- package/dist/esm/types/base.d.mts.map +1 -1
- package/dist/esm/types/constants.d.mts +9 -10
- package/dist/esm/types/constants.d.mts.map +1 -1
- package/dist/esm/types/internal.d.mts +1 -2
- package/dist/esm/types/internal.d.mts.map +1 -1
- package/dist/esm/types/limits.d.mts +1 -2
- package/dist/esm/types/limits.d.mts.map +1 -1
- package/dist/esm/types/route-node-types.d.mts +4 -5
- package/dist/esm/types/route-node-types.d.mts.map +1 -1
- package/dist/esm/types/router.d.mts +27 -28
- package/dist/esm/types/router.d.mts.map +1 -1
- package/dist/esm/types/tree-changed.d.mts +7 -8
- package/dist/esm/types/tree-changed.d.mts.map +1 -1
- package/dist/esm/types.d.mts +3 -3
- package/dist/esm/types.d.mts.map +1 -1
- package/dist/esm/utils/ingest.d.mts +2 -3
- package/dist/esm/utils/ingest.d.mts.map +1 -1
- package/package.json +2 -2
- package/dist/cjs/Router-Bndi5Jnt.js +0 -2
- package/dist/cjs/Router-Bndi5Jnt.js.map +0 -1
- package/dist/esm/Router-DsAOMUDq.mjs +0 -2
- package/dist/esm/Router-DsAOMUDq.mjs.map +0 -1
|
@@ -9,7 +9,7 @@ import { RouteResolver } from "../../pipeline/port.js";
|
|
|
9
9
|
* These are function references from the Router facade,
|
|
10
10
|
* avoiding the need to pass the entire Router object.
|
|
11
11
|
*/
|
|
12
|
-
interface RoutesDependencies<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
12
|
+
export interface RoutesDependencies<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
13
13
|
/** Per-router logger instance (from `getInternals(router).logger`) */
|
|
14
14
|
logger: RouterLogger;
|
|
15
15
|
/**
|
|
@@ -55,7 +55,7 @@ interface RoutesDependencies<Dependencies extends DefaultDependencies = DefaultD
|
|
|
55
55
|
* Configuration storage for routes.
|
|
56
56
|
* Stores decoders, encoders, default params, and forward mappings.
|
|
57
57
|
*/
|
|
58
|
-
interface RouteConfig {
|
|
58
|
+
export interface RouteConfig {
|
|
59
59
|
/** Custom param decoders per route */
|
|
60
60
|
decoders: Record<string, (channels: ParamsSearch) => ParamsSearch>;
|
|
61
61
|
/** Custom param encoders per route */
|
|
@@ -70,5 +70,4 @@ interface RouteConfig {
|
|
|
70
70
|
forwardFnMap: Record<string, ForwardToCallback<any>>;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
|
-
export { RouteConfig, RoutesDependencies };
|
|
74
73
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/namespaces/RoutesNamespace/types.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../src/namespaces/RoutesNamespace/types.ts"],"mappings":";;;;;;;;;;;iBAsBiB,mBACf,qBAAqB,sBAAsB;;EAG3C,QAAQ;;;;;;;;EASR,oBAAoB;;;;;;;;;EAUpB,MAAM;;;;;;;EAQN,mBACE,cACA,SAAS,eAAe,eACxB,gBAAgB;;EAIlB,qBACE,cACA,SAAS,eAAe,eACxB,gBAAgB;;;;;;EAQlB,eACE,SAAS,eAAe,eACxB,uBACG;;EAML,gBAAgB;;EAGhB,iBACE,QAAQ,mBACR,QAAQ,mBACR;;EAIF,gBAAgB,gBAAgB,cAAc,MAAM,MAAM,aAAa;;;;;;iBAiBxD;;EAEf,UAAU,gBAAgB,UAAU,iBAAiB;;EAGrD,UAAU,gBAAgB,UAAU,iBAAiB;;EAGrD,eAAe,eAAe;;EAG9B,eAAe,eAAe;;EAG9B,YAAY;;EAIZ,cAAc,eAAe"}
|
|
@@ -38,7 +38,7 @@ import { Params, SearchParams } from "../types/base.js";
|
|
|
38
38
|
* together with its caller, since one added early is dead weight nothing
|
|
39
39
|
* detects (knip has no issue type for unused members of an interface).
|
|
40
40
|
*/
|
|
41
|
-
interface RouteResolver {
|
|
41
|
+
export interface RouteResolver {
|
|
42
42
|
/**
|
|
43
43
|
* Stage ① — resolve the `forwardTo` chain (layering the hops' defaults) and
|
|
44
44
|
* hand back channel-correct bags. Channel-correct by REFUSAL, not by repair:
|
|
@@ -155,5 +155,4 @@ interface RouteResolver {
|
|
|
155
155
|
reportUndeclaredParamKey?: ((routeName: string, key: string) => void) | undefined;
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
|
-
export { RouteResolver };
|
|
159
158
|
//# sourceMappingURL=port.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"port.d.ts","names":[],"sources":["../../../src/pipeline/port.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"port.d.ts","names":[],"sources":["../../../src/pipeline/port.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0CiB;;;;;;;;EAQf,iBACE,cACA,QAAQ,QACR,SAAS;IAET;IACA,QAAQ;IAIR,SAAS;;;;;;;;;;;;;;;;;;;;;;EAuBX,gBAAgB,iBAAiB;EACjC,gBAAgB,iBAAiB;;;;;;;EAQjC,YAAY,cAAc,QAAQ,QAAQ,QAAQ;;;;;;;EAQlD,aAAa;;;;;;;EAQb;;;;;;;;;;;;;;;;;;EAmBA,0BACI,mBAAmB;;;;;;;;;;;;;;;;;;;;;;EAuBvB,YAAY;;;;;;;;;;;;;;;;;;;EAoBZ,6BACI,mBAAmB"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* All parameters use `unknown` type to avoid coupling to internal type names.
|
|
10
10
|
*/
|
|
11
|
-
interface RouterValidator {
|
|
11
|
+
export interface RouterValidator {
|
|
12
12
|
/**
|
|
13
13
|
* Route validation methods
|
|
14
14
|
*/
|
|
@@ -124,5 +124,4 @@ interface RouterValidator {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
//#endregion
|
|
127
|
-
export { RouterValidator };
|
|
128
127
|
//# sourceMappingURL=RouterValidator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouterValidator.d.ts","names":[],"sources":["../../../src/types/RouterValidator.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RouterValidator.d.ts","names":[],"sources":["../../../src/types/RouterValidator.ts"],"mappings":";;;;;;;;;;iBAUiB;;;;EAIf;IACE,wBAAwB;IACxB,wBAAwB;IACxB,4BACE,eACA,iBACA,iBACA;IAEF,+BAA+B;IAC/B,2BACE,eACA,iBACA;IAEF,uBAAuB;IACvB,iBACE,mBACA,eACA;IAEF,0BAA0B;IAC1B,+BAA+B,eAAe;IAC9C,mCAAmC,cAAc;IACjD,sBACE,cACA,kBACA;IAEF,uBAAuB,iBAAiB;IACxC,oBAAoB,eAAe;IACnC,uBAAuB,eAAe;IACtC,8BAA8B,mBAAmB;IACjD,0BAA0B;IAC1B,sBAAsB;IACtB,wBAAwB;;;;;EAM1B;IACE,kBAAkB,kBAAkB;IACpC,+BAA+B,oBAAoB;;;;;EAMrD;IACE,yBAAyB,eAAe;IACxC,4BACE,eACA,gBACA;IAEF,6BAA6B,eAAe;IAC5C,2BAA2B,cAAc;IACzC,0BAA0B,gBAAgB;IAC1C,oBAAoB;IACpB,gBAAgB,cAAc;IAC9B,qBAAqB,gBAAgB;IACrC,wBAAwB;;;;;EAM1B;IACE,sBAAsB,eAAe;IACrC,6BACE,kBACA;IAEF,qBAAqB;IACrB,0BAA0B;IAC1B,sBAAsB;IACtB,uBAAuB;IACvB,uBAAuB;;;;;EAMzB;IACE,kBAAkB,kBAAkB;IACpC,uBAAuB,eAAe;IACtC,0BAA0B,eAAe;IACzC,gBAAgB,cAAc,cAAc;IAC5C,qBAAqB,cAAc;;;;;EAMrC;IACE,uBAAuB;IACvB,gCAAgC;IAChC,8BAA8B;IAC9B,4BAA4B,kBAAkB;IAC9C,iBAAiB,iBAAiB;;;;;;;;IAQlC,iBAAiB,iBAAiB;IAClC,oBAAoB;;;;;EAMtB;IACE,wBACE,eACA,iBACA;IAEF,6BACE,aACA,aACA;;;;;;;;;;;;IAaF,wBAAwB,mBAAmB;;IAG3C,2BAA2B,mBAAmB;;;;;EAMhD;IACE,uBAAuB,eAAe;IACtC,0BACE,eACA,mBACA"}
|
package/dist/cjs/types/api.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ import { NavigationOptions, StateContext } from "../types.js";
|
|
|
21
21
|
* the `registerInternals` block of the Router constructor
|
|
22
22
|
* (`packages/core/src/Router.ts`)
|
|
23
23
|
*/
|
|
24
|
-
interface InterceptableMethodMap {
|
|
24
|
+
export interface InterceptableMethodMap {
|
|
25
25
|
start: (path?: string) => Promise<State>;
|
|
26
26
|
forwardState: (routeName: string, routeParams: Params, routeSearch?: SearchParams) => SimpleState;
|
|
27
27
|
}
|
|
@@ -29,7 +29,7 @@ interface InterceptableMethodMap {
|
|
|
29
29
|
* Type-safe interceptor callback.
|
|
30
30
|
* Receives `next` (the next function in the chain) followed by the method's original parameters.
|
|
31
31
|
*/
|
|
32
|
-
type InterceptorFn<M extends keyof InterceptableMethodMap> = (next: InterceptableMethodMap[M], ...args: Parameters<InterceptableMethodMap[M]>) => ReturnType<InterceptableMethodMap[M]>;
|
|
32
|
+
export type InterceptorFn<M extends keyof InterceptableMethodMap> = (next: InterceptableMethodMap[M], ...args: Parameters<InterceptableMethodMap[M]>) => ReturnType<InterceptableMethodMap[M]>;
|
|
33
33
|
/**
|
|
34
34
|
* Writer object returned by {@link PluginApi.claimContextNamespace}. Holds
|
|
35
35
|
* exclusive ownership of a single `state.context.<namespace>` key for the
|
|
@@ -68,7 +68,7 @@ type InterceptorFn<M extends keyof InterceptableMethodMap> = (next: Interceptabl
|
|
|
68
68
|
* @see {@link PluginApi.claimContextNamespace}
|
|
69
69
|
* @see {@link State.context}
|
|
70
70
|
*/
|
|
71
|
-
interface ContextNamespaceClaim<T = unknown> {
|
|
71
|
+
export interface ContextNamespaceClaim<T = unknown> {
|
|
72
72
|
write: (state: State, value: T) => void;
|
|
73
73
|
release: () => void;
|
|
74
74
|
}
|
|
@@ -76,7 +76,7 @@ interface ContextNamespaceClaim<T = unknown> {
|
|
|
76
76
|
* Plugin API — for plugins and infrastructure packages.
|
|
77
77
|
* Hides plugin-internal methods from public autocomplete.
|
|
78
78
|
*/
|
|
79
|
-
interface PluginApi {
|
|
79
|
+
export interface PluginApi {
|
|
80
80
|
makeState: <P extends Params = Params, S extends SearchParams = SearchParams>(name: string, params?: P, search?: S, path?: string) => State<P, S>;
|
|
81
81
|
forwardState: <P extends Params = Params, S extends SearchParams = SearchParams>(routeName: string, routeParams: P, routeSearch?: S) => SimpleState<P, S>;
|
|
82
82
|
matchPath: <P extends Params = Params>(path: string) => State<P> | undefined;
|
|
@@ -176,7 +176,7 @@ interface PluginApi {
|
|
|
176
176
|
/**
|
|
177
177
|
* Routes API — for dynamic route mutation.
|
|
178
178
|
*/
|
|
179
|
-
interface RoutesApi<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
179
|
+
export interface RoutesApi<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
180
180
|
add: (routes: Route<Dependencies>[] | Route<Dependencies>, options?: {
|
|
181
181
|
parent?: string;
|
|
182
182
|
}) => void;
|
|
@@ -239,7 +239,7 @@ interface RoutesApi<Dependencies extends DefaultDependencies = DefaultDependenci
|
|
|
239
239
|
/**
|
|
240
240
|
* Dependencies API — CRUD for dependency injection.
|
|
241
241
|
*/
|
|
242
|
-
interface DependenciesApi<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
242
|
+
export interface DependenciesApi<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
243
243
|
get: <K extends keyof Dependencies>(key: K) => Dependencies[K];
|
|
244
244
|
getAll: () => Partial<Dependencies>;
|
|
245
245
|
set: <K extends keyof Dependencies & string>(name: K, value: Dependencies[K]) => void;
|
|
@@ -251,12 +251,11 @@ interface DependenciesApi<Dependencies extends DefaultDependencies = DefaultDepe
|
|
|
251
251
|
/**
|
|
252
252
|
* Lifecycle API — guard registration (addActivateGuard, addDeactivateGuard, etc.)
|
|
253
253
|
*/
|
|
254
|
-
interface LifecycleApi<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
254
|
+
export interface LifecycleApi<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
255
255
|
addActivateGuard: (name: string, canActivateHandler: GuardFnFactory<Dependencies> | boolean) => void;
|
|
256
256
|
addDeactivateGuard: (name: string, canDeactivateHandler: GuardFnFactory<Dependencies> | boolean) => void;
|
|
257
257
|
removeActivateGuard: (name: string) => void;
|
|
258
258
|
removeDeactivateGuard: (name: string) => void;
|
|
259
259
|
}
|
|
260
260
|
//#endregion
|
|
261
|
-
export { ContextNamespaceClaim, DependenciesApi, InterceptableMethodMap, InterceptorFn, LifecycleApi, PluginApi, RoutesApi };
|
|
262
261
|
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","names":[],"sources":["../../../src/types/api.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"api.d.ts","names":[],"sources":["../../../src/types/api.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;iBA2CiB;EACf,QAAQ,kBAAkB,QAAQ;EAClC,eACE,mBACA,aAAa,QACb,cAAc,iBACX;;;;;;YAOK,cAAc,gBAAgB,2BACxC,MAAM,uBAAuB,OAC1B,MAAM,WAAW,uBAAuB,QACxC,WAAW,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCtB,sBAAsB;EACrC,QAAQ,OAAO,OAAO,OAAO;EAC7B;;;;;;iBAOe;EACf,YAAY,UAAU,SAAS,QAAQ,UAAU,eAAe,cAC9D,cACA,SAAS,GACT,SAAS,GACT,kBACG,MAAM,GAAG;EAEd,eACE,UAAU,SAAS,QACnB,UAAU,eAAe,cAEzB,mBACA,aAAa,GACb,cAAc,MACX,YAAY,GAAG;EAEpB,YAAY,UAAU,SAAS,QAAQ,iBAAiB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B9D,kBACE,OAAO,OACP,UAAU,sBACP,QAAQ;;;;;;;EAQb,cAAc;EACd;EAEA,mBAAmB,UAAU,WAC3B,WAAW,GACX,IAAI,OAAO,eAAe,QACvB;;;;;;;;;;;;EAaL,uBACE,cACA,SAAS,QACT,SAAS,iBACN;EAEL,kBAAkB;EAElB;EAEA,iBAAiB,gBAAgB,wBAC/B,QAAQ,GACR,IAAI,cAAc,OACf;EAEL,eAAe,YAAY,4BAA4B;;;;;;;;;;;;;;;EAgBvD,sBAAsB,OAAO;EAE7B;KAEG,gBAAgB,uBACf,WAAW,IACV,sBAAsB,aAAa;KACrC,oBAAoB;;;;;;;;;;;;;;;;;;;EAoBvB,iBAAiB,iBAAiB;;;;;iBAMnB,UACf,qBAAqB,sBAAsB;EAE3C,MACE,QAAQ,MAAM,kBAAkB,MAAM,eACtC;IAAY;;EAGd,SAAS;;;;;;;;;;;EAYT,SAAS,cAAc,SAAS,kBAAkB;EAElD;EAEA,UAAU,QAAQ,MAAM,kBAAkB,MAAM;EAEhD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4BN,MAAM,iBAAiB,MAAM;;;;;;;;;;;;;EAc7B,mBACE,UAAU,OAAO,iBAAiB,2BAC/B;;;;;iBAMU,gBACf,qBAAqB,sBAAsB;EAE3C,MAAM,gBAAgB,cAAc,KAAK,MAAM,aAAa;EAC5D,cAAc,QAAQ;EACtB,MAAM,gBAAgB,uBACpB,MAAM,GACN,OAAO,aAAa;EAEtB,SAAS,MAAM;EACf,SAAS,YAAY;EACrB;EACA,MAAM,YAAY;;;;;iBAMH,aACf,qBAAqB,sBAAsB;EAE3C,mBACE,cACA,oBAAoB,eAAe;EAErC,qBACE,cACA,sBAAsB,eAAe;EAEvC,sBAAsB;EACtB,wBAAwB"}
|
package/dist/cjs/types/base.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ import { StateContext } from "../types.js";
|
|
|
9
9
|
* and plugin interceptors. Idempotent — calling more than once is safe and
|
|
10
10
|
* has no additional effect after the first call.
|
|
11
11
|
*/
|
|
12
|
-
type Unsubscribe = () => void;
|
|
13
|
-
interface SimpleState<P extends Params = Params, S extends SearchParams = SearchParams> {
|
|
12
|
+
export type Unsubscribe = () => void;
|
|
13
|
+
export interface SimpleState<P extends Params = Params, S extends SearchParams = SearchParams> {
|
|
14
14
|
name: string;
|
|
15
15
|
params: P;
|
|
16
16
|
/**
|
|
@@ -20,9 +20,9 @@ interface SimpleState<P extends Params = Params, S extends SearchParams = Search
|
|
|
20
20
|
*/
|
|
21
21
|
search: S;
|
|
22
22
|
}
|
|
23
|
-
type TransitionPhase = "deactivating" | "activating";
|
|
24
|
-
type TransitionReason = "success" | "blocked" | "cancelled" | "error";
|
|
25
|
-
interface TransitionMeta {
|
|
23
|
+
export type TransitionPhase = "deactivating" | "activating";
|
|
24
|
+
export type TransitionReason = "success" | "blocked" | "cancelled" | "error";
|
|
25
|
+
export interface TransitionMeta {
|
|
26
26
|
phase: TransitionPhase;
|
|
27
27
|
reason: TransitionReason;
|
|
28
28
|
reload?: boolean;
|
|
@@ -36,7 +36,7 @@ interface TransitionMeta {
|
|
|
36
36
|
intersection: string;
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
interface State<P extends Params = Params, S extends SearchParams = SearchParams> {
|
|
39
|
+
export interface State<P extends Params = Params, S extends SearchParams = SearchParams> {
|
|
40
40
|
name: string;
|
|
41
41
|
params: P;
|
|
42
42
|
/**
|
|
@@ -98,7 +98,7 @@ interface State<P extends Params = Params, S extends SearchParams = SearchParams
|
|
|
98
98
|
* `router.isActiveRoute(target)` and as the `to` prop of framework `<Link>`s,
|
|
99
99
|
* so a target can be threaded as one value instead of positional arguments.
|
|
100
100
|
*/
|
|
101
|
-
interface NavigationTarget<P extends Params = Params, S extends SearchParams = SearchParams> {
|
|
101
|
+
export interface NavigationTarget<P extends Params = Params, S extends SearchParams = SearchParams> {
|
|
102
102
|
name: string;
|
|
103
103
|
params?: P;
|
|
104
104
|
search?: S;
|
|
@@ -117,7 +117,7 @@ interface NavigationTarget<P extends Params = Params, S extends SearchParams = S
|
|
|
117
117
|
* unchanged — only the storage location differs (M2 keeps query parsing/printing
|
|
118
118
|
* exactly as v1).
|
|
119
119
|
*/
|
|
120
|
-
interface ParamsSearch<P extends Params = Params, S extends SearchParams = SearchParams> {
|
|
120
|
+
export interface ParamsSearch<P extends Params = Params, S extends SearchParams = SearchParams> {
|
|
121
121
|
params: P;
|
|
122
122
|
search: S;
|
|
123
123
|
}
|
|
@@ -129,13 +129,13 @@ interface ParamsSearch<P extends Params = Params, S extends SearchParams = Searc
|
|
|
129
129
|
* own hydration scratchpad (`RouterInternals.hydrationState`) is typed against
|
|
130
130
|
* it — see `internals.ts`.
|
|
131
131
|
*/
|
|
132
|
-
type SerializedRouterState<P extends Params = Params> = Omit<State<P>, "transition">;
|
|
132
|
+
export type SerializedRouterState<P extends Params = Params> = Omit<State<P>, "transition">;
|
|
133
133
|
/**
|
|
134
134
|
* RouterError interface describing the public API of the RouterError class.
|
|
135
135
|
* The class itself is `RouterError.ts`; this interface is what a consumer types
|
|
136
136
|
* against, so an error can be described without importing the implementation.
|
|
137
137
|
*/
|
|
138
|
-
interface RouterError extends Error {
|
|
138
|
+
export interface RouterError extends Error {
|
|
139
139
|
[key: string]: unknown;
|
|
140
140
|
readonly code: string;
|
|
141
141
|
readonly segment: string | undefined;
|
|
@@ -147,7 +147,7 @@ interface RouterError extends Error {
|
|
|
147
147
|
getField: (key: string) => unknown;
|
|
148
148
|
toJSON: () => Record<string, unknown>;
|
|
149
149
|
}
|
|
150
|
-
interface Params {
|
|
150
|
+
export interface Params {
|
|
151
151
|
[key: string]: string | string[] | number | number[] | boolean | boolean[] | Params | Params[] | Record<string, string | number | boolean> | null | undefined;
|
|
152
152
|
}
|
|
153
153
|
/**
|
|
@@ -155,11 +155,11 @@ interface Params {
|
|
|
155
155
|
* (`engine/search-params/types.ts`) — the value form is identical to v1's query
|
|
156
156
|
* half (the union produced across `queryParamsMode` formats).
|
|
157
157
|
*/
|
|
158
|
-
type SearchParamPrimitive = string | number | boolean | null;
|
|
158
|
+
export type SearchParamPrimitive = string | number | boolean | null;
|
|
159
159
|
/**
|
|
160
160
|
* A single query-parameter value — a primitive or an array of primitives.
|
|
161
161
|
*/
|
|
162
|
-
type SearchParamValue = SearchParamPrimitive | SearchParamPrimitive[];
|
|
162
|
+
export type SearchParamValue = SearchParamPrimitive | SearchParamPrimitive[];
|
|
163
163
|
/**
|
|
164
164
|
* Query-parameter bag carried by {@link State.search} — the query channel,
|
|
165
165
|
* split out of the former single `params` bag in M2 (RFC-4 M2 / #1548). Only
|
|
@@ -168,7 +168,6 @@ type SearchParamValue = SearchParamPrimitive | SearchParamPrimitive[];
|
|
|
168
168
|
* `SearchParams` (`engine/search-params/types.ts`), so match results flow into
|
|
169
169
|
* `State.search` without conversion.
|
|
170
170
|
*/
|
|
171
|
-
type SearchParams = Record<string, SearchParamValue | undefined>;
|
|
171
|
+
export type SearchParams = Record<string, SearchParamValue | undefined>;
|
|
172
172
|
//#endregion
|
|
173
|
-
export { NavigationTarget, Params, ParamsSearch, RouterError, SearchParamPrimitive, SearchParamValue, SearchParams, SerializedRouterState, SimpleState, State, TransitionMeta, TransitionPhase, TransitionReason, Unsubscribe };
|
|
174
173
|
//# sourceMappingURL=base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":[],"sources":["../../../src/types/base.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"base.d.ts","names":[],"sources":["../../../src/types/base.ts"],"mappings":";;;;;;;;;;;YAmBY;iBAEK,YACf,UAAU,SAAS,QACnB,UAAU,eAAe;EAEzB;EACA,QAAQ;;;;;;EAMR,QAAQ;;YAGE;YAEA;iBAEK;EACf,OAAO;EACP,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;IACE;IACA;IACA;;;iBAIa,MACf,UAAU,SAAS,QACnB,UAAU,eAAe;EAEzB;EACA,QAAQ;;;;;;EAMR,QAAQ;EACR;;;;;;;;;;;;;;;;;;;;;;EAsBA,YAAY;;;;;;;;;;;;;;;;;;;;;EAqBZ,SAAS,eAAe;;;;;;;;;;iBAWT,iBACf,UAAU,SAAS,QACnB,UAAU,eAAe;EAEzB;EACA,SAAS;EACT,SAAS;;;;;;;;;;;;;;;;iBAiBM,aACf,UAAU,SAAS,QACnB,UAAU,eAAe;EAEzB,QAAQ;EACR,QAAQ;;;;;;;;;;YAWE,sBAAsB,UAAU,SAAS,UAAU,KAC7D,MAAM;;;;;;iBASS,oBAAoB;GAClC;WACQ;WACA;WACA;EACT,UAAU;EACV,mBAAmB,KAAK;EACxB,sBAAsB,QAAQ;EAC9B,WAAW;EACX,WAAW;EACX,cAAc;;iBAGC;GACd,4EAOG,SACA,WACA;;;;;;;YAUM;;;;YAKA,mBAAmB,uBAAuB;;;;;;;;;YAU1C,eAAe,eAAe"}
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Plugin lifecycle method names
|
|
4
4
|
*/
|
|
5
|
-
type PluginMethod = "onStart" | "onStop" | "onTransitionStart" | "onTransitionLeaveApprove" | "onTransitionCancel" | "onTransitionSuccess" | "onTransitionError";
|
|
5
|
+
export type PluginMethod = "onStart" | "onStop" | "onTransitionStart" | "onTransitionLeaveApprove" | "onTransitionCancel" | "onTransitionSuccess" | "onTransitionError";
|
|
6
6
|
/**
|
|
7
7
|
* Router event names
|
|
8
8
|
*/
|
|
9
|
-
type EventName = "$start" | "$stop" | "$$start" | "$$leaveApprove" | "$$cancel" | "$$success" | "$$error";
|
|
9
|
+
export type EventName = "$start" | "$stop" | "$$start" | "$$leaveApprove" | "$$cancel" | "$$success" | "$$error";
|
|
10
10
|
/**
|
|
11
11
|
* Event type keys
|
|
12
12
|
*/
|
|
13
|
-
type EventsKeys = "ROUTER_START" | "ROUTER_STOP" | "TRANSITION_START" | "TRANSITION_LEAVE_APPROVE" | "TRANSITION_CANCEL" | "TRANSITION_SUCCESS" | "TRANSITION_ERROR";
|
|
13
|
+
export type EventsKeys = "ROUTER_START" | "ROUTER_STOP" | "TRANSITION_START" | "TRANSITION_LEAVE_APPROVE" | "TRANSITION_CANCEL" | "TRANSITION_SUCCESS" | "TRANSITION_ERROR";
|
|
14
14
|
/**
|
|
15
15
|
* Error code values
|
|
16
16
|
*/
|
|
17
|
-
type ErrorCodeValues = "NOT_STARTED" | "NO_START_PATH_OR_STATE" | "ALREADY_STARTED" | "ROUTE_NOT_FOUND" | "SAME_STATES" | "CANNOT_DEACTIVATE" | "CANNOT_ACTIVATE" | "TRANSITION_ERR" | "CANCELLED" | "DISPOSED" | "PLUGIN_CONFLICT" | "CONTEXT_NAMESPACE_ALREADY_CLAIMED";
|
|
17
|
+
export type ErrorCodeValues = "NOT_STARTED" | "NO_START_PATH_OR_STATE" | "ALREADY_STARTED" | "ROUTE_NOT_FOUND" | "SAME_STATES" | "CANNOT_DEACTIVATE" | "CANNOT_ACTIVATE" | "TRANSITION_ERR" | "CANCELLED" | "DISPOSED" | "PLUGIN_CONFLICT" | "CONTEXT_NAMESPACE_ALREADY_CLAIMED";
|
|
18
18
|
/**
|
|
19
19
|
* Error code keys
|
|
20
20
|
*/
|
|
21
|
-
type ErrorCodeKeys = "ROUTER_NOT_STARTED" | "NO_START_PATH_OR_STATE" | "ROUTER_ALREADY_STARTED" | "ROUTE_NOT_FOUND" | "SAME_STATES" | "CANNOT_DEACTIVATE" | "CANNOT_ACTIVATE" | "TRANSITION_ERR" | "ROUTER_NOT_STOPPED" | "TRANSITION_CANCELLED" | "ROUTER_DISPOSED" | "PLUGIN_CONFLICT" | "CONTEXT_NAMESPACE_ALREADY_CLAIMED" | "REENTRANT_NAVIGATION" | "REENTRANT_TREE_MUTATION";
|
|
21
|
+
export type ErrorCodeKeys = "ROUTER_NOT_STARTED" | "NO_START_PATH_OR_STATE" | "ROUTER_ALREADY_STARTED" | "ROUTE_NOT_FOUND" | "SAME_STATES" | "CANNOT_DEACTIVATE" | "CANNOT_ACTIVATE" | "TRANSITION_ERR" | "ROUTER_NOT_STOPPED" | "TRANSITION_CANCELLED" | "ROUTER_DISPOSED" | "PLUGIN_CONFLICT" | "CONTEXT_NAMESPACE_ALREADY_CLAIMED" | "REENTRANT_NAVIGATION" | "REENTRANT_TREE_MUTATION";
|
|
22
22
|
/**
|
|
23
23
|
* Mapping of event keys to plugin methods
|
|
24
24
|
*/
|
|
25
|
-
interface EventToPluginMap {
|
|
25
|
+
export interface EventToPluginMap {
|
|
26
26
|
readonly ROUTER_START: "onStart";
|
|
27
27
|
readonly ROUTER_STOP: "onStop";
|
|
28
28
|
readonly TRANSITION_START: "onTransitionStart";
|
|
@@ -34,7 +34,7 @@ interface EventToPluginMap {
|
|
|
34
34
|
/**
|
|
35
35
|
* Mapping of event keys to event names
|
|
36
36
|
*/
|
|
37
|
-
interface EventToNameMap {
|
|
37
|
+
export interface EventToNameMap {
|
|
38
38
|
readonly ROUTER_START: "$start";
|
|
39
39
|
readonly ROUTER_STOP: "$stop";
|
|
40
40
|
readonly TRANSITION_START: "$$start";
|
|
@@ -47,11 +47,11 @@ interface EventToNameMap {
|
|
|
47
47
|
* Mapping of event names to plugin method names.
|
|
48
48
|
* Type-level computation from EventToNameMap + EventToPluginMap.
|
|
49
49
|
*/
|
|
50
|
-
type EventMethodMap = { [K in EventsKeys as EventToNameMap[K]]: EventToPluginMap[K]; };
|
|
50
|
+
export type EventMethodMap = { [K in EventsKeys as EventToNameMap[K]]: EventToPluginMap[K]; };
|
|
51
51
|
/**
|
|
52
52
|
* Mapping of error code keys to their values
|
|
53
53
|
*/
|
|
54
|
-
interface ErrorCodeToValueMap {
|
|
54
|
+
export interface ErrorCodeToValueMap {
|
|
55
55
|
readonly ROUTER_NOT_STARTED: "NOT_STARTED";
|
|
56
56
|
readonly NO_START_PATH_OR_STATE: "NO_START_PATH_OR_STATE";
|
|
57
57
|
readonly ROUTER_ALREADY_STARTED: "ALREADY_STARTED";
|
|
@@ -70,5 +70,4 @@ interface ErrorCodeToValueMap {
|
|
|
70
70
|
readonly WRONG_CHANNEL: "WRONG_CHANNEL";
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
|
-
export { ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventMethodMap, EventName, EventToNameMap, EventToPluginMap, EventsKeys, PluginMethod };
|
|
74
73
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../../src/types/constants.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../../src/types/constants.ts"],"mappings":";;;;YAGY;;;;YAYA;;;;YAYA;;;;YAYA;;;;YAiBA;;;;iBAoBK;WACN;WACA;WACA;WACA;WACA;WACA;WACA;;;;;iBAMM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;;;;;;YAOC,oBACT,KAAK,cAAc,eAAe,KAAK,iBAAiB;;;;iBAM1C;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","names":[],"sources":["../../../src/types/internal.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","names":[],"sources":["../../../src/types/internal.ts"],"mappings":";;;;;YAwDY,SAAS,SAAS"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Configuration for router resource limits.
|
|
4
4
|
* Controls maximum allowed values for various router operations to prevent resource exhaustion.
|
|
5
5
|
*/
|
|
6
|
-
interface LimitsConfig {
|
|
6
|
+
export interface LimitsConfig {
|
|
7
7
|
/**
|
|
8
8
|
* Maximum number of route dependencies allowed.
|
|
9
9
|
* Prevents circular dependency chains and excessive dependency graphs.
|
|
@@ -41,5 +41,4 @@ interface LimitsConfig {
|
|
|
41
41
|
maxLifecycleHandlers: number;
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
|
-
export { LimitsConfig };
|
|
45
44
|
//# sourceMappingURL=limits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","names":[],"sources":["../../../src/types/limits.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"limits.d.ts","names":[],"sources":["../../../src/types/limits.ts"],"mappings":";;;;;iBAIiB;;;;;;;EAOf;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA"}
|
|
@@ -3,7 +3,7 @@ import { ArrayFormat, BooleanFormat, NullFormat, NumberFormat } from "../engine/
|
|
|
3
3
|
/**
|
|
4
4
|
* Options for query parameter parsing and building.
|
|
5
5
|
*/
|
|
6
|
-
interface QueryParamsOptions {
|
|
6
|
+
export interface QueryParamsOptions {
|
|
7
7
|
arrayFormat?: ArrayFormat;
|
|
8
8
|
booleanFormat?: BooleanFormat;
|
|
9
9
|
nullFormat?: NullFormat;
|
|
@@ -12,21 +12,20 @@ interface QueryParamsOptions {
|
|
|
12
12
|
/**
|
|
13
13
|
* Controls how query parameters are handled during matching.
|
|
14
14
|
*/
|
|
15
|
-
type QueryParamsMode = "default" | "strict" | "loose";
|
|
15
|
+
export type QueryParamsMode = "default" | "strict" | "loose";
|
|
16
16
|
type ParamSource = "url" | "query";
|
|
17
17
|
type ParamTypeMap = Record<string, ParamSource>;
|
|
18
18
|
type RouteTreeStateMeta = Record<string, ParamTypeMap>;
|
|
19
|
-
interface RouteParams {
|
|
19
|
+
export interface RouteParams {
|
|
20
20
|
[key: string]: string | string[] | number | number[] | boolean | boolean[] | RouteParams | RouteParams[] | Record<string, string | number | boolean> | null | undefined;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Complete state representation of a matched route.
|
|
24
24
|
*/
|
|
25
|
-
interface RouteTreeState<P extends Record<string, unknown> = RouteParams> {
|
|
25
|
+
export interface RouteTreeState<P extends Record<string, unknown> = RouteParams> {
|
|
26
26
|
name: string;
|
|
27
27
|
params: P;
|
|
28
28
|
meta: RouteTreeStateMeta;
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
|
-
export { QueryParamsMode, QueryParamsOptions, RouteParams, RouteTreeState };
|
|
32
31
|
//# sourceMappingURL=route-node-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route-node-types.d.ts","names":[],"sources":["../../../src/types/route-node-types.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"route-node-types.d.ts","names":[],"sources":["../../../src/types/route-node-types.ts"],"mappings":";;;;;iBAwBiB;EACf,cAAc;EACd,gBAAgB;EAChB,aAAa;EACb,eAAe;;;;;YAUL;KAMP;KACA,eAAe,eAAe;KAC9B,qBAAqB,eAAe;iBAExB;GACd,4EAOG,cACA,gBACA;;;;;iBAQW,eACf,UAAU,0BAA0B;EAEpC;EACA,QAAQ;EACR,MAAM"}
|
|
@@ -3,10 +3,10 @@ import { NavigationTarget, Params, ParamsSearch, RouterError, SearchParams, Stat
|
|
|
3
3
|
import { LimitsConfig } from "./limits.js";
|
|
4
4
|
import { NavigationOptions } from "../types.js";
|
|
5
5
|
//#region src/types/router.d.ts
|
|
6
|
-
type LogLevel = "log" | "warn" | "error";
|
|
7
|
-
type LogLevelConfig = "all" | "warn-error" | "error-only" | "none";
|
|
8
|
-
type LogCallback = (level: LogLevel, context: string, message: string, ...args: unknown[]) => void;
|
|
9
|
-
interface LoggerConfig {
|
|
6
|
+
export type LogLevel = "log" | "warn" | "error";
|
|
7
|
+
export type LogLevelConfig = "all" | "warn-error" | "error-only" | "none";
|
|
8
|
+
export type LogCallback = (level: LogLevel, context: string, message: string, ...args: unknown[]) => void;
|
|
9
|
+
export interface LoggerConfig {
|
|
10
10
|
level: LogLevelConfig;
|
|
11
11
|
callback?: LogCallback | undefined;
|
|
12
12
|
callbackIgnoresLevel?: boolean;
|
|
@@ -22,7 +22,7 @@ interface LoggerConfig {
|
|
|
22
22
|
* interface is the shared contract, so nothing outside core needs to import the
|
|
23
23
|
* class (or depend on the former standalone `@real-router/logger` package).
|
|
24
24
|
*/
|
|
25
|
-
interface RouterLogger {
|
|
25
|
+
export interface RouterLogger {
|
|
26
26
|
log: (context: string, message: string, ...args: unknown[]) => void;
|
|
27
27
|
warn: (context: string, message: string, ...args: unknown[]) => void;
|
|
28
28
|
error: (context: string, message: string, ...args: unknown[]) => void;
|
|
@@ -31,22 +31,22 @@ interface RouterLogger {
|
|
|
31
31
|
* Callback function for dynamically resolving the default route.
|
|
32
32
|
* Receives a dependency getter function to access router dependencies.
|
|
33
33
|
*/
|
|
34
|
-
type DefaultRouteCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => string;
|
|
34
|
+
export type DefaultRouteCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => string;
|
|
35
35
|
/**
|
|
36
36
|
* Callback function for dynamically resolving the forward target route.
|
|
37
37
|
* Receives a dependency getter function and current route parameters.
|
|
38
38
|
*/
|
|
39
|
-
type ForwardToCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K], params: Params) => string;
|
|
39
|
+
export type ForwardToCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K], params: Params) => string;
|
|
40
40
|
/**
|
|
41
41
|
* Callback function for dynamically resolving the default parameters.
|
|
42
42
|
* Receives a dependency getter function to access router dependencies.
|
|
43
43
|
*/
|
|
44
|
-
type DefaultParamsCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => Params;
|
|
44
|
+
export type DefaultParamsCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => Params;
|
|
45
45
|
/**
|
|
46
46
|
* Callback function for dynamically resolving the default query params.
|
|
47
47
|
* Receives a dependency getter function to access router dependencies.
|
|
48
48
|
*/
|
|
49
|
-
type DefaultSearchCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => SearchParams;
|
|
49
|
+
export type DefaultSearchCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => SearchParams;
|
|
50
50
|
/**
|
|
51
51
|
* Router configuration options.
|
|
52
52
|
*
|
|
@@ -59,7 +59,7 @@ type DefaultSearchCallback<Dependencies = object> = (getDependency: <K extends k
|
|
|
59
59
|
* and every consumer that reads configuration rather than resolving it —
|
|
60
60
|
* takes {@link AnyOptions} instead of infecting itself with the parameter.
|
|
61
61
|
*/
|
|
62
|
-
interface Options<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
62
|
+
export interface Options<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
63
63
|
/**
|
|
64
64
|
* Default route to navigate to on start.
|
|
65
65
|
* Empty string means no default route.
|
|
@@ -199,10 +199,10 @@ interface Options<Dependencies extends DefaultDependencies = DefaultDependencies
|
|
|
199
199
|
* Every field stays visible; only the callbacks become uncallable, which is
|
|
200
200
|
* honest — a plugin has no dependency map to resolve them against.
|
|
201
201
|
*/
|
|
202
|
-
type AnyOptions = Options<never>;
|
|
203
|
-
type GuardFn = (toState: State, fromState: State | undefined, signal?: AbortSignal) => boolean | Promise<boolean>;
|
|
204
|
-
type DefaultDependencies = object;
|
|
205
|
-
interface Plugin {
|
|
202
|
+
export type AnyOptions = Options<never>;
|
|
203
|
+
export type GuardFn = (toState: State, fromState: State | undefined, signal?: AbortSignal) => boolean | Promise<boolean>;
|
|
204
|
+
export type DefaultDependencies = object;
|
|
205
|
+
export interface Plugin {
|
|
206
206
|
onStart?: () => void;
|
|
207
207
|
onStop?: () => void;
|
|
208
208
|
onTransitionStart?: (toState: State, fromState?: State) => void;
|
|
@@ -212,24 +212,24 @@ interface Plugin {
|
|
|
212
212
|
onTransitionSuccess?: (toState: State, fromState: State | undefined, opts: NavigationOptions) => void;
|
|
213
213
|
teardown?: () => void;
|
|
214
214
|
}
|
|
215
|
-
interface SubscribeState {
|
|
215
|
+
export interface SubscribeState {
|
|
216
216
|
route: State;
|
|
217
217
|
previousRoute?: State | undefined;
|
|
218
218
|
}
|
|
219
|
-
type SubscribeFn = (state: SubscribeState) => void;
|
|
220
|
-
interface LeaveState {
|
|
219
|
+
export type SubscribeFn = (state: SubscribeState) => void;
|
|
220
|
+
export interface LeaveState {
|
|
221
221
|
route: State;
|
|
222
222
|
nextRoute: State;
|
|
223
223
|
signal: AbortSignal;
|
|
224
224
|
}
|
|
225
|
-
type LeaveFn = (state: LeaveState) => void | Promise<void>;
|
|
226
|
-
interface Listener {
|
|
225
|
+
export type LeaveFn = (state: LeaveState) => void | Promise<void>;
|
|
226
|
+
export interface Listener {
|
|
227
227
|
[key: string]: unknown;
|
|
228
228
|
next: (val: unknown) => void;
|
|
229
229
|
error?: (err: unknown) => void;
|
|
230
230
|
complete?: () => void;
|
|
231
231
|
}
|
|
232
|
-
interface Subscription {
|
|
232
|
+
export interface Subscription {
|
|
233
233
|
unsubscribe: Unsubscribe;
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
@@ -241,7 +241,7 @@ interface Subscription {
|
|
|
241
241
|
*
|
|
242
242
|
* For full router access, use the Router interface directly or the useRouter() hook.
|
|
243
243
|
*/
|
|
244
|
-
interface Navigator {
|
|
244
|
+
export interface Navigator {
|
|
245
245
|
navigate: {
|
|
246
246
|
(target: NavigationTarget, options?: NavigationOptions): Promise<State>;
|
|
247
247
|
(routeName: string, routeParams?: Params, routeSearch?: SearchParams, options?: NavigationOptions): Promise<State>;
|
|
@@ -260,7 +260,7 @@ interface Navigator {
|
|
|
260
260
|
* Factory types (PluginFactory, GuardFnFactory) self-reference this interface
|
|
261
261
|
* within the same file to avoid circular dependencies.
|
|
262
262
|
*/
|
|
263
|
-
interface Router<D extends DefaultDependencies = DefaultDependencies> {
|
|
263
|
+
export interface Router<D extends DefaultDependencies = DefaultDependencies> {
|
|
264
264
|
[key: string]: unknown;
|
|
265
265
|
isActiveRoute: (name: string, params?: Params, search?: SearchParams, strictEquality?: boolean, ignoreQueryParams?: boolean) => boolean;
|
|
266
266
|
buildPath: (route: string, params?: Params, search?: SearchParams) => string;
|
|
@@ -288,16 +288,16 @@ interface Router<D extends DefaultDependencies = DefaultDependencies> {
|
|
|
288
288
|
* Factory function for creating plugins.
|
|
289
289
|
* Receives the router instance and a dependency getter.
|
|
290
290
|
*/
|
|
291
|
-
type PluginFactory<Dependencies extends DefaultDependencies = DefaultDependencies> = (router: Router<Dependencies>, getDependency: <K extends keyof Dependencies>(key: K) => Dependencies[K]) => Plugin;
|
|
291
|
+
export type PluginFactory<Dependencies extends DefaultDependencies = DefaultDependencies> = (router: Router<Dependencies>, getDependency: <K extends keyof Dependencies>(key: K) => Dependencies[K]) => Plugin;
|
|
292
292
|
/**
|
|
293
293
|
* Factory function for creating guards.
|
|
294
294
|
* Receives the router instance and a dependency getter.
|
|
295
295
|
*/
|
|
296
|
-
type GuardFnFactory<Dependencies extends DefaultDependencies = DefaultDependencies> = (router: Router<Dependencies>, getDependency: <K extends keyof Dependencies>(key: K) => Dependencies[K]) => GuardFn;
|
|
296
|
+
export type GuardFnFactory<Dependencies extends DefaultDependencies = DefaultDependencies> = (router: Router<Dependencies>, getDependency: <K extends keyof Dependencies>(key: K) => Dependencies[K]) => GuardFn;
|
|
297
297
|
/**
|
|
298
298
|
* Route configuration.
|
|
299
299
|
*/
|
|
300
|
-
interface Route<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
300
|
+
export interface Route<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
301
301
|
[key: string]: unknown;
|
|
302
302
|
/** Route name (dot-separated for nested routes). */
|
|
303
303
|
name: string;
|
|
@@ -383,7 +383,7 @@ type ReadonlyDeep<T> = T extends ((...args: never[]) => unknown) ? T : T extends
|
|
|
383
383
|
* on the read side. Tightening `Route` itself is what this avoids — a caller
|
|
384
384
|
* building a route literal must still be able to write to it.
|
|
385
385
|
*/
|
|
386
|
-
type ReadonlyRoute<Dependencies extends DefaultDependencies = DefaultDependencies> = ReadonlyDeep<Route<Dependencies>>;
|
|
386
|
+
export type ReadonlyRoute<Dependencies extends DefaultDependencies = DefaultDependencies> = ReadonlyDeep<Route<Dependencies>>;
|
|
387
387
|
/**
|
|
388
388
|
* Configuration update options for `updateRoute()`.
|
|
389
389
|
*
|
|
@@ -409,7 +409,7 @@ type ReadonlyRoute<Dependencies extends DefaultDependencies = DefaultDependencie
|
|
|
409
409
|
* use `remove` + `add` to restructure. The interface stays closed (no index
|
|
410
410
|
* signature) so typos in structural field names remain compile errors.
|
|
411
411
|
*/
|
|
412
|
-
interface RouteConfigUpdate<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
412
|
+
export interface RouteConfigUpdate<Dependencies extends DefaultDependencies = DefaultDependencies> {
|
|
413
413
|
/** Set to null to remove forwardTo */
|
|
414
414
|
forwardTo?: string | ForwardToCallback<Dependencies> | null;
|
|
415
415
|
/** Set to null to remove defaultParams */
|
|
@@ -426,5 +426,4 @@ interface RouteConfigUpdate<Dependencies extends DefaultDependencies = DefaultDe
|
|
|
426
426
|
canDeactivate?: GuardFnFactory<Dependencies> | null;
|
|
427
427
|
}
|
|
428
428
|
//#endregion
|
|
429
|
-
export { AnyOptions, DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, DefaultSearchCallback, ForwardToCallback, GuardFn, GuardFnFactory, LeaveFn, LeaveState, Listener, LogCallback, LogLevel, LogLevelConfig, LoggerConfig, Navigator, Options, Plugin, PluginFactory, ReadonlyRoute, Route, RouteConfigUpdate, Router, RouterLogger, SubscribeFn, SubscribeState, Subscription };
|
|
430
429
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","names":[],"sources":["../../../src/types/router.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"router.d.ts","names":[],"sources":["../../../src/types/router.ts"],"mappings":";;;;;YA4BY;YAEA;YAEA,eACV,OAAO,UACP,iBACA,oBACG;iBAGY;EACf,OAAO;EACP,WAAW;EACX;;;;;;;;;;;;;iBAce;EACf,MAAM,iBAAiB,oBAAoB;EAC3C,OAAO,iBAAiB,oBAAoB;EAC5C,QAAQ,iBAAiB,oBAAoB;;;;;;YAOnC,qBAAqB,0BAC/B,gBAAgB,gBAAgB,cAAc,MAAM,MAAM,aAAa;;;;;YAO7D,kBAAkB,0BAC5B,gBAAgB,gBAAgB,cAAc,MAAM,MAAM,aAAa,IACvE,QAAQ;;;;;YAOE,sBAAsB,0BAChC,gBAAgB,gBAAgB,cAAc,MAAM,MAAM,aAAa,OACpE;;;;;YAMO,sBAAsB,0BAChC,gBAAgB,gBAAgB,cAAc,MAAM,MAAM,aAAa,OACpE;;;;;;;;;;;;;iBAcY,QACf,qBAAqB,sBAAsB;;;;;;;EAQ3C,uBAAuB,qBAAqB;;;;;;;;;;;;;EAc5C,eAAe,SAAS,sBAAsB;;;;;;;;;;;;;;;;EAiB9C,eAAe,eAAe,sBAAsB;;;;;;;;;;;;;EAcpD;;;;;;;;;;;;;;;;;;EAmBA;;;;;;;;;;EAWA;;;;;;EAOA,iBAAiB;;;;;;;;;;;EAYjB,cAAc;;;;;;;EAQd;;;;;;;;;;EAWA;;;;;;EAOA,SAAS,QAAQ;;;;;;;EAQjB,SAAS,QAAQ;;;;;;;;;;;;;;;;YAiBP,aAAa;YAEb,WACV,SAAS,OACT,WAAW,mBACX,SAAS,0BACI;YAEH;iBAEK;EACf;EACA;EACA,qBAAqB,SAAS,OAAO,YAAY;EACjD,4BAA4B,SAAS,OAAO,YAAY;EACxD,sBAAsB,SAAS,OAAO,YAAY;EAClD,qBACE,SAAS,mBACT,WAAW,mBACX,KAAK;EAEP,uBACE,SAAS,OACT,WAAW,mBACX,MAAM;EAER;;iBAGe;EACf,OAAO;EACP,gBAAgB;;YAGN,eAAe,OAAO;iBAEjB;EACf,OAAO;EACP,WAAW;EACX,QAAQ;;YAGE,WAAW,OAAO,sBAAsB;iBAEnC;GACd;EACD,OAAO;EACP,SAAS;EACT;;iBAGe;EACf,aAAa;;;;;;;;;;;iBAYE;EAGf;KACG,QAAQ,kBAAkB,UAAU,oBAAoB,QAAQ;KAE/D,mBACA,cAAc,QACd,cAAc,cACd,UAAU,oBACT,QAAQ;;EAEb,gBAAgB;EAChB,gBACE,cACA,SAAS,QACT,SAAS,cACT,0BACA;EAEF,gBACE,cACA,SAAS,QACT,SAAS;EAEX,YAAY,UAAU,gBAAgB;EACtC,iBAAiB,UAAU,YAAY;EACvC;;;;;;;;;iBAUe,OAAO,UAAU,sBAAsB;GAGrD;EAED,gBACE,cACA,SAAS,QACT,SAAS,cACT,0BACA;EAGF,YAAY,eAAe,SAAS,QAAQ,SAAS;EAErD,WAAW,UAAU,SAAS,aAAa,MAAM;EAEjD,wBAAwB;EAExB,iBACE,QAAQ,mBACR,QAAQ,mBACR;EAGF,mBACE,sBACI,SAAS,OAAO,YAAY;EAElC;EAEA,QAAQ,sBAAsB,QAAQ;EAEtC;EAEA;EAEA,gBACE,cACA,SAAS,QACT,SAAS;EAGX,eACK,UAAU,cAAc,qCACxB;EAEL,YAAY,UAAU,gBAAgB;EAEtC,iBAAiB,UAAU,YAAY;EAEvC;EAIA;KACG,QAAQ,kBAAkB,UAAU,oBAAoB,QAAQ;KAE/D,mBACA,cAAc,QACd,cAAc,cACd,UAAU,oBACT,QAAQ;;EAGb,oBAAoB,UAAU,sBAAsB,QAAQ;EAE5D,qBAAqB,kBAAkB;;;;;;YAW7B,cACV,qBAAqB,sBAAsB,wBAE3C,QAAQ,OAAO,eACf,gBAAgB,gBAAgB,cAAc,KAAK,MAAM,aAAa,OACnE;;;;;YAMO,eACV,qBAAqB,sBAAsB,wBAE3C,QAAQ,OAAO,eACf,gBAAgB,gBAAgB,cAAc,KAAK,MAAM,aAAa,OACnE;;;;iBASY,MACf,qBAAqB,sBAAsB;GAE1C;;EAED;;EAEA;;EAEA,cAAc,eAAe;;EAE7B,gBAAgB,eAAe;;;;;;;;;;EAU/B,qBAAqB,kBAAkB;;EAEvC,WAAW,MAAM;;;;;;;;EAQjB,gBAAgB,UAAU,iBAAiB;;;;;;;EAO3C,gBAAgB,UAAU,iBAAiB;;;;;;;;;;;;;;;;;;EAkB3C,gBAAgB;;;;;;;;;EAShB,gBAAgB;;;;;;;;;KAUb,aAAa,KAAK,eAAc,6BACjC,IACA,+BACc,aAAa,IAAI,aAAa,EAAE,WAC5C;;;;;;;;;;;;;;YAeM,cACV,qBAAqB,sBAAsB,uBACzC,aAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BN,kBACf,qBAAqB,sBAAsB;;EAG3C,qBAAqB,kBAAkB;;EAEvC,gBAAgB;;EAEhB,gBAAgB;;EAEhB,iBAAiB,UAAU,iBAAiB;;EAE5C,iBAAiB,UAAU,iBAAiB;;EAE5C,cAAc,eAAe;;EAE7B,gBAAgB,eAAe"}
|