@real-router/core 0.34.1 → 0.35.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.
Files changed (33) hide show
  1. package/README.md +50 -250
  2. package/dist/cjs/index.d.ts +3 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/metafile-cjs.json +1 -1
  6. package/dist/esm/index.d.mts +3 -1
  7. package/dist/esm/index.mjs +1 -1
  8. package/dist/esm/index.mjs.map +1 -1
  9. package/dist/esm/metafile-esm.json +1 -1
  10. package/package.json +5 -5
  11. package/src/Router.ts +21 -27
  12. package/src/api/getDependenciesApi.ts +2 -9
  13. package/src/api/getLifecycleApi.ts +1 -8
  14. package/src/api/getPluginApi.ts +1 -6
  15. package/src/api/getRoutesApi.ts +3 -11
  16. package/src/api/helpers.ts +10 -0
  17. package/src/constants.ts +3 -1
  18. package/src/index.ts +2 -1
  19. package/src/namespaces/EventBusNamespace/EventBusNamespace.ts +14 -20
  20. package/src/namespaces/NavigationNamespace/NavigationNamespace.ts +129 -144
  21. package/src/namespaces/NavigationNamespace/index.ts +1 -1
  22. package/src/namespaces/NavigationNamespace/transition/index.ts +5 -2
  23. package/src/namespaces/NavigationNamespace/types.ts +26 -28
  24. package/src/namespaces/PluginsNamespace/PluginsNamespace.ts +1 -9
  25. package/src/namespaces/PluginsNamespace/types.ts +2 -12
  26. package/src/namespaces/RouteLifecycleNamespace/RouteLifecycleNamespace.ts +32 -58
  27. package/src/namespaces/RouteLifecycleNamespace/types.ts +3 -10
  28. package/src/namespaces/RouterLifecycleNamespace/RouterLifecycleNamespace.ts +8 -51
  29. package/src/namespaces/RouterLifecycleNamespace/types.ts +12 -2
  30. package/src/namespaces/StateNamespace/StateNamespace.ts +0 -15
  31. package/src/transitionPath.ts +1 -1
  32. package/src/wiring/RouterWiringBuilder.ts +54 -39
  33. package/src/wiring/wireRouter.ts +2 -3
package/README.md CHANGED
@@ -11,6 +11,10 @@ Core router implementation for Real-Router.
11
11
  npm install @real-router/core
12
12
  # or
13
13
  pnpm add @real-router/core
14
+ # or
15
+ yarn add @real-router/core
16
+ # or
17
+ bun add @real-router/core
14
18
  ```
15
19
 
16
20
  ## Quick Start
@@ -38,18 +42,14 @@ await router.navigate("users.profile", { id: "123" });
38
42
  ## Router API
39
43
 
40
44
  The Router class provides core lifecycle, navigation, state, and subscription methods.
41
- Domain-specific operations (routes, dependencies, guards, plugin infrastructure, cloning) are available through standalone API functions for tree-shaking.
45
+ Domain-specific operations (routes, dependencies, guards, plugin infrastructure, cloning) are available through [standalone API functions](#standalone-api) for tree-shaking.
42
46
 
43
47
  ### `createRouter(routes?, options?, dependencies?)`
44
48
 
45
49
  Creates a new router instance. [Wiki](https://github.com/greydragon888/real-router/wiki/createRouter)
46
50
 
47
51
  ```typescript
48
- const router = createRouter(
49
- routes, // Route[] - route definitions
50
- options, // Partial<Options> - router options
51
- dependencies, // object - dependency injection
52
- );
52
+ const router = createRouter(routes, options, dependencies);
53
53
  ```
54
54
 
55
55
  ---
@@ -58,11 +58,7 @@ const router = createRouter(
58
58
 
59
59
  #### `router.start(path): Promise<State>`
60
60
 
61
- Starts the router with an initial path. Returns a Promise that resolves with the matched state. [Wiki](https://github.com/greydragon888/real-router/wiki/start)
62
-
63
- ```typescript
64
- const state = await router.start("/users/123");
65
- ```
61
+ Starts the router with an initial path. [Wiki](https://github.com/greydragon888/real-router/wiki/start)
66
62
 
67
63
  #### `router.stop(): this`
68
64
 
@@ -70,60 +66,36 @@ Stops the router. Cancels any in-progress transition. [Wiki](https://github.com/
70
66
 
71
67
  #### `router.dispose(): void`
72
68
 
73
- Permanently terminates the router. Unlike `stop()`, it cannot be restarted. All mutating methods throw `RouterError(DISPOSED)` after disposal. Idempotent. [Wiki](https://github.com/greydragon888/real-router/wiki/dispose)
69
+ Permanently terminates the router. Cannot be restarted. [Wiki](https://github.com/greydragon888/real-router/wiki/dispose)
74
70
 
75
71
  #### `router.isActive(): boolean`
76
72
 
77
- Returns whether the router is active (not idle and not disposed). [Wiki](https://github.com/greydragon888/real-router/wiki/isActive)
73
+ Returns whether the router is active. [Wiki](https://github.com/greydragon888/real-router/wiki/isActive)
78
74
 
79
75
  ---
80
76
 
81
77
  ### Navigation
82
78
 
83
- All navigation methods return `Promise<State>`.
84
-
85
79
  #### `router.navigate(name, params?, options?): Promise<State>`
86
80
 
87
- Navigates to a route by name. [Wiki](https://github.com/greydragon888/real-router/wiki/navigate)
81
+ Navigates to a route by name. Supports AbortController cancellation. Fire-and-forget safe. [Wiki](https://github.com/greydragon888/real-router/wiki/navigate)
88
82
 
89
83
  ```typescript
90
- const state = await router.navigate("users.profile", { id: "123" });
91
-
92
- // With navigation options
84
+ await router.navigate("users.profile", { id: "123" });
93
85
  await router.navigate("users", {}, { replace: true });
94
-
95
- // Concurrent navigation cancels previous
96
- router.navigate("slow-route");
97
- router.navigate("fast-route"); // Previous rejects with TRANSITION_CANCELLED
98
-
99
- // Cancel via AbortController
100
- const controller = new AbortController();
101
- router.navigate("route", {}, { signal: controller.signal });
102
- controller.abort(); // rejects with TRANSITION_CANCELLED
103
-
104
- // Timeout
105
- router.navigate("route", {}, { signal: AbortSignal.timeout(5000) });
106
-
107
- // Error handling
108
- try {
109
- await router.navigate("admin");
110
- } catch (err) {
111
- if (err instanceof RouterError) {
112
- // ROUTE_NOT_FOUND, CANNOT_ACTIVATE, CANNOT_DEACTIVATE,
113
- // TRANSITION_CANCELLED, SAME_STATES, ROUTER_DISPOSED
114
- }
115
- }
116
86
  ```
117
87
 
118
- **Fire-and-forget safe:** calling `router.navigate(...)` without `await` suppresses expected errors (`SAME_STATES`, `TRANSITION_CANCELLED`, `ROUTER_NOT_STARTED`, `ROUTE_NOT_FOUND`).
119
-
120
88
  #### `router.navigateToDefault(options?): Promise<State>`
121
89
 
122
90
  Navigates to the default route. [Wiki](https://github.com/greydragon888/real-router/wiki/navigateToDefault)
123
91
 
92
+ #### `router.navigateToNotFound(path?): State`
93
+
94
+ Synchronously sets the router to UNKNOWN_ROUTE state. Bypasses the transition pipeline. [Wiki](https://github.com/greydragon888/real-router/wiki/navigateToNotFound)
95
+
124
96
  #### `router.canNavigateTo(name, params?): boolean`
125
97
 
126
- Synchronously checks if navigation to a route would be allowed by guards. [Wiki](https://github.com/greydragon888/real-router/wiki/canNavigateTo)
98
+ Checks if navigation would be allowed by guards. [Wiki](https://github.com/greydragon888/real-router/wiki/canNavigateTo)
127
99
 
128
100
  ---
129
101
 
@@ -133,22 +105,17 @@ Synchronously checks if navigation to a route would be allowed by guards. [Wiki]
133
105
 
134
106
  Returns the current router state. [Wiki](https://github.com/greydragon888/real-router/wiki/getState)
135
107
 
136
- ```typescript
137
- const state = router.getState();
138
- // { name: "users.profile", params: { id: "123" }, path: "/users/123" }
139
- ```
140
-
141
108
  #### `router.getPreviousState(): State | undefined`
142
109
 
143
110
  Returns the previous router state. [Wiki](https://github.com/greydragon888/real-router/wiki/getPreviousState)
144
111
 
145
112
  #### `router.areStatesEqual(state1, state2, ignoreQueryParams?): boolean`
146
113
 
147
- Compare two states for equality. Query params ignored by default. [Wiki](https://github.com/greydragon888/real-router/wiki/areStatesEqual)
114
+ Compare two states for equality. [Wiki](https://github.com/greydragon888/real-router/wiki/areStatesEqual)
148
115
 
149
116
  #### `router.shouldUpdateNode(nodeName): (toState, fromState?) => boolean`
150
117
 
151
- Create a predicate to check if a route node should update during transition. [Wiki](https://github.com/greydragon888/real-router/wiki/shouldUpdateNode)
118
+ Create a predicate to check if a route node should update. [Wiki](https://github.com/greydragon888/real-router/wiki/shouldUpdateNode)
152
119
 
153
120
  ---
154
121
 
@@ -158,11 +125,6 @@ Create a predicate to check if a route node should update during transition. [Wi
158
125
 
159
126
  Build URL path from route name. [Wiki](https://github.com/greydragon888/real-router/wiki/buildPath)
160
127
 
161
- ```typescript
162
- const path = router.buildPath("users.profile", { id: "123" });
163
- // "/users/123"
164
- ```
165
-
166
128
  #### `router.isActiveRoute(name, params?, strictEquality?, ignoreQueryParams?): boolean`
167
129
 
168
130
  Check if route is currently active. [Wiki](https://github.com/greydragon888/real-router/wiki/isActiveRoute)
@@ -176,258 +138,95 @@ Check if route is currently active. [Wiki](https://github.com/greydragon888/real
176
138
  Subscribes to successful transitions. [Wiki](https://github.com/greydragon888/real-router/wiki/subscribe)
177
139
 
178
140
  ```typescript
179
- const unsubscribe = router.subscribe(({ route, previousRoute }) => {
180
- console.log("Navigation:", previousRoute?.name, "->", route.name);
141
+ const unsub = router.subscribe(({ route, previousRoute }) => {
142
+ console.log(previousRoute?.name, "", route.name);
181
143
  });
182
144
  ```
183
145
 
184
146
  ---
185
147
 
186
- ### Navigator
187
-
188
- #### `getNavigator(router): Navigator`
189
-
190
- Returns a frozen subset of router methods for passing to view layers (React, Vue, etc.). All methods are pre-bound — safe to destructure. [Wiki](https://github.com/greydragon888/real-router/wiki/getNavigator)
191
-
192
- ```typescript
193
- import { getNavigator } from "@real-router/core";
194
-
195
- const navigator = getNavigator(router);
196
- // { navigate, getState, isActiveRoute, canNavigateTo, subscribe }
197
- ```
198
-
199
- ---
200
-
201
148
  ### Plugins
202
149
 
203
150
  #### `router.usePlugin(...plugins): Unsubscribe`
204
151
 
205
- Registers one or more plugins. Returns an unsubscribe function. [Wiki](https://github.com/greydragon888/real-router/wiki/usePlugin)
152
+ Registers one or more plugins. [Wiki](https://github.com/greydragon888/real-router/wiki/usePlugin)
206
153
 
207
154
  ```typescript
208
155
  import { browserPluginFactory } from "@real-router/browser-plugin";
209
156
 
210
- const unsubscribe = router.usePlugin(browserPluginFactory());
157
+ router.usePlugin(browserPluginFactory());
211
158
  ```
212
159
 
213
160
  ---
214
161
 
215
162
  ## Standalone API
216
163
 
217
- Standalone functions provide domain-specific operations. They are tree-shakeable — only imported functions are bundled.
218
-
219
- ### Routes — `getRoutesApi(router)`
220
-
221
- Runtime route management. [Wiki](https://github.com/greydragon888/real-router/wiki/getRoutesApi)
222
-
223
- ```typescript
224
- import { getRoutesApi } from "@real-router/core";
225
-
226
- const routes = getRoutesApi(router);
227
-
228
- // Add routes
229
- routes.add({ name: "settings", path: "/settings" });
230
- routes.add({ name: "profile", path: "/:id" }, { parent: "users" });
231
-
232
- // Query
233
- routes.has("users"); // true
234
- routes.get("users"); // Route | undefined
164
+ Tree-shakeable functions for domain-specific operations.
235
165
 
236
- // Modify
237
- routes.update("users", { forwardTo: "users.list" });
238
- routes.remove("settings");
239
- routes.clear();
166
+ ### `getRoutesApi(router)` — Route Management
240
167
 
241
- // Atomic replacement (HMR, feature flags)
242
- routes.replace([
243
- { name: "home", path: "/" },
244
- { name: "dashboard", path: "/dashboard" },
245
- ]);
246
- // Preserves state (if route exists), external guards, one tree rebuild
247
- ```
168
+ Add, remove, replace, and query routes at runtime. [Wiki](https://github.com/greydragon888/real-router/wiki/getRoutesApi)
248
169
 
249
170
  **Methods:** `add`, `remove`, `replace`, `update`, `clear`, `has`, `get`, `getConfig`
250
171
 
251
- ### Dependencies — `getDependenciesApi(router)`
172
+ ### `getDependenciesApi(router)` — Dependencies
252
173
 
253
174
  Dependency injection container. [Wiki](https://github.com/greydragon888/real-router/wiki/getDependenciesApi)
254
175
 
255
- ```typescript
256
- import { getDependenciesApi } from "@real-router/core";
257
-
258
- const deps = getDependenciesApi(router);
259
-
260
- deps.set("authService", authService);
261
- deps.get("authService"); // authService
262
- deps.has("authService"); // true
263
- deps.getAll(); // { authService: ... }
264
- deps.remove("authService");
265
- deps.reset();
266
- ```
267
-
268
176
  **Methods:** `get`, `getAll`, `set`, `setAll`, `remove`, `reset`, `has`
269
177
 
270
- ### Guards — `getLifecycleApi(router)`
178
+ ### `getLifecycleApi(router)` — Guards
271
179
 
272
180
  Route activation/deactivation guards. [Wiki](https://github.com/greydragon888/real-router/wiki/getLifecycleApi)
273
181
 
274
- ```typescript
275
- import { getLifecycleApi } from "@real-router/core";
276
-
277
- const lifecycle = getLifecycleApi(router);
278
-
279
- // Guard returns boolean or Promise<boolean> (true = allow, false = block)
280
- lifecycle.addActivateGuard("admin", () => (toState, fromState) => {
281
- return isAuthenticated(); // sync
282
- });
283
-
284
- lifecycle.addDeactivateGuard("editor", () => async (toState, fromState) => {
285
- return !(await checkUnsavedChanges()); // async
286
- });
287
-
288
- // Guards receive AbortSignal for cooperative cancellation
289
- lifecycle.addActivateGuard(
290
- "dashboard",
291
- () => async (toState, fromState, signal) => {
292
- const res = await fetch("/api/auth", { signal }); // auto-cancelled on abort
293
- return res.ok;
294
- },
295
- );
296
-
297
- // Remove guards
298
- lifecycle.removeActivateGuard("admin");
299
- lifecycle.removeDeactivateGuard("editor");
300
- ```
301
-
302
182
  **Methods:** `addActivateGuard`, `addDeactivateGuard`, `removeActivateGuard`, `removeDeactivateGuard`
303
183
 
304
- ### Plugin Infrastructure — `getPluginApi(router)`
305
-
306
- Low-level API for plugin authors. Provides access to state building, path matching, event system, and navigation. [Wiki](https://github.com/greydragon888/real-router/wiki/getPluginApi)
307
-
308
- ```typescript
309
- import { getPluginApi } from "@real-router/core";
310
-
311
- const api = getPluginApi(router);
312
-
313
- // State building
314
- const state = api.matchPath("/users/123");
315
- const builtState = api.makeState("users.profile", { id: "123" });
316
-
317
- // Event system
318
- const unsub = api.addEventListener(
319
- events.TRANSITION_START,
320
- (toState, fromState) => {
321
- console.log("Starting:", toState.name);
322
- },
323
- );
324
-
325
- // Root path management
326
- api.setRootPath("/app");
327
- api.getRootPath(); // "/app"
328
-
329
- // Method interception (used by plugins)
330
- api.addInterceptor("forwardState", (next, name, params) => {
331
- const result = next(name, params);
332
- return { ...result, params: withPersistent(result.params) };
333
- });
184
+ ### `getPluginApi(router)` — Plugin Infrastructure
334
185
 
335
- api.addInterceptor("start", (next, path) => next(path ?? getLocation()));
336
-
337
- // Router instance extension (used by plugins to add methods)
338
- const removeExtensions = api.extendRouter({
339
- buildUrl: (name, params) => buildUrlFromPath(name, params),
340
- matchUrl: (url) => matchUrlToState(url),
341
- });
342
- // Extensions are assigned directly to the router instance
343
- // Throws PLUGIN_CONFLICT if any key already exists
344
- // removeExtensions() cleans up on plugin teardown
345
- ```
186
+ Low-level API for plugin authors. State building, path matching, event system, method interception, router extension. [Wiki](https://github.com/greydragon888/real-router/wiki/getPluginApi)
346
187
 
347
188
  **Methods:** `makeState`, `buildState`, `buildNavigationState`, `forwardState`, `matchPath`, `setRootPath`, `getRootPath`, `addEventListener`, `getOptions`, `getTree`, `addInterceptor`, `extendRouter`
348
189
 
349
- ### SSR Cloning — `cloneRouter(router, deps?)`
350
-
351
- Clone router for server-side rendering. [Wiki](https://github.com/greydragon888/real-router/wiki/cloneRouter)
190
+ ### `getNavigator(router)` — Navigator
352
191
 
353
- ```typescript
354
- import { cloneRouter } from "@real-router/core";
192
+ Frozen subset of router methods for view layers. Pre-bound, safe to destructure. [Wiki](https://github.com/greydragon888/real-router/wiki/getNavigator)
355
193
 
356
- // Server: clone router per request
357
- const serverRouter = cloneRouter(router, { request: req });
358
- await serverRouter.start(req.url);
359
- ```
194
+ ### `cloneRouter(router, deps?)` SSR Cloning
360
195
 
361
- Rebuilds route tree from definitions, copies mutable state (dependencies, options, plugins, guards). Each clone gets an independent tree.
196
+ Clone router for server-side rendering. [Wiki](https://github.com/greydragon888/real-router/wiki/cloneRouter)
362
197
 
363
198
  ---
364
199
 
365
200
  ## Configuration
366
201
 
367
- ```typescript
368
- interface Options {
369
- defaultRoute: string | DefaultRouteCallback; // Default route name (default: "")
370
- defaultParams: Params | DefaultParamsCallback; // Default route params (default: {})
371
- trailingSlash: "strict" | "never" | "always" | "preserve"; // (default: "preserve")
372
- urlParamsEncoding: "default" | "uri" | "uriComponent" | "none"; // (default: "default")
373
- queryParamsMode: "default" | "strict" | "loose"; // (default: "loose")
374
- queryParams?: QueryParamsOptions; // Query parameter parsing options
375
- allowNotFound: boolean; // Allow navigation to unknown routes (default: true)
376
- rewritePathOnMatch: boolean; // Rewrite path on successful match (default: false)
377
- logger?: Partial<LoggerConfig>; // Logger configuration
378
- limits?: Partial<LimitsConfig>; // Resource limits (max plugins, listeners, etc.)
379
- noValidate?: boolean; // Skip argument validation in production (default: false)
380
- }
381
- ```
382
-
383
- See [RouterOptions](https://github.com/greydragon888/real-router/wiki/RouterOptions) for detailed documentation.
202
+ See [RouterOptions](https://github.com/greydragon888/real-router/wiki/RouterOptions) for all available options.
384
203
 
385
204
  ---
386
205
 
387
- ## Observable Support
206
+ ## Error Handling
388
207
 
389
- > **Note**: Observable API has been moved to `@real-router/rx` package for zero bundle cost.
390
- > See [@real-router/rx](../rx/README.md) for reactive stream APIs including `state$()`, `events$()`, operators, and TC39 Observable support.
208
+ Navigation errors are instances of `RouterError`. See [RouterError](https://github.com/greydragon888/real-router/wiki/RouterError) and [Error Codes](https://github.com/greydragon888/real-router/wiki/error-codes) for details.
391
209
 
392
210
  ---
393
211
 
394
- ## Error Handling
395
-
396
- Navigation errors are instances of `RouterError`:
397
-
398
- ```typescript
399
- import { RouterError, errorCodes } from "@real-router/core";
400
-
401
- try {
402
- await router.navigate("users");
403
- } catch (err) {
404
- if (err instanceof RouterError) {
405
- console.log(err.code, err.message);
406
- }
407
- }
408
- ```
212
+ ## Observable Support
409
213
 
410
- | Code | Description |
411
- | ------------------------ | -------------------------------------------- |
412
- | `ROUTE_NOT_FOUND` | Route doesn't exist |
413
- | `CANNOT_ACTIVATE` | Blocked by canActivate guard |
414
- | `CANNOT_DEACTIVATE` | Blocked by canDeactivate guard |
415
- | `CANCELLED` | Navigation was cancelled |
416
- | `SAME_STATES` | Already at target route |
417
- | `NOT_STARTED` | Router not started |
418
- | `NO_START_PATH_OR_STATE` | `start()` called without a path |
419
- | `ALREADY_STARTED` | Router already started |
420
- | `TRANSITION_ERR` | Generic transition error |
421
- | `DISPOSED` | Router has been disposed |
422
- | `PLUGIN_CONFLICT` | Plugin extends router with existing property |
423
-
424
- See [RouterError](https://github.com/greydragon888/real-router/wiki/RouterError) and [Error Codes](https://github.com/greydragon888/real-router/wiki/error-codes) for details.
214
+ > Observable API has been moved to `@real-router/rx` package for zero bundle cost.
215
+ > See [@real-router/rx](../rx/README.md) for reactive stream APIs.
425
216
 
426
217
  ---
427
218
 
428
- ## Migration from router5
219
+ ## Documentation
220
+
221
+ Full documentation available on the [Wiki](https://github.com/greydragon888/real-router/wiki):
429
222
 
430
- See the [Migration Guide](https://github.com/greydragon888/real-router/wiki/migration-guide) for detailed guidance.
223
+ - [Creating a Router](https://github.com/greydragon888/real-router/wiki/createRouter)
224
+ - [Navigation](https://github.com/greydragon888/real-router/wiki/navigate)
225
+ - [State](https://github.com/greydragon888/real-router/wiki/getState)
226
+ - [Guards](https://github.com/greydragon888/real-router/wiki/getLifecycleApi)
227
+ - [Plugins](https://github.com/greydragon888/real-router/wiki/usePlugin)
228
+ - [Error Codes](https://github.com/greydragon888/real-router/wiki/error-codes)
229
+ - [Migration from router5](https://github.com/greydragon888/real-router/wiki/migration-guide)
431
230
 
432
231
  ---
433
232
 
@@ -435,6 +234,7 @@ See the [Migration Guide](https://github.com/greydragon888/real-router/wiki/migr
435
234
 
436
235
  - [@real-router/react](https://www.npmjs.com/package/@real-router/react) — React integration
437
236
  - [@real-router/browser-plugin](https://www.npmjs.com/package/@real-router/browser-plugin) — Browser history
237
+ - [@real-router/hash-plugin](https://www.npmjs.com/package/@real-router/hash-plugin) — Hash-based routing
438
238
  - [@real-router/logger-plugin](https://www.npmjs.com/package/@real-router/logger-plugin) — Debug logging
439
239
  - [@real-router/persistent-params-plugin](https://www.npmjs.com/package/@real-router/persistent-params-plugin) — Persistent params
440
240
  - [@real-router/route-utils](https://www.npmjs.com/package/@real-router/route-utils) — Route tree queries and segment testing utilities
@@ -61,6 +61,7 @@ declare class Router<Dependencies extends DefaultDependencies = DefaultDependenc
61
61
  subscribe(listener: SubscribeFn): Unsubscribe;
62
62
  navigate(routeName: string, routeParams?: Params, options?: NavigationOptions): Promise<State>;
63
63
  navigateToDefault(options?: NavigationOptions): Promise<State>;
64
+ navigateToNotFound(path?: string): State;
64
65
  }
65
66
 
66
67
  type ConstantsKeys = "UNKNOWN_ROUTE";
@@ -76,6 +77,7 @@ declare const errorCodes: ErrorCodeToValueMap;
76
77
  * General router constants.
77
78
  * Special route names and identifiers.
78
79
  */
80
+ declare const UNKNOWN_ROUTE = "@@router/UNKNOWN_ROUTE";
79
81
  declare const constants: Constants;
80
82
  /**
81
83
  * Event names for router event system.
@@ -423,4 +425,4 @@ declare function getLifecycleApi<Dependencies extends DefaultDependencies = Defa
423
425
 
424
426
  declare function cloneRouter<Dependencies extends DefaultDependencies = DefaultDependencies>(router: Router$1<Dependencies>, dependencies?: Dependencies): Router<Dependencies>;
425
427
 
426
- export { type BuildStateResultWithSegments, type Constants, type ErrorCodes, type PluginApi, type RouteTree, Router, RouterError, cloneRouter, constants, createRouter, errorCodes, events, getDependenciesApi, getLifecycleApi, getNavigator, getPluginApi, getRoutesApi };
428
+ export { type BuildStateResultWithSegments, type Constants, type ErrorCodes, type PluginApi, type RouteTree, Router, RouterError, UNKNOWN_ROUTE, cloneRouter, constants, createRouter, errorCodes, events, getDependenciesApi, getLifecycleApi, getNavigator, getPluginApi, getRoutesApi };