@real-router/types 0.23.1 → 0.26.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.
@@ -415,13 +415,6 @@ interface Options {
415
415
  * @default DEFAULT_LIMITS (from LimitsNamespace)
416
416
  */
417
417
  limits?: Partial<LimitsConfig>;
418
- /**
419
- * Disables argument validation in public router methods.
420
- * Use in production for performance. Keep false in development for early error detection.
421
- *
422
- * @default false
423
- */
424
- noValidate?: boolean;
425
418
  }
426
419
  type GuardFn = (toState: State, fromState: State | undefined, signal?: AbortSignal) => boolean | Promise<boolean>;
427
420
  type DefaultDependencies = object;
@@ -490,7 +483,7 @@ interface Router<D extends DefaultDependencies = DefaultDependencies> {
490
483
  stop: () => this;
491
484
  dispose: () => void;
492
485
  canNavigateTo: (name: string, params?: Params) => boolean;
493
- usePlugin: (...plugins: PluginFactory<D>[]) => Unsubscribe;
486
+ usePlugin: (...plugins: (PluginFactory<D> | false | null | undefined)[]) => Unsubscribe;
494
487
  subscribe: (listener: SubscribeFn) => Unsubscribe;
495
488
  navigate: (routeName: string, routeParams?: Params, options?: NavigationOptions) => Promise<State>;
496
489
  navigateToDefault: (options?: NavigationOptions) => Promise<State>;
@@ -668,6 +661,7 @@ interface PluginApi {
668
661
  getTree: () => unknown;
669
662
  addInterceptor: <M extends keyof InterceptableMethodMap>(method: M, fn: InterceptorFn<M>) => Unsubscribe;
670
663
  extendRouter: (extensions: Record<string, unknown>) => Unsubscribe;
664
+ getRouteConfig: (name: string) => Record<string, unknown> | undefined;
671
665
  }
672
666
  /**
673
667
  * Routes API — for dynamic route mutation.
@@ -682,7 +676,6 @@ interface RoutesApi<Dependencies extends DefaultDependencies = DefaultDependenci
682
676
  replace: (routes: Route<Dependencies>[] | Route<Dependencies>) => void;
683
677
  has: (name: string) => boolean;
684
678
  get: (name: string) => Route<Dependencies> | undefined;
685
- getConfig: (name: string) => Record<string, unknown> | undefined;
686
679
  }
687
680
  /**
688
681
  * Dependencies API — CRUD for dependency injection.
@@ -1 +1 @@
1
- {"inputs":{"../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js":{"bytes":569,"imports":[],"format":"esm"},"src/index.ts":{"bytes":1392,"imports":[{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/cjs/index.js":{"imports":[],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":0}}}
1
+ {"inputs":{"../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js":{"bytes":569,"imports":[],"format":"esm"},"src/index.ts":{"bytes":1392,"imports":[{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.8_tsx@4.21.0_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/cjs/index.js":{"imports":[],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":0}}}
@@ -415,13 +415,6 @@ interface Options {
415
415
  * @default DEFAULT_LIMITS (from LimitsNamespace)
416
416
  */
417
417
  limits?: Partial<LimitsConfig>;
418
- /**
419
- * Disables argument validation in public router methods.
420
- * Use in production for performance. Keep false in development for early error detection.
421
- *
422
- * @default false
423
- */
424
- noValidate?: boolean;
425
418
  }
426
419
  type GuardFn = (toState: State, fromState: State | undefined, signal?: AbortSignal) => boolean | Promise<boolean>;
427
420
  type DefaultDependencies = object;
@@ -490,7 +483,7 @@ interface Router<D extends DefaultDependencies = DefaultDependencies> {
490
483
  stop: () => this;
491
484
  dispose: () => void;
492
485
  canNavigateTo: (name: string, params?: Params) => boolean;
493
- usePlugin: (...plugins: PluginFactory<D>[]) => Unsubscribe;
486
+ usePlugin: (...plugins: (PluginFactory<D> | false | null | undefined)[]) => Unsubscribe;
494
487
  subscribe: (listener: SubscribeFn) => Unsubscribe;
495
488
  navigate: (routeName: string, routeParams?: Params, options?: NavigationOptions) => Promise<State>;
496
489
  navigateToDefault: (options?: NavigationOptions) => Promise<State>;
@@ -668,6 +661,7 @@ interface PluginApi {
668
661
  getTree: () => unknown;
669
662
  addInterceptor: <M extends keyof InterceptableMethodMap>(method: M, fn: InterceptorFn<M>) => Unsubscribe;
670
663
  extendRouter: (extensions: Record<string, unknown>) => Unsubscribe;
664
+ getRouteConfig: (name: string) => Record<string, unknown> | undefined;
671
665
  }
672
666
  /**
673
667
  * Routes API — for dynamic route mutation.
@@ -682,7 +676,6 @@ interface RoutesApi<Dependencies extends DefaultDependencies = DefaultDependenci
682
676
  replace: (routes: Route<Dependencies>[] | Route<Dependencies>) => void;
683
677
  has: (name: string) => boolean;
684
678
  get: (name: string) => Route<Dependencies> | undefined;
685
- getConfig: (name: string) => Record<string, unknown> | undefined;
686
679
  }
687
680
  /**
688
681
  * Dependencies API — CRUD for dependency injection.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@real-router/types",
3
- "version": "0.23.1",
3
+ "version": "0.26.0",
4
4
  "type": "commonjs",
5
5
  "description": "Shared TypeScript types for Real Router ecosystem",
6
6
  "types": "./dist/esm/index.d.mts",
package/src/api.ts CHANGED
@@ -93,6 +93,8 @@ export interface PluginApi {
93
93
  ) => Unsubscribe;
94
94
 
95
95
  extendRouter: (extensions: Record<string, unknown>) => Unsubscribe;
96
+
97
+ getRouteConfig: (name: string) => Record<string, unknown> | undefined;
96
98
  }
97
99
 
98
100
  /**
@@ -117,8 +119,6 @@ export interface RoutesApi<
117
119
  has: (name: string) => boolean;
118
120
 
119
121
  get: (name: string) => Route<Dependencies> | undefined;
120
-
121
- getConfig: (name: string) => Record<string, unknown> | undefined;
122
122
  }
123
123
 
124
124
  /**
package/src/router.ts CHANGED
@@ -145,14 +145,6 @@ export interface Options {
145
145
  * @default DEFAULT_LIMITS (from LimitsNamespace)
146
146
  */
147
147
  limits?: Partial<LimitsConfig>;
148
-
149
- /**
150
- * Disables argument validation in public router methods.
151
- * Use in production for performance. Keep false in development for early error detection.
152
- *
153
- * @default false
154
- */
155
- noValidate?: boolean;
156
148
  }
157
149
 
158
150
  export type GuardFn = (
@@ -279,7 +271,9 @@ export interface Router<D extends DefaultDependencies = DefaultDependencies> {
279
271
 
280
272
  canNavigateTo: (name: string, params?: Params) => boolean;
281
273
 
282
- usePlugin: (...plugins: PluginFactory<D>[]) => Unsubscribe;
274
+ usePlugin: (
275
+ ...plugins: (PluginFactory<D> | false | null | undefined)[]
276
+ ) => Unsubscribe;
283
277
 
284
278
  subscribe: (listener: SubscribeFn) => Unsubscribe;
285
279