@real-router/core 0.158.0 → 0.160.0

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.
Files changed (64) hide show
  1. package/README.md +3 -0
  2. package/dist/cjs/{Router-CjpauUGY.js → Router-DbBgEU2F.js} +2 -2
  3. package/dist/cjs/Router-DbBgEU2F.js.map +1 -0
  4. package/dist/cjs/api/getRoutesApi.d.ts.map +1 -1
  5. package/dist/cjs/api.js +1 -1
  6. package/dist/cjs/api.js.map +1 -1
  7. package/dist/cjs/constants.d.ts +4 -0
  8. package/dist/cjs/constants.d.ts.map +1 -1
  9. package/dist/cjs/helpers-CfUevk4y.js +2 -0
  10. package/dist/cjs/helpers-CfUevk4y.js.map +1 -0
  11. package/dist/cjs/index.d.ts +2 -2
  12. package/dist/cjs/index.js +1 -1
  13. package/dist/cjs/{internals-CGNdQfzl.js → internals-gDdMsyUG.js} +2 -2
  14. package/dist/cjs/{internals-CGNdQfzl.js.map → internals-gDdMsyUG.js.map} +1 -1
  15. package/dist/cjs/namespaces/RoutesNamespace/routesStore.d.ts.map +1 -1
  16. package/dist/cjs/namespaces/RoutesNamespace/types.d.ts +2 -2
  17. package/dist/cjs/namespaces/RoutesNamespace/types.d.ts.map +1 -1
  18. package/dist/cjs/types/RouterValidator.d.ts +2 -2
  19. package/dist/cjs/types/RouterValidator.d.ts.map +1 -1
  20. package/dist/cjs/types/base.d.ts +56 -23
  21. package/dist/cjs/types/base.d.ts.map +1 -1
  22. package/dist/cjs/types/constants.d.ts +11 -10
  23. package/dist/cjs/types/constants.d.ts.map +1 -1
  24. package/dist/cjs/types/router.d.ts +15 -14
  25. package/dist/cjs/types/router.d.ts.map +1 -1
  26. package/dist/cjs/types.d.ts +2 -2
  27. package/dist/cjs/types.d.ts.map +1 -1
  28. package/dist/cjs/utils.js +1 -1
  29. package/dist/cjs/validation.js +1 -1
  30. package/dist/esm/{Router-Dt2la4K2.mjs → Router-BL2iFYTJ.mjs} +2 -2
  31. package/dist/esm/Router-BL2iFYTJ.mjs.map +1 -0
  32. package/dist/esm/api/getRoutesApi.d.mts.map +1 -1
  33. package/dist/esm/api.mjs +1 -1
  34. package/dist/esm/api.mjs.map +1 -1
  35. package/dist/esm/constants.d.mts +4 -0
  36. package/dist/esm/constants.d.mts.map +1 -1
  37. package/dist/esm/helpers-BFYPM3MT.mjs +2 -0
  38. package/dist/esm/helpers-BFYPM3MT.mjs.map +1 -0
  39. package/dist/esm/index.d.mts +2 -2
  40. package/dist/esm/index.mjs +1 -1
  41. package/dist/esm/{internals-CLQmmAMr.mjs → internals-aMV-QSMA.mjs} +2 -2
  42. package/dist/esm/{internals-CLQmmAMr.mjs.map → internals-aMV-QSMA.mjs.map} +1 -1
  43. package/dist/esm/namespaces/RoutesNamespace/routesStore.d.mts.map +1 -1
  44. package/dist/esm/namespaces/RoutesNamespace/types.d.mts +2 -2
  45. package/dist/esm/namespaces/RoutesNamespace/types.d.mts.map +1 -1
  46. package/dist/esm/types/RouterValidator.d.mts +2 -2
  47. package/dist/esm/types/RouterValidator.d.mts.map +1 -1
  48. package/dist/esm/types/base.d.mts +56 -23
  49. package/dist/esm/types/base.d.mts.map +1 -1
  50. package/dist/esm/types/constants.d.mts +11 -10
  51. package/dist/esm/types/constants.d.mts.map +1 -1
  52. package/dist/esm/types/router.d.mts +15 -14
  53. package/dist/esm/types/router.d.mts.map +1 -1
  54. package/dist/esm/types.d.mts +2 -2
  55. package/dist/esm/types.d.mts.map +1 -1
  56. package/dist/esm/utils.mjs +1 -1
  57. package/dist/esm/validation.mjs +1 -1
  58. package/package.json +1 -1
  59. package/dist/cjs/Router-CjpauUGY.js.map +0 -1
  60. package/dist/cjs/helpers-iJq-DSS7.js +0 -2
  61. package/dist/cjs/helpers-iJq-DSS7.js.map +0 -1
  62. package/dist/esm/Router-Dt2la4K2.mjs.map +0 -1
  63. package/dist/esm/helpers-D5eyVTyF.mjs +0 -2
  64. package/dist/esm/helpers-D5eyVTyF.mjs.map +0 -1
@@ -103,29 +103,39 @@ export interface NavigationTarget<P extends Params = Params, S extends SearchPar
103
103
  search?: S;
104
104
  }
105
105
  /**
106
- * The two navigation channels a per-route codec operates on (RFC-4 M2 / #1548):
107
- * `params` is the path channel, `search` the query channel. Used as **both** the
108
- * input and the output of {@link Route.encodeParams} / {@link Route.decodeParams}
109
- * — a codec transforms whichever channel(s) it owns and returns the other channel
110
- * unchanged (it must be passed through explicitly).
106
+ * The two navigation channels (RFC-4 M2 / #1548): `params` is the path channel,
107
+ * `search` the query channel. With the default arguments it is the STATE side
108
+ * of a per-route codec (#2834): what {@link Route.decodeParams} returns and what
109
+ * {@link Route.encodeParams} receives and returns. A codec transforms the
110
+ * channel(s) it owns and passes the other through.
111
111
  *
112
- * @remarks
113
- * v1 ran the whole (path + query) bag through both callbacks, so a query value
114
- * reached `decodeParams`. This two-channel shape preserves that reach: the query
115
- * arrives in `search` rather than merged into `params`. Value semantics are
116
- * unchanged — only the storage location differs (M2 keeps query parsing/printing
117
- * exactly as v1).
112
+ * The URL side is {@link UrlChannels}, what `decodeParams` receives.
118
113
  */
119
114
  export interface ParamsSearch<P extends Params = Params, S extends SearchParams = SearchParams> {
120
115
  params: P;
121
116
  search: S;
122
117
  }
118
+ /**
119
+ * The URL side of a per-route codec (#2834): what {@link Route.decodeParams}
120
+ * receives. Path slots are the strings the matcher captured; query values are
121
+ * typed by the parser.
122
+ *
123
+ * `encodeParams` returns into the URL and is still typed {@link ParamsSearch}:
124
+ * an encoder hands on a channel it does not own — `search` as it came, or
125
+ * `{ ...search }` with nothing after it — and that channel holds state values,
126
+ * so a URL-typed return would refuse the encoder. The wiki's Dates recipe,
127
+ * which `codec-state-values-2834.test.ts` type-checks, hands on `params`.
128
+ */
129
+ export type UrlChannels = ParamsSearch<Record<string, string>, Record<string, SearchParamValue | undefined>>;
123
130
  /**
124
131
  * Parsed shape produced by `serializeRouterState()` (`@real-router/ssr-utils`,
125
132
  * after `JSON.parse`). Identical to {@link State} minus `transition`
126
133
  * (per-navigation `TransitionMeta` is meaningless after hydration; the client
127
134
  * builds its own on commit). Defined here, not in `ssr-utils`, because the
128
135
  * shape is core's own `State`; `ssr-utils` re-exports it.
136
+ *
137
+ * ⚠ Under the default `JSON.parse`, a `Date` in a channel comes back as its ISO
138
+ * string, and an Invalid Date as `null`.
129
139
  */
130
140
  export type SerializedRouterState<P extends Params = Params> = Omit<State<P>, "transition">;
131
141
  /**
@@ -145,26 +155,49 @@ export interface RouterError extends Error {
145
155
  getField: (key: string) => unknown;
146
156
  toJSON: () => Record<string, unknown>;
147
157
  }
158
+ /**
159
+ * A value a state channel carries (#2834): a JSON primitive, a `Date`, a plain
160
+ * object of state values, an array of any of those, or `undefined`. An array
161
+ * holds no `undefined`, which JSON would print as `null`. It is what
162
+ * {@link State.params} and {@link State.search} hold, what `navigate` and route
163
+ * defaults take, and what a route's `decodeParams` may return.
164
+ *
165
+ * Core compares these by value — a `Date` by its time, a plain object by its
166
+ * JSON (`areParamValuesEqual`) — and `@real-router/sources`' `canonicalJson`
167
+ * builds a cache key from them and refuses any other object.
168
+ *
169
+ * A URL holds less: a path slot is a string and a query value a
170
+ * {@link SearchParamValue}. A route codec converts between the two; without
171
+ * one, a `Date` or an object does not survive the trip through the URL.
172
+ */
173
+ export type ParamValue = ParamLeaf | ParamLeaf[] | undefined;
174
+ /**
175
+ * A {@link ParamValue} that is neither an array nor `undefined`.
176
+ *
177
+ * ⚠ One array level, not a recursive `ParamValue[]`: the recursive form fails
178
+ * core's type-check with TS2589.
179
+ */
180
+ type ParamLeaf = string | number | boolean | null | Date | Params;
181
+ /** The path channel, {@link State.params}: path slots and app-level data. */
148
182
  export interface Params {
149
- [key: string]: string | string[] | number | number[] | boolean | boolean[] | Params | Params[] | Record<string, string | number | boolean> | null | undefined;
183
+ [key: string]: ParamValue;
150
184
  }
151
185
  /**
152
- * Query-parameter primitive values. Mirrors the engine's `QueryParamPrimitive`
153
- * (`engine/search-params/types.ts`) — the value form is identical to v1's query
154
- * half (the union produced across `queryParamsMode` formats).
186
+ * A primitive query value as the URL parser types it. Mirrors the engine's
187
+ * `QueryParamPrimitive` (`engine/search-params/types.ts`).
155
188
  */
156
189
  export type SearchParamPrimitive = string | number | boolean | null;
157
190
  /**
158
- * A single query-parameter value — a primitive or an array of primitives.
191
+ * A single query value as the URL parser types it — a primitive or an array of
192
+ * primitives. It is what `decodeParams` receives ({@link UrlChannels}); the
193
+ * state side carries a {@link ParamValue}.
159
194
  */
160
195
  export type SearchParamValue = SearchParamPrimitive | SearchParamPrimitive[];
161
196
  /**
162
- * Query-parameter bag carried by {@link State.search} — the query channel,
163
- * split out of the former single `params` bag in M2 (RFC-4 M2 / #1548). Only
164
- * the storage location changes vs v1; value semantics (modes, `queryParamsMode`,
165
- * ternary arrays) are unchanged. Structurally matches the engine's internal
166
- * `SearchParams` (`engine/search-params/types.ts`), so match results flow into
167
- * `State.search` without conversion.
197
+ * The query channel, {@link State.search} (RFC-4 M2 / #1548). Its values are
198
+ * state values (#2834); what the URL parser produces for it is a
199
+ * {@link SearchParamValue}, which is one.
168
200
  */
169
- export type SearchParams = Record<string, SearchParamValue | undefined>;
201
+ export type SearchParams = Record<string, ParamValue>;
202
+ export {};
170
203
  //# sourceMappingURL=base.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.mts","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,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ACX,cAAc;;;;;;;;;;;;;;;;;YAkBJ,aAAa,YAAY;;;;;;;KAQhC,+CAA+C,OAAO;;iBAG1C;GACd,cAAc;;;;;;YAOL;;;;;;YAOA,mBAAmB,uBAAuB;;;;;;YAO1C,eAAe,eAAe"}
@@ -10,14 +10,6 @@ export type EventName = "$start" | "$stop" | "$$start" | "$$leaveApprove" | "$$c
10
10
  * Event type keys
11
11
  */
12
12
  export type EventsKeys = "ROUTER_START" | "ROUTER_STOP" | "TRANSITION_START" | "TRANSITION_LEAVE_APPROVE" | "TRANSITION_CANCEL" | "TRANSITION_SUCCESS" | "TRANSITION_ERROR";
13
- /**
14
- * Error code values
15
- */
16
- 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";
17
- /**
18
- * Error code keys
19
- */
20
- 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";
21
13
  /**
22
14
  * Mapping of event keys to plugin methods
23
15
  */
@@ -48,11 +40,12 @@ export interface EventToNameMap {
48
40
  */
49
41
  export type EventMethodMap = { [K in EventsKeys as EventToNameMap[K]]: EventToPluginMap[K]; };
50
42
  /**
51
- * Mapping of error code keys to their values
43
+ * Mapping of error code keys to their values — the one declaration of the
44
+ * error-code vocabulary. `ErrorCodeKeys` and `ErrorCodeValues` are derived
45
+ * from it, and the `errorCodes` literal is held to it by `satisfies`.
52
46
  */
53
47
  export interface ErrorCodeToValueMap {
54
48
  readonly ROUTER_NOT_STARTED: "NOT_STARTED";
55
- readonly NO_START_PATH_OR_STATE: "NO_START_PATH_OR_STATE";
56
49
  readonly ROUTER_ALREADY_STARTED: "ALREADY_STARTED";
57
50
  readonly ROUTE_NOT_FOUND: "ROUTE_NOT_FOUND";
58
51
  readonly SAME_STATES: "SAME_STATES";
@@ -68,4 +61,12 @@ export interface ErrorCodeToValueMap {
68
61
  readonly REENTRANT_TREE_MUTATION: "REENTRANT_TREE_MUTATION";
69
62
  readonly WRONG_CHANNEL: "WRONG_CHANNEL";
70
63
  }
64
+ /**
65
+ * Error code keys — the keys of `ErrorCodeToValueMap`.
66
+ */
67
+ export type ErrorCodeKeys = keyof ErrorCodeToValueMap;
68
+ /**
69
+ * Error code values — the values of `ErrorCodeToValueMap`.
70
+ */
71
+ export type ErrorCodeValues = ErrorCodeToValueMap[ErrorCodeKeys];
71
72
  //# sourceMappingURL=constants.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.mts","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
+ {"version":3,"file":"constants.d.mts","names":[],"sources":["../../../src/types/constants.ts"],"mappings":";;;YAGY;;;;YAYA;;;;YAYA;;;;iBAYK;WACN;WACA;WACA;WACA;WACA;WACA;WACA;;;;;iBAMM;WACN;WACA;WACA;WACA;WACA;WACA;WACA;;;;;;YAOC,oBACT,KAAK,cAAc,eAAe,KAAK,iBAAiB;;;;;;iBAQ1C;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;YAMC,sBAAsB;;;;YAKtB,kBAAkB,oBAAoB"}
@@ -1,5 +1,5 @@
1
1
  import { QueryParamsMode, QueryParamsOptions } from "./route-node-types.mjs";
2
- import { NavigationTarget, Params, ParamsSearch, RouterError, SearchParams, State, Unsubscribe } from "./base.mjs";
2
+ import { NavigationTarget, Params, ParamsSearch, RouterError, SearchParams, State, Unsubscribe, UrlChannels } from "./base.mjs";
3
3
  import { LimitsConfig } from "./limits.mjs";
4
4
  import { NavigationOptions } from "../types.mjs";
5
5
  export type LogLevel = "log" | "warn" | "error";
@@ -15,12 +15,11 @@ export interface LoggerConfig {
15
15
  * consume.
16
16
  *
17
17
  * Core stores a concrete instance on `RouterInternals.logger` (built from
18
- * `options.logger` in the `Router` constructor); plugins and other consumers
19
- * reach that same per-instance logger via `getInternals(router).logger` —
20
- * `PluginApi` carries no `logger` member of its own. The
18
+ * `options.logger` in the `Router` constructor); a plugin reaches it through
19
+ * `PluginApi.logger`, a frozen view that delegates every call to it. The
21
20
  * concrete `RouterLogger` class lives in core's `utils/logger` — this
22
21
  * interface is the shared contract, so nothing outside core needs to import the
23
- * class (or depend on the former standalone `@real-router/logger` package).
22
+ * class.
24
23
  */
25
24
  export interface RouterLogger {
26
25
  log: (context: string, message: string, ...args: unknown[]) => void;
@@ -338,17 +337,19 @@ export interface Route<Dependencies extends DefaultDependencies = DefaultDepende
338
337
  children?: Route<Dependencies>[];
339
338
  /**
340
339
  * Encodes the state channels to URL channels before path building (RFC-4 M2 /
341
- * #1548). Receives `{ params, search }` and returns `{ params, search }` —
342
- * transform whichever channel you own and pass the other through. The path
343
- * slots are built from the returned `params`, the query string from the
344
- * returned `search`.
340
+ * #1548). Receives `{ params, search }` holding state values and returns
341
+ * `{ params, search }` — transform whichever channel you own and pass the
342
+ * other through. The path slots are built from the returned `params`, the
343
+ * query string from the returned `search`.
345
344
  */
346
345
  encodeParams?: (channels: ParamsSearch) => ParamsSearch;
347
346
  /**
348
347
  * Decodes the matched URL channels to state channels (RFC-4 M2 / #1548).
349
- * Receives `{ params, search }` (path params + parsed query) and returns
350
- * `{ params, search }`. Runs inside `matchPath`, **before** any search-schema
351
- * plugin validation — the v1 transformation order (engine codec → plugin).
348
+ * Receives {@link UrlChannels} — path slots as strings, query values as the
349
+ * parser typed them — and returns `{ params, search }` holding state values,
350
+ * such as a `Date` (#2834). Runs inside `matchPath`, **before** any
351
+ * search-schema plugin validation — the v1 transformation order (engine
352
+ * codec → plugin).
352
353
  *
353
354
  * Only the URL side runs it: `navigate`, `buildPath` and `makeState` take
354
355
  * params in the form it returns. So it must undo `encodeParams` and add no
@@ -358,7 +359,7 @@ export interface Route<Dependencies extends DefaultDependencies = DefaultDepende
358
359
  * `@real-router/validation-plugin` runs the pair on each state a navigation
359
360
  * commits and warns about a key that does not come back.
360
361
  */
361
- decodeParams?: (channels: ParamsSearch) => ParamsSearch;
362
+ decodeParams?: (channels: UrlChannels) => ParamsSearch;
362
363
  /**
363
364
  * Default **path** parameters for this route (and arbitrary app-level
364
365
  * defaults). Merged into `state.params`; missing path params are filled from
@@ -442,7 +443,7 @@ export interface RouteConfigUpdate<Dependencies extends DefaultDependencies = De
442
443
  /** Set to null to remove defaultSearch (RFC-4 M2 / #1548) */
443
444
  defaultSearch?: SearchParams | null;
444
445
  /** Set to null to remove decoder */
445
- decodeParams?: ((channels: ParamsSearch) => ParamsSearch) | null;
446
+ decodeParams?: ((channels: UrlChannels) => ParamsSearch) | null;
446
447
  /** Set to null to remove encoder */
447
448
  encodeParams?: ((channels: ParamsSearch) => ParamsSearch) | null;
448
449
  /** Set to null to remove canActivate */
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.mts","names":[],"sources":["../../../src/types/router.ts"],"mappings":";;;;YA4BY;YAEA;YAEA,eACV,OAAO,UACP,i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,iBAAiB,UAAU,gBAAgB;;EAE3C,iBAAiB,UAAU,iBAAiB;;EAE5C,cAAc,eAAe;;EAE7B,gBAAgB,eAAe"}
@@ -1,5 +1,5 @@
1
1
  import { QueryParamsMode, QueryParamsOptions, RouteParams, RouteTreeState } from "./types/route-node-types.mjs";
2
- import { NavigationTarget, Params, ParamsSearch, RouterError, SearchParamPrimitive, SearchParamValue, SearchParams, SerializedRouterState, SimpleState, State, TransitionMeta, TransitionPhase, TransitionReason, Unsubscribe } from "./types/base.mjs";
2
+ import { NavigationTarget, ParamValue, Params, ParamsSearch, RouterError, SearchParamPrimitive, SearchParamValue, SearchParams, SerializedRouterState, SimpleState, State, TransitionMeta, TransitionPhase, TransitionReason, Unsubscribe, UrlChannels } from "./types/base.mjs";
3
3
  import { LimitsConfig } from "./types/limits.mjs";
4
4
  import { AdoptedOrigins, 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 } from "./types/router.mjs";
5
5
  import { ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventMethodMap, EventName, EventToNameMap, EventToPluginMap, EventsKeys, PluginMethod } from "./types/constants.mjs";
@@ -239,5 +239,5 @@ export interface NavigationOptions {
239
239
  */
240
240
  signal?: AbortSignal | undefined;
241
241
  }
242
- export type { AdoptedOrigins, AnyOptions, CheckFn, CheckPositionMap, ContextNamespaceClaim, DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, DefaultSearchCallback, DependenciesApi, DiagnosticEventMap, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventMethodMap, EventName, EventToNameMap, EventToPluginMap, EventsKeys, ForwardToCallback, GuardFn, GuardFnFactory, InterceptableMethodMap, InterceptorFn, LeaveFn, LeaveState, LifecycleApi, LimitsConfig, Listener, LogCallback, LogLevel, LogLevelConfig, LoggerConfig, NavigationTarget, Navigator, Options, Params, ParamsSearch, Plugin, PluginApi, PluginFactory, PluginMethod, QueryParamsMode, QueryParamsOptions, ReadonlyRoute, Route, RouteConfigUpdate, RouteParams, RouteTreeState, Router, RouterError, RouterLogger, RoutesApi, SearchParamPrimitive, SearchParamValue, SearchParams, SerializedRouterState, SimpleState, State, SubscribeFn, SubscribeState, Subscription, TransitionMeta, TransitionPhase, TransitionReason, TreeChangedAdd, TreeChangedClear, TreeChangedEvent, TreeChangedRemove, TreeChangedReplace, TreeChangedUpdate, TreeStructuralPatch, Unsubscribe };
242
+ export type { AdoptedOrigins, AnyOptions, CheckFn, CheckPositionMap, ContextNamespaceClaim, DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, DefaultSearchCallback, DependenciesApi, DiagnosticEventMap, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventMethodMap, EventName, EventToNameMap, EventToPluginMap, EventsKeys, ForwardToCallback, GuardFn, GuardFnFactory, InterceptableMethodMap, InterceptorFn, LeaveFn, LeaveState, LifecycleApi, LimitsConfig, Listener, LogCallback, LogLevel, LogLevelConfig, LoggerConfig, NavigationTarget, Navigator, Options, ParamValue, Params, ParamsSearch, Plugin, PluginApi, PluginFactory, PluginMethod, QueryParamsMode, QueryParamsOptions, ReadonlyRoute, Route, RouteConfigUpdate, RouteParams, RouteTreeState, Router, RouterError, RouterLogger, RoutesApi, SearchParamPrimitive, SearchParamValue, SearchParams, SerializedRouterState, SimpleState, State, SubscribeFn, SubscribeState, Subscription, TransitionMeta, TransitionPhase, TransitionReason, TreeChangedAdd, TreeChangedClear, TreeChangedEvent, TreeChangedRemove, TreeChangedReplace, TreeChangedUpdate, TreeStructuralPatch, Unsubscribe, UrlChannels };
243
243
  //# sourceMappingURL=types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/types/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DiB;;;;;;;;;;;;;;iBAeA;;;;;;;;;;;;;;;;;EAiBf;;;;;;;;;;;;;;;EAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA;;;;;;;;;;;EAYA,SAAS"}
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/types/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiEiB;;;;;;;;;;;;;;iBAeA;;;;;;;;;;;;;;;;;EAiBf;;;;;;;;;;;;;;;EAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA;;;;;;;;;;;EAYA,SAAS"}
@@ -1 +1 @@
1
- export{t as adoptChannel,T as copyFields,x as freezeThrownError,S as internalDefect,O as putField,C as raiser}from"./helpers-D5eyVTyF.mjs";
1
+ export{t as adoptChannel,T as copyFields,x as freezeThrownError,S as internalDefect,O as putField,C as raiser}from"./helpers-BFYPM3MT.mjs";
@@ -1 +1 @@
1
- import{a as e}from"./helpers-D5eyVTyF.mjs";import{C as t,f as n,o as r,v as i}from"./internals-CLQmmAMr.mjs";export{e as areParamValuesEqual,i as buildParamMeta,t as findMisChanneledKey,r as getInternals,n as validateRoute};
1
+ import{a as e}from"./helpers-BFYPM3MT.mjs";import{C as t,f as n,o as r,v as i}from"./internals-aMV-QSMA.mjs";export{e as areParamValuesEqual,i as buildParamMeta,t as findMisChanneledKey,r as getInternals,n as validateRoute};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@real-router/core",
3
- "version": "0.158.0",
3
+ "version": "0.160.0",
4
4
  "type": "commonjs",
5
5
  "description": "A simple, powerful, view-agnostic, modular and extensible router",
6
6
  "main": "./dist/cjs/index.js",