@real-router/types 0.3.0 → 0.4.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.
@@ -427,6 +427,21 @@ interface Listener {
427
427
  interface Subscription {
428
428
  unsubscribe: Unsubscribe;
429
429
  }
430
+ /**
431
+ * Navigator interface - a minimal, safe subset of Router methods.
432
+ *
433
+ * Provides only the essential navigation and state inspection methods.
434
+ * Excludes lifecycle methods (start, stop), plugin management, and internal APIs.
435
+ * Use this when you need to pass a limited router interface to components.
436
+ *
437
+ * For full router access, use the Router interface directly or the useRouter() hook.
438
+ */
439
+ interface Navigator {
440
+ navigate: (routeName: string, routeParamsOrDone?: Params | DoneFn, optionsOrDone?: NavigationOptions | DoneFn, done?: DoneFn) => CancelFn;
441
+ getState: () => State | undefined;
442
+ isActiveRoute: (name: string, params?: Params, strictEquality?: boolean, ignoreQueryParams?: boolean) => boolean;
443
+ subscribe: (listener: SubscribeFn) => Unsubscribe;
444
+ }
430
445
 
431
446
  /**
432
447
  * Plugin lifecycle method names
@@ -485,4 +500,4 @@ interface ErrorCodeToValueMap {
485
500
  TRANSITION_CANCELLED: "CANCELLED";
486
501
  }
487
502
 
488
- export type { ActivationFn, CancelFn, Config, DefaultDependencies, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, Listener, Middleware, NavigationOptions, Options, Params, Plugin, PluginMethod, QueryParamsMode, QueryParamsOptions, RouteTreeState, RouterError, SimpleState, State, StateMeta, StateMetaInput, SubscribeFn, SubscribeState, Subscription, Unsubscribe };
503
+ export type { ActivationFn, CancelFn, Config, DefaultDependencies, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, Listener, Middleware, NavigationOptions, Navigator, Options, Params, Plugin, PluginMethod, QueryParamsMode, QueryParamsOptions, RouteTreeState, RouterError, SimpleState, State, StateMeta, StateMetaInput, SubscribeFn, SubscribeState, Subscription, Unsubscribe };
@@ -1 +1 @@
1
- {"inputs":{"../../node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js":{"bytes":569,"imports":[],"format":"esm"},"src/index.ts":{"bytes":1084,"imports":[{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/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.6_typescript@5.9.3/node_modules/tsup/assets/cjs_shims.js":{"bytes":569,"imports":[],"format":"esm"},"src/index.ts":{"bytes":1097,"imports":[{"path":"/home/runner/work/real-router/real-router/node_modules/.pnpm/tsup@8.5.1_jiti@2.6.1_postcss@8.5.6_typescript@5.9.3/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}}}
@@ -427,6 +427,21 @@ interface Listener {
427
427
  interface Subscription {
428
428
  unsubscribe: Unsubscribe;
429
429
  }
430
+ /**
431
+ * Navigator interface - a minimal, safe subset of Router methods.
432
+ *
433
+ * Provides only the essential navigation and state inspection methods.
434
+ * Excludes lifecycle methods (start, stop), plugin management, and internal APIs.
435
+ * Use this when you need to pass a limited router interface to components.
436
+ *
437
+ * For full router access, use the Router interface directly or the useRouter() hook.
438
+ */
439
+ interface Navigator {
440
+ navigate: (routeName: string, routeParamsOrDone?: Params | DoneFn, optionsOrDone?: NavigationOptions | DoneFn, done?: DoneFn) => CancelFn;
441
+ getState: () => State | undefined;
442
+ isActiveRoute: (name: string, params?: Params, strictEquality?: boolean, ignoreQueryParams?: boolean) => boolean;
443
+ subscribe: (listener: SubscribeFn) => Unsubscribe;
444
+ }
430
445
 
431
446
  /**
432
447
  * Plugin lifecycle method names
@@ -485,4 +500,4 @@ interface ErrorCodeToValueMap {
485
500
  TRANSITION_CANCELLED: "CANCELLED";
486
501
  }
487
502
 
488
- export type { ActivationFn, CancelFn, Config, DefaultDependencies, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, Listener, Middleware, NavigationOptions, Options, Params, Plugin, PluginMethod, QueryParamsMode, QueryParamsOptions, RouteTreeState, RouterError, SimpleState, State, StateMeta, StateMetaInput, SubscribeFn, SubscribeState, Subscription, Unsubscribe };
503
+ export type { ActivationFn, CancelFn, Config, DefaultDependencies, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, Listener, Middleware, NavigationOptions, Navigator, Options, Params, Plugin, PluginMethod, QueryParamsMode, QueryParamsOptions, RouteTreeState, RouterError, SimpleState, State, StateMeta, StateMetaInput, SubscribeFn, SubscribeState, Subscription, Unsubscribe };
@@ -1 +1 @@
1
- {"inputs":{"src/index.ts":{"bytes":1084,"imports":[],"format":"esm"}},"outputs":{"dist/esm/index.mjs":{"imports":[],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":0}}}
1
+ {"inputs":{"src/index.ts":{"bytes":1097,"imports":[],"format":"esm"}},"outputs":{"dist/esm/index.mjs":{"imports":[],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":0}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@real-router/types",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "commonjs",
5
5
  "description": "Shared TypeScript types for Real Router ecosystem",
6
6
  "types": "./dist/esm/index.d.mts",