@kitbag/router 0.20.0 → 0.20.2
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/kitbag-router.d.ts +24 -10
- package/dist/kitbag-router.js +1166 -1153
- package/dist/kitbag-router.umd.cjs +3 -3
- package/package.json +6 -5
package/dist/kitbag-router.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
2
|
import { AsyncComponentLoader } from 'vue';
|
|
3
|
-
import { BaseIssue } from 'valibot';
|
|
4
|
-
import { BaseSchema } from 'valibot';
|
|
5
3
|
import { Component } from 'vue';
|
|
6
4
|
import { ComponentOptionsMixin } from 'vue';
|
|
7
5
|
import { ComponentProvideOptions } from 'vue';
|
|
@@ -11,10 +9,8 @@ import { FunctionalComponent } from 'vue';
|
|
|
11
9
|
import { MaybeRefOrGetter } from 'vue';
|
|
12
10
|
import { PublicProps } from 'vue';
|
|
13
11
|
import { Ref } from 'vue';
|
|
14
|
-
import {
|
|
15
|
-
import { UnionSchema } from 'valibot';
|
|
12
|
+
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
16
13
|
import { UnwrapRef } from 'vue';
|
|
17
|
-
import { VariantSchema } from 'valibot';
|
|
18
14
|
import { VNode } from 'vue';
|
|
19
15
|
|
|
20
16
|
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
@@ -384,7 +380,7 @@ declare type ExtractParamName<TParam extends PropertyKey> = TParam extends strin
|
|
|
384
380
|
* @template TParam - The parameter type.
|
|
385
381
|
* @returns The extracted type, or 'string' as a fallback.
|
|
386
382
|
*/
|
|
387
|
-
declare type ExtractParamType<TParam extends Param> = TParam extends ParamGetSet<infer Type> ? Type : TParam extends ParamGetter ? ReturnType<TParam> : TParam extends
|
|
383
|
+
declare type ExtractParamType<TParam extends Param> = TParam extends ParamGetSet<infer Type> ? Type : TParam extends ParamGetter ? ReturnType<TParam> : TParam extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<TParam> : TParam extends LiteralParam ? TParam : string;
|
|
388
384
|
|
|
389
385
|
declare type ExtractParamTypes<TParams extends Record<string, Param>> = Identity<MakeOptional<{
|
|
390
386
|
[K in keyof TParams as ExtractParamName<K>]: ExtractParamType<TParams[K]>;
|
|
@@ -989,6 +985,10 @@ export declare type Router<TRoutes extends Routes = any, TOptions extends Router
|
|
|
989
985
|
* Initializes the router based on the initial route. Automatically called when the router is installed. Calling this more than once has no effect.
|
|
990
986
|
*/
|
|
991
987
|
start: () => Promise<void>;
|
|
988
|
+
/**
|
|
989
|
+
* Returns true if the router has been started.
|
|
990
|
+
*/
|
|
991
|
+
started: Ref<boolean>;
|
|
992
992
|
/**
|
|
993
993
|
* Stops the router and teardown any listeners.
|
|
994
994
|
*/
|
|
@@ -1024,6 +1024,8 @@ element: HTMLAnchorElement;
|
|
|
1024
1024
|
route: ResolvedRoute | undefined;
|
|
1025
1025
|
isMatch: boolean;
|
|
1026
1026
|
isExactMatch: boolean;
|
|
1027
|
+
isActive: boolean;
|
|
1028
|
+
isExactActive: boolean;
|
|
1027
1029
|
isExternal: boolean;
|
|
1028
1030
|
}) => unknown;
|
|
1029
1031
|
}> & {
|
|
@@ -1031,6 +1033,8 @@ element: HTMLAnchorElement;
|
|
|
1031
1033
|
route: ResolvedRoute | undefined;
|
|
1032
1034
|
isMatch: boolean;
|
|
1033
1035
|
isExactMatch: boolean;
|
|
1036
|
+
isActive: boolean;
|
|
1037
|
+
isExactActive: boolean;
|
|
1034
1038
|
isExternal: boolean;
|
|
1035
1039
|
}) => unknown;
|
|
1036
1040
|
}>;
|
|
@@ -1260,6 +1264,14 @@ export declare type UseLink = {
|
|
|
1260
1264
|
* True if route matches current URL. Route is the same as what's currently stored at `router.route`.
|
|
1261
1265
|
*/
|
|
1262
1266
|
isExactMatch: ComputedRef<boolean>;
|
|
1267
|
+
/**
|
|
1268
|
+
* True if route matches current URL, or is a parent route that matches the parent of the current URL.
|
|
1269
|
+
*/
|
|
1270
|
+
isActive: ComputedRef<boolean>;
|
|
1271
|
+
/**
|
|
1272
|
+
* True if route matches current URL exactly.
|
|
1273
|
+
*/
|
|
1274
|
+
isExactActive: ComputedRef<boolean>;
|
|
1263
1275
|
/**
|
|
1264
1276
|
*
|
|
1265
1277
|
*/
|
|
@@ -1350,7 +1362,9 @@ export declare class UseRouteInvalidError extends Error {
|
|
|
1350
1362
|
*/
|
|
1351
1363
|
export declare function useRouter(): RegisteredRouter;
|
|
1352
1364
|
|
|
1353
|
-
declare
|
|
1365
|
+
declare interface ValibotSchemaLike extends StandardSchemaV1<any> {
|
|
1366
|
+
type: string;
|
|
1367
|
+
}
|
|
1354
1368
|
|
|
1355
1369
|
export declare function withDefault<TParam extends Param>(param: TParam, defaultValue: ExtractParamType<TParam>): ParamWithDefault<TParam>;
|
|
1356
1370
|
|
|
@@ -1402,9 +1416,9 @@ declare type WithParent<TParent extends Route = Route> = {
|
|
|
1402
1416
|
parent: TParent;
|
|
1403
1417
|
};
|
|
1404
1418
|
|
|
1405
|
-
declare
|
|
1406
|
-
parse: (input: any) =>
|
|
1407
|
-
}
|
|
1419
|
+
declare interface ZodSchemaLike extends StandardSchemaV1<any> {
|
|
1420
|
+
parse: (input: any) => any;
|
|
1421
|
+
}
|
|
1408
1422
|
|
|
1409
1423
|
export { }
|
|
1410
1424
|
|