@kitbag/router 0.19.0 → 0.20.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/kitbag-router.d.ts +13 -4
- package/dist/kitbag-router.js +1495 -1355
- package/dist/kitbag-router.umd.cjs +3 -3
- package/package.json +12 -11
package/dist/kitbag-router.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { App } from 'vue';
|
|
2
2
|
import { AsyncComponentLoader } from 'vue';
|
|
3
|
+
import { BaseIssue } from 'valibot';
|
|
4
|
+
import { BaseSchema } from 'valibot';
|
|
3
5
|
import { Component } from 'vue';
|
|
4
6
|
import { ComponentOptionsMixin } from 'vue';
|
|
5
7
|
import { ComponentProvideOptions } from 'vue';
|
|
@@ -9,7 +11,10 @@ import { FunctionalComponent } from 'vue';
|
|
|
9
11
|
import { MaybeRefOrGetter } from 'vue';
|
|
10
12
|
import { PublicProps } from 'vue';
|
|
11
13
|
import { Ref } from 'vue';
|
|
14
|
+
import { UnionOptions } from 'valibot';
|
|
15
|
+
import { UnionSchema } from 'valibot';
|
|
12
16
|
import { UnwrapRef } from 'vue';
|
|
17
|
+
import { VariantSchema } from 'valibot';
|
|
13
18
|
import { VNode } from 'vue';
|
|
14
19
|
|
|
15
20
|
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
@@ -252,9 +257,9 @@ export declare type CreatedRouteOptions = Omit<CreateRouteOptions, 'props'> & Wi
|
|
|
252
257
|
props?: unknown;
|
|
253
258
|
};
|
|
254
259
|
|
|
255
|
-
export declare function createExternalRoute<const
|
|
260
|
+
export declare function createExternalRoute<const TOptions extends CreateRouteOptions & WithHost & WithoutParent>(options: TOptions): ToRoute<TOptions, undefined>;
|
|
256
261
|
|
|
257
|
-
export declare function createExternalRoute<const
|
|
262
|
+
export declare function createExternalRoute<const TOptions extends CreateRouteOptions & WithoutHost & WithParent>(options: TOptions): ToRoute<TOptions, undefined>;
|
|
258
263
|
|
|
259
264
|
export declare function createParam<TParam extends ParamWithDefault>(param: TParam): TParam;
|
|
260
265
|
|
|
@@ -589,7 +594,7 @@ declare type OnlyRequiredProperties<T> = {
|
|
|
589
594
|
[K in keyof T as Extract<T[K], undefined> extends never ? K : never]: T[K];
|
|
590
595
|
};
|
|
591
596
|
|
|
592
|
-
export declare type Param = ParamGetter | ParamGetSet | RegExp | BooleanConstructor | NumberConstructor | StringConstructor | DateConstructor | JSON | ZodSchemaLike | LiteralParam;
|
|
597
|
+
export declare type Param = ParamGetter | ParamGetSet | RegExp | BooleanConstructor | NumberConstructor | StringConstructor | DateConstructor | JSON | ZodSchemaLike | ValibotSchemaLike | LiteralParam;
|
|
593
598
|
|
|
594
599
|
declare type ParamEnd = typeof paramEnd;
|
|
595
600
|
|
|
@@ -1203,7 +1208,9 @@ declare type ToName<T extends string | undefined> = T extends string ? T : '';
|
|
|
1203
1208
|
|
|
1204
1209
|
declare type ToRoute<TOptions extends CreateRouteOptions, TProps extends CreateRouteProps<TOptions> | undefined> = CreateRouteOptions extends TOptions ? Route : TOptions extends {
|
|
1205
1210
|
parent: infer TParent extends Route;
|
|
1206
|
-
} ? Route<ToName<TOptions['name']>,
|
|
1211
|
+
} ? Route<ToName<TOptions['name']>, ToWithParams<TParent['host']>, CombinePath<ToWithParams<TParent['path']>, ToWithParams<TOptions['path']>>, CombineQuery<ToWithParams<TParent['query']>, ToWithParams<TOptions['query']>>, CombineHash<ToWithParams<TParent['hash']>, ToWithParams<TOptions['hash']>>, CombineMeta<ToMeta<TParent['meta']>, ToMeta<TOptions['meta']>>, CombineState<ToState<TParent['state']>, ToState<TOptions['state']>>, ToMatches<TOptions, TProps>> : Route<ToName<TOptions['name']>, TOptions extends {
|
|
1212
|
+
host: string | WithParams;
|
|
1213
|
+
} ? ToWithParams<TOptions['host']> : WithParams<'', {}>, ToWithParams<TOptions['path']>, ToWithParams<TOptions['query']>, ToWithParams<TOptions['hash']>, ToMeta<TOptions['meta']>, ToState<TOptions['state']>, ToMatches<TOptions, TProps>>;
|
|
1207
1214
|
|
|
1208
1215
|
declare type ToState<TState extends Record<string, Param> | undefined> = TState extends undefined ? Record<string, Param> : unknown extends TState ? {} : TState;
|
|
1209
1216
|
|
|
@@ -1343,6 +1350,8 @@ export declare class UseRouteInvalidError extends Error {
|
|
|
1343
1350
|
*/
|
|
1344
1351
|
export declare function useRouter(): RegisteredRouter;
|
|
1345
1352
|
|
|
1353
|
+
declare type ValibotSchemaLike = BaseSchema<unknown, unknown, BaseIssue<unknown>> | UnionSchema<UnionOptions, any> | VariantSchema<any, any, any>;
|
|
1354
|
+
|
|
1346
1355
|
export declare function withDefault<TParam extends Param>(param: TParam, defaultValue: ExtractParamType<TParam>): ParamWithDefault<TParam>;
|
|
1347
1356
|
|
|
1348
1357
|
/**
|