@real-router/types 0.5.0 → 0.7.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.
- package/dist/cjs/index.d.ts +18 -9
- package/dist/cjs/metafile-cjs.json +1 -1
- package/dist/esm/index.d.mts +18 -9
- package/dist/esm/metafile-esm.json +1 -1
- package/package.json +2 -2
package/dist/cjs/index.d.ts
CHANGED
|
@@ -359,6 +359,21 @@ 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 forward target route.
|
|
369
|
+
* Receives a dependency getter function and current route parameters.
|
|
370
|
+
*/
|
|
371
|
+
type ForwardToCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K], params: Params) => string;
|
|
372
|
+
/**
|
|
373
|
+
* Callback function for dynamically resolving the default parameters.
|
|
374
|
+
* Receives a dependency getter function to access router dependencies.
|
|
375
|
+
*/
|
|
376
|
+
type DefaultParamsCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => Params;
|
|
362
377
|
/**
|
|
363
378
|
* Router configuration options.
|
|
364
379
|
*
|
|
@@ -372,13 +387,13 @@ interface Options {
|
|
|
372
387
|
*
|
|
373
388
|
* @default ""
|
|
374
389
|
*/
|
|
375
|
-
defaultRoute: string;
|
|
390
|
+
defaultRoute: string | DefaultRouteCallback;
|
|
376
391
|
/**
|
|
377
392
|
* Default parameters for the default route.
|
|
378
393
|
*
|
|
379
394
|
* @default {}
|
|
380
395
|
*/
|
|
381
|
-
defaultParams: Params;
|
|
396
|
+
defaultParams: Params | DefaultParamsCallback;
|
|
382
397
|
/**
|
|
383
398
|
* How to handle trailing slashes in URLs.
|
|
384
399
|
* - "strict": Route must match exactly
|
|
@@ -389,12 +404,6 @@ interface Options {
|
|
|
389
404
|
* @default "preserve"
|
|
390
405
|
*/
|
|
391
406
|
trailingSlash: "strict" | "never" | "always" | "preserve";
|
|
392
|
-
/**
|
|
393
|
-
* Whether route names are case-sensitive.
|
|
394
|
-
*
|
|
395
|
-
* @default false
|
|
396
|
-
*/
|
|
397
|
-
caseSensitive: boolean;
|
|
398
407
|
/**
|
|
399
408
|
* How to encode URL parameters.
|
|
400
409
|
* - "default": Standard encoding
|
|
@@ -556,4 +565,4 @@ interface ErrorCodeToValueMap {
|
|
|
556
565
|
TRANSITION_CANCELLED: "CANCELLED";
|
|
557
566
|
}
|
|
558
567
|
|
|
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 };
|
|
568
|
+
export type { ActivationFn, CancelFn, Config, DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, ForwardToCallback, 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":
|
|
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":1238,"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}}}
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -359,6 +359,21 @@ 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 forward target route.
|
|
369
|
+
* Receives a dependency getter function and current route parameters.
|
|
370
|
+
*/
|
|
371
|
+
type ForwardToCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K], params: Params) => string;
|
|
372
|
+
/**
|
|
373
|
+
* Callback function for dynamically resolving the default parameters.
|
|
374
|
+
* Receives a dependency getter function to access router dependencies.
|
|
375
|
+
*/
|
|
376
|
+
type DefaultParamsCallback<Dependencies = object> = (getDependency: <K extends keyof Dependencies>(name: K) => Dependencies[K]) => Params;
|
|
362
377
|
/**
|
|
363
378
|
* Router configuration options.
|
|
364
379
|
*
|
|
@@ -372,13 +387,13 @@ interface Options {
|
|
|
372
387
|
*
|
|
373
388
|
* @default ""
|
|
374
389
|
*/
|
|
375
|
-
defaultRoute: string;
|
|
390
|
+
defaultRoute: string | DefaultRouteCallback;
|
|
376
391
|
/**
|
|
377
392
|
* Default parameters for the default route.
|
|
378
393
|
*
|
|
379
394
|
* @default {}
|
|
380
395
|
*/
|
|
381
|
-
defaultParams: Params;
|
|
396
|
+
defaultParams: Params | DefaultParamsCallback;
|
|
382
397
|
/**
|
|
383
398
|
* How to handle trailing slashes in URLs.
|
|
384
399
|
* - "strict": Route must match exactly
|
|
@@ -389,12 +404,6 @@ interface Options {
|
|
|
389
404
|
* @default "preserve"
|
|
390
405
|
*/
|
|
391
406
|
trailingSlash: "strict" | "never" | "always" | "preserve";
|
|
392
|
-
/**
|
|
393
|
-
* Whether route names are case-sensitive.
|
|
394
|
-
*
|
|
395
|
-
* @default false
|
|
396
|
-
*/
|
|
397
|
-
caseSensitive: boolean;
|
|
398
407
|
/**
|
|
399
408
|
* How to encode URL parameters.
|
|
400
409
|
* - "default": Standard encoding
|
|
@@ -556,4 +565,4 @@ interface ErrorCodeToValueMap {
|
|
|
556
565
|
TRANSITION_CANCELLED: "CANCELLED";
|
|
557
566
|
}
|
|
558
567
|
|
|
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 };
|
|
568
|
+
export type { ActivationFn, CancelFn, Config, DefaultDependencies, DefaultParamsCallback, DefaultRouteCallback, DoneFn, ErrorCodeKeys, ErrorCodeToValueMap, ErrorCodeValues, EventName, EventToNameMap, EventToPluginMap, EventsKeys, ForwardToCallback, 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":
|
|
1
|
+
{"inputs":{"src/index.ts":{"bytes":1238,"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
|
+
"version": "0.7.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
|
}
|