@real-router/types 0.5.0 → 0.6.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.
@@ -359,6 +359,16 @@ interface LoggerConfig {
359
359
  callback?: LogCallback | undefined;
360
360
  callbackIgnoresLevel?: boolean;
361
361
  }
362
+ /**
363
+ * Callback function for dynamically resolving the default route.
364
+ * Receives a dependency getter function to access router dependencies.
365
+ */
366
+ type DefaultRouteCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => string;
367
+ /**
368
+ * Callback function for dynamically resolving the default parameters.
369
+ * Receives a dependency getter function to access router dependencies.
370
+ */
371
+ type DefaultParamsCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => Params;
362
372
  /**
363
373
  * Router configuration options.
364
374
  *
@@ -372,13 +382,13 @@ interface Options {
372
382
  *
373
383
  * @default ""
374
384
  */
375
- defaultRoute: string;
385
+ defaultRoute: string | DefaultRouteCallback;
376
386
  /**
377
387
  * Default parameters for the default route.
378
388
  *
379
389
  * @default {}
380
390
  */
381
- defaultParams: Params;
391
+ defaultParams: Params | DefaultParamsCallback;
382
392
  /**
383
393
  * How to handle trailing slashes in URLs.
384
394
  * - "strict": Route must match exactly
@@ -389,12 +399,6 @@ interface Options {
389
399
  * @default "preserve"
390
400
  */
391
401
  trailingSlash: "strict" | "never" | "always" | "preserve";
392
- /**
393
- * Whether route names are case-sensitive.
394
- *
395
- * @default false
396
- */
397
- caseSensitive: boolean;
398
402
  /**
399
403
  * How to encode URL parameters.
400
404
  * - "default": Standard encoding
@@ -556,4 +560,4 @@ interface ErrorCodeToValueMap {
556
560
  TRANSITION_CANCELLED: "CANCELLED";
557
561
  }
558
562
 
559
- export type { ActivationFn, CancelFn, Config, DefaultDependencies, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, LimitsConfig, Listener, Middleware, NavigationOptions, Navigator, Options, Params, Plugin, PluginMethod, QueryParamsMode, QueryParamsOptions, RouteTreeState, RouterError, SimpleState, State, StateMeta, StateMetaInput, SubscribeFn, SubscribeState, Subscription, Unsubscribe };
563
+ export type { ActivationFn, CancelFn, Config, DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, LimitsConfig, 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":1168,"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":1217,"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}}}
@@ -359,6 +359,16 @@ interface LoggerConfig {
359
359
  callback?: LogCallback | undefined;
360
360
  callbackIgnoresLevel?: boolean;
361
361
  }
362
+ /**
363
+ * Callback function for dynamically resolving the default route.
364
+ * Receives a dependency getter function to access router dependencies.
365
+ */
366
+ type DefaultRouteCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => string;
367
+ /**
368
+ * Callback function for dynamically resolving the default parameters.
369
+ * Receives a dependency getter function to access router dependencies.
370
+ */
371
+ type DefaultParamsCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => Params;
362
372
  /**
363
373
  * Router configuration options.
364
374
  *
@@ -372,13 +382,13 @@ interface Options {
372
382
  *
373
383
  * @default ""
374
384
  */
375
- defaultRoute: string;
385
+ defaultRoute: string | DefaultRouteCallback;
376
386
  /**
377
387
  * Default parameters for the default route.
378
388
  *
379
389
  * @default {}
380
390
  */
381
- defaultParams: Params;
391
+ defaultParams: Params | DefaultParamsCallback;
382
392
  /**
383
393
  * How to handle trailing slashes in URLs.
384
394
  * - "strict": Route must match exactly
@@ -389,12 +399,6 @@ interface Options {
389
399
  * @default "preserve"
390
400
  */
391
401
  trailingSlash: "strict" | "never" | "always" | "preserve";
392
- /**
393
- * Whether route names are case-sensitive.
394
- *
395
- * @default false
396
- */
397
- caseSensitive: boolean;
398
402
  /**
399
403
  * How to encode URL parameters.
400
404
  * - "default": Standard encoding
@@ -556,4 +560,4 @@ interface ErrorCodeToValueMap {
556
560
  TRANSITION_CANCELLED: "CANCELLED";
557
561
  }
558
562
 
559
- export type { ActivationFn, CancelFn, Config, DefaultDependencies, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, LimitsConfig, Listener, Middleware, NavigationOptions, Navigator, Options, Params, Plugin, PluginMethod, QueryParamsMode, QueryParamsOptions, RouteTreeState, RouterError, SimpleState, State, StateMeta, StateMetaInput, SubscribeFn, SubscribeState, Subscription, Unsubscribe };
563
+ export type { ActivationFn, CancelFn, Config, DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, LimitsConfig, 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":1168,"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":1217,"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.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "commonjs",
5
5
  "description": "Shared TypeScript types for Real Router ecosystem",
6
6
  "types": "./dist/esm/index.d.mts",
@@ -38,6 +38,6 @@
38
38
  "scripts": {
39
39
  "build": "tsup",
40
40
  "type-check": "tsc --noEmit",
41
- "lint": "eslint --cache --ext .ts src/ --fix"
41
+ "lint": "eslint --cache --ext .ts src/ --fix --max-warnings 0"
42
42
  }
43
43
  }