@kitbag/router 0.24.2 → 0.24.3
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 +1 -0
- package/dist/kitbag-router.js +6 -6
- package/dist/kitbag-router.umd.cjs +2 -2
- package/dist/src/components/routerLink.d.ts +4 -4
- package/dist/src/components/routerView.d.ts +3 -3
- package/dist/src/compositions/useComponentsStore.d.ts +2 -2
- package/dist/src/compositions/useLink.d.ts +6 -6
- package/dist/src/compositions/usePrefetching.d.ts +3 -3
- package/dist/src/compositions/usePropStore.d.ts +2 -2
- package/dist/src/compositions/useQueryValue.d.ts +3 -3
- package/dist/src/compositions/useRejection.d.ts +2 -2
- package/dist/src/compositions/useRoute.d.ts +2 -2
- package/dist/src/compositions/useRouter.d.ts +1 -1
- package/dist/src/compositions/useRouterDepth.d.ts +1 -1
- package/dist/src/compositions/useRouterHooks.d.ts +2 -2
- package/dist/src/compositions/useVisibilityObserver.d.ts +1 -1
- package/dist/src/devtools/createRouterDevtools.d.ts +2 -2
- package/dist/src/devtools/filters.d.ts +1 -1
- package/dist/src/errors/contextAbortError.d.ts +1 -1
- package/dist/src/errors/contextPushError.d.ts +1 -1
- package/dist/src/errors/contextRejectionError.d.ts +1 -1
- package/dist/src/errors/invalidRouteParamValueError.d.ts +1 -1
- package/dist/src/guards/routes.d.ts +2 -2
- package/dist/src/main.d.ts +2 -2
- package/dist/src/models/hooks.d.ts +2 -2
- package/dist/src/services/arrayOf.d.ts +2 -2
- package/dist/src/services/combineHash.d.ts +2 -2
- package/dist/src/services/combinePath.d.ts +2 -2
- package/dist/src/services/combineQuery.d.ts +2 -2
- package/dist/src/services/combineState.d.ts +1 -1
- package/dist/src/services/combineUrl.d.ts +2 -2
- package/dist/src/services/component.d.ts +2 -2
- package/dist/src/services/createComponentHooks.d.ts +4 -4
- package/dist/src/services/createComponentsStore.d.ts +2 -2
- package/dist/src/services/createCurrentRejection.d.ts +2 -2
- package/dist/src/services/createCurrentRoute.d.ts +4 -4
- package/dist/src/services/createExternalRoute.d.ts +4 -4
- package/dist/src/services/createParam.d.ts +3 -3
- package/dist/src/services/createPropStore.d.ts +3 -3
- package/dist/src/services/createRejection.d.ts +3 -3
- package/dist/src/services/createRejectionHooks.d.ts +3 -3
- package/dist/src/services/createResolvedRoute.d.ts +3 -3
- package/dist/src/services/createResolvedRouteQuery.d.ts +1 -1
- package/dist/src/services/createRoute.d.ts +5 -5
- package/dist/src/services/createRouteHooks.d.ts +5 -5
- package/dist/src/services/createRouteRedirects.d.ts +2 -2
- package/dist/src/services/createRouter.d.ts +3 -3
- package/dist/src/services/createRouterAssets.d.ts +10 -10
- package/dist/src/services/createRouterCallbackContext.d.ts +7 -7
- package/dist/src/services/createRouterHistory.d.ts +1 -1
- package/dist/src/services/createRouterHooks.d.ts +2 -2
- package/dist/src/services/createRouterKeyStore.d.ts +1 -1
- package/dist/src/services/createRouterPlugin.d.ts +3 -3
- package/dist/src/services/createRouterRoute.d.ts +4 -4
- package/dist/src/services/createUrl.d.ts +1 -1
- package/dist/src/services/getGlobalHooksForRouter.d.ts +2 -2
- package/dist/src/services/getGlobalRouteHooks.d.ts +2 -2
- package/dist/src/services/getMatchesForUrl.d.ts +3 -3
- package/dist/src/services/getParamsForString.d.ts +2 -2
- package/dist/src/services/getRejectionHooks.d.ts +2 -2
- package/dist/src/services/getRouteHooks.d.ts +2 -2
- package/dist/src/services/getRoutesForRouter.d.ts +6 -6
- package/dist/src/services/hooks.d.ts +2 -2
- package/dist/src/services/insertBaseRoute.d.ts +1 -1
- package/dist/src/services/literal.d.ts +1 -1
- package/dist/src/services/params.d.ts +3 -3
- package/dist/src/services/queryParamFilter.d.ts +1 -1
- package/dist/src/services/routeRegex.d.ts +1 -1
- package/dist/src/services/state.d.ts +1 -1
- package/dist/src/services/tupleOf.d.ts +2 -2
- package/dist/src/services/unionOf.d.ts +2 -2
- package/dist/src/services/urlParser.d.ts +2 -2
- package/dist/src/services/valibot.d.ts +1 -1
- package/dist/src/services/withDefault.d.ts +2 -2
- package/dist/src/services/withParams.d.ts +4 -4
- package/dist/src/services/zod.d.ts +2 -2
- package/dist/src/types/createRouteOptions.d.ts +17 -17
- package/dist/src/types/hooks.d.ts +12 -12
- package/dist/src/types/paramTypes.d.ts +2 -2
- package/dist/src/types/params.d.ts +1 -1
- package/dist/src/types/props.d.ts +2 -2
- package/dist/src/types/register.d.ts +1 -1
- package/dist/src/types/rejection.d.ts +4 -4
- package/dist/src/types/resolved.d.ts +4 -4
- package/dist/src/types/route.d.ts +9 -9
- package/dist/src/types/routeTitle.d.ts +1 -1
- package/dist/src/types/routeUpdate.d.ts +2 -2
- package/dist/src/types/routeWithParams.d.ts +3 -3
- package/dist/src/types/router.d.ts +13 -13
- package/dist/src/types/routerLink.d.ts +5 -5
- package/dist/src/types/routerPlugin.d.ts +2 -2
- package/dist/src/types/routerPush.d.ts +8 -8
- package/dist/src/types/routerReject.d.ts +1 -1
- package/dist/src/types/routerReplace.d.ts +8 -8
- package/dist/src/types/routerResolve.d.ts +7 -7
- package/dist/src/types/routerRoute.d.ts +3 -3
- package/dist/src/types/routesMap.d.ts +2 -2
- package/dist/src/types/state.d.ts +6 -6
- package/dist/src/types/url.d.ts +6 -6
- package/dist/src/types/useLink.d.ts +5 -5
- package/dist/src/utilities/checkDuplicateNames.d.ts +1 -1
- package/dist/src/utilities/isNamedRoute.d.ts +1 -1
- package/dist/src/utilities/prefetch.d.ts +1 -1
- package/dist/src/utilities/setDocumentTitle.d.ts +1 -1
- package/dist/src/utilities/urlSearchParams.d.ts +1 -1
- package/package.json +10 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Route, RouteInternal, Routes } from '
|
|
2
|
-
import { RouterPlugin } from '
|
|
3
|
-
import { BuiltInRejectionType, Rejection, RejectionInternal } from '
|
|
4
|
-
import { RouterOptions } from '
|
|
1
|
+
import { Route, RouteInternal, Routes } from '../types/route';
|
|
2
|
+
import { RouterPlugin } from '../types/routerPlugin';
|
|
3
|
+
import { BuiltInRejectionType, Rejection, RejectionInternal } from '../types/rejection';
|
|
4
|
+
import { RouterOptions } from '../types/router';
|
|
5
5
|
/**
|
|
6
6
|
* Takes in routes and plugins and returns a list of routes with the base route inserted if provided.
|
|
7
7
|
* Also checks for duplicate names in the routes.
|
|
@@ -11,8 +11,8 @@ import { RouterOptions } from '../../types/router';
|
|
|
11
11
|
export declare function getRoutesForRouter(routes: Routes | Routes[], plugins?: RouterPlugin[], options?: RouterOptions): {
|
|
12
12
|
routes: (import('../main').Url & {
|
|
13
13
|
id: string;
|
|
14
|
-
matched: import('
|
|
15
|
-
matches: import('
|
|
14
|
+
matched: import('../types/route').CreatedRouteOptions;
|
|
15
|
+
matches: import('../types/route').CreatedRouteOptions[];
|
|
16
16
|
name: string;
|
|
17
17
|
meta: Record<string, unknown>;
|
|
18
18
|
state: Record<string, import('../main').Param>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HookLifecycle } from '
|
|
2
|
-
import { ResolvedRoute } from '
|
|
1
|
+
import { HookLifecycle } from '../types/hooks';
|
|
2
|
+
import { ResolvedRoute } from '../types/resolved';
|
|
3
3
|
type RouteHookCondition = (to: ResolvedRoute, from: ResolvedRoute | null, depth: number) => boolean;
|
|
4
4
|
export declare const isRouteEnter: RouteHookCondition;
|
|
5
5
|
export declare const isRouteLeave: RouteHookCondition;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Route } from '
|
|
1
|
+
import { Route } from '../types/route';
|
|
2
2
|
export declare function insertBaseRoute<T extends Route>(route: T, base?: string): T;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LiteralParam, ParamGetSet } from '
|
|
1
|
+
import { LiteralParam, ParamGetSet } from '../types/paramTypes';
|
|
2
2
|
export declare function literal<T extends LiteralParam>(value: T): ParamGetSet<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UrlParam } from '
|
|
2
|
-
import { ExtractParamType } from '
|
|
3
|
-
import { Param } from '
|
|
1
|
+
import { UrlParam } from './withParams';
|
|
2
|
+
import { ExtractParamType } from '../types/params';
|
|
3
|
+
import { Param } from '../types/paramTypes';
|
|
4
4
|
export declare function getParam(params: Record<string, Param | undefined>, paramName: string): Param;
|
|
5
5
|
export declare function getParamValue<T extends Param>(value: string | undefined, param: Partial<UrlParam<T>>): ExtractParamType<T>;
|
|
6
6
|
export declare function safeGetParamValue<T extends Param>(value: string | undefined, param: Partial<UrlParam<T>>): ExtractParamType<T> | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QuerySource } from '
|
|
1
|
+
import { QuerySource } from '../types/querySource';
|
|
2
2
|
export declare function filterQueryParams(source: QuerySource, exclude: QuerySource): URLSearchParams;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UrlPart } from '
|
|
1
|
+
import { UrlPart } from './withParams';
|
|
2
2
|
export declare const paramRegex = "\\[\\??([\\w-_]+)\\*?\\]";
|
|
3
3
|
export declare const optionalParamRegex = "\\[\\?([\\w-_]+)\\*?\\]";
|
|
4
4
|
export declare const requiredParamRegex = "\\[([\\w-_]+)\\*?\\]";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Param, ParamGetSet } from '
|
|
2
|
-
import { ExtractParamType } from '
|
|
1
|
+
import { Param, ParamGetSet } from '../types/paramTypes';
|
|
2
|
+
import { ExtractParamType } from '../types/params';
|
|
3
3
|
type TupleOfOptions = {
|
|
4
4
|
separator?: string;
|
|
5
5
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Param, ParamGetSet } from '
|
|
2
|
-
import { ExtractParamType } from '
|
|
1
|
+
import { Param, ParamGetSet } from '../types/paramTypes';
|
|
2
|
+
import { ExtractParamType } from '../types/params';
|
|
3
3
|
export declare function unionOf<const T extends Param[]>(params: T): ParamGetSet<ExtractParamType<T[number]>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ExtractParamType } from '
|
|
2
|
-
import { Param, ParamGetSet } from '
|
|
1
|
+
import { ExtractParamType } from '../types/params';
|
|
2
|
+
import { Param, ParamGetSet } from '../types/paramTypes';
|
|
3
3
|
export type ParamWithDefault<TParam extends Param = Param> = Required<ParamGetSet<ExtractParamType<TParam>>>;
|
|
4
4
|
export declare function isParamWithDefault(param: Param): param is ParamWithDefault;
|
|
5
5
|
export declare function withDefault<TParam extends Param>(param: TParam, defaultValue: ExtractParamType<TParam>): ParamWithDefault<TParam>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ExtractParamName, ParamEnd, ParamIsGreedy, ParamIsOptionalOrHasDefault, ParamStart } from '
|
|
2
|
-
import { Param } from '
|
|
3
|
-
import { Identity } from '
|
|
4
|
-
import { MakeOptional } from '
|
|
1
|
+
import { ExtractParamName, ParamEnd, ParamIsGreedy, ParamIsOptionalOrHasDefault, ParamStart } from '../types/params';
|
|
2
|
+
import { Param } from '../types/paramTypes';
|
|
3
|
+
import { Identity } from '../types/utilities';
|
|
4
|
+
import { MakeOptional } from '../utilities/makeOptional';
|
|
5
5
|
type WithParamsParamsInput<TValue extends string> = TValue extends `${string}${ParamStart}${infer TParam}${ParamEnd}${infer Rest}` ? Record<ExtractParamName<TParam>, Param | undefined> & WithParamsParamsInput<Rest> : {};
|
|
6
6
|
type WithParamsParamsOutput<TValue extends string, TParams extends Record<string, Param | undefined> = Record<never, never>> = TValue extends `${string}${ParamStart}${infer TParam}${ParamEnd}${infer Rest}` ? ExtractParamName<TParam> extends keyof TParams ? TParams[ExtractParamName<TParam>] extends Param ? Record<ExtractParamName<TParam>, {
|
|
7
7
|
param: TParams[ExtractParamName<TParam>];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ParamGetSet } from '
|
|
2
|
-
import { Routes } from '
|
|
1
|
+
import { ParamGetSet } from '../types/paramTypes';
|
|
2
|
+
import { Routes } from '../types/route';
|
|
3
3
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
4
4
|
import { ZodType } from 'zod';
|
|
5
5
|
export interface ZodSchemaLike extends StandardSchemaV1<any> {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
|
-
import { CombineMeta } from '
|
|
3
|
-
import { CombineState } from '
|
|
4
|
-
import { Param } from '
|
|
5
|
-
import { PrefetchConfig } from '
|
|
6
|
-
import { RouteMeta } from '
|
|
7
|
-
import { Route } from '
|
|
2
|
+
import { CombineMeta } from '../services/combineMeta';
|
|
3
|
+
import { CombineState } from '../services/combineState';
|
|
4
|
+
import { Param } from './paramTypes';
|
|
5
|
+
import { PrefetchConfig } from './prefetch';
|
|
6
|
+
import { RouteMeta } from './register';
|
|
7
|
+
import { Route } from './route';
|
|
8
8
|
import { ResolvedRoute } from './resolved';
|
|
9
|
-
import { ComponentProps } from '
|
|
10
|
-
import { PropsCallbackContext } from '
|
|
11
|
-
import { Identity, MaybePromise } from '
|
|
12
|
-
import { ToMeta } from '
|
|
13
|
-
import { ToState } from '
|
|
14
|
-
import { ToName } from '
|
|
15
|
-
import { UrlPart, UrlQueryPart } from '
|
|
16
|
-
import { RouteContext, ToRouteContext } from '
|
|
17
|
-
import { RouterViewProps } from '
|
|
18
|
-
import { ToUrl } from '
|
|
19
|
-
import { CombineUrl } from '
|
|
9
|
+
import { ComponentProps } from '../services/component';
|
|
10
|
+
import { PropsCallbackContext } from './props';
|
|
11
|
+
import { Identity, MaybePromise } from './utilities';
|
|
12
|
+
import { ToMeta } from './meta';
|
|
13
|
+
import { ToState } from './state';
|
|
14
|
+
import { ToName } from './name';
|
|
15
|
+
import { UrlPart, UrlQueryPart } from '../services/withParams';
|
|
16
|
+
import { RouteContext, ToRouteContext } from './routeContext';
|
|
17
|
+
import { RouterViewProps } from '../components/routerView';
|
|
18
|
+
import { ToUrl } from './url';
|
|
19
|
+
import { CombineUrl } from '../services/combineUrl';
|
|
20
20
|
export type WithHost<THost extends string | UrlPart = string | UrlPart> = {
|
|
21
21
|
/**
|
|
22
22
|
* Host part of URL.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Hooks } from '
|
|
2
|
-
import { ResolvedRoute, RouterResolvedRouteUnion, ResolvedRouteUnion } from '
|
|
3
|
-
import { MaybePromise } from '
|
|
4
|
-
import { Route, Routes } from '
|
|
5
|
-
import { RouterReject } from '
|
|
6
|
-
import { RouterPush } from '
|
|
7
|
-
import { RouterReplace } from '
|
|
8
|
-
import { Rejection, Rejections } from '
|
|
9
|
-
import { RouteContext, RouteContextToRejection, RouteContextToRoute } from '
|
|
10
|
-
import { RouterAbort } from '
|
|
11
|
-
import { CallbackContextAbort, CallbackContextPush, CallbackContextReject, CallbackContextSuccess } from '
|
|
12
|
-
import { RouteUpdate } from '
|
|
1
|
+
import { Hooks } from '../models/hooks';
|
|
2
|
+
import { ResolvedRoute, RouterResolvedRouteUnion, ResolvedRouteUnion } from './resolved';
|
|
3
|
+
import { MaybePromise } from './utilities';
|
|
4
|
+
import { Route, Routes } from './route';
|
|
5
|
+
import { RouterReject } from './routerReject';
|
|
6
|
+
import { RouterPush } from './routerPush';
|
|
7
|
+
import { RouterReplace } from './routerReplace';
|
|
8
|
+
import { Rejection, Rejections } from './rejection';
|
|
9
|
+
import { RouteContext, RouteContextToRejection, RouteContextToRoute } from './routeContext';
|
|
10
|
+
import { RouterAbort } from './routerAbort';
|
|
11
|
+
import { CallbackContextAbort, CallbackContextPush, CallbackContextReject, CallbackContextSuccess } from './callbackContext';
|
|
12
|
+
import { RouteUpdate } from './routeUpdate';
|
|
13
13
|
export declare function getHooks(value: Record<string, unknown> | undefined | null): Hooks[];
|
|
14
14
|
export declare function combineHooks(parent: Route, child: Route): Hooks[];
|
|
15
15
|
export type InternalRouteHooks<TRoute extends Route = Route, TContext extends RouteContext[] | undefined = undefined> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ValibotSchemaLike } from '
|
|
2
|
-
import { ZodSchemaLike } from '
|
|
1
|
+
import { ValibotSchemaLike } from '../services/valibot';
|
|
2
|
+
import { ZodSchemaLike } from '../services/zod';
|
|
3
3
|
export type ParamExtras = {
|
|
4
4
|
invalid: (message?: string) => never;
|
|
5
5
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LiteralParam, Param, ParamGetSet, ParamGetter } from '
|
|
1
|
+
import { LiteralParam, Param, ParamGetSet, ParamGetter } from './paramTypes';
|
|
2
2
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
3
|
export declare const paramStart = "[";
|
|
4
4
|
export type ParamStart = typeof paramStart;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CreateRouteOptions, PropsGetter } from '
|
|
2
|
-
import { Route } from '
|
|
1
|
+
import { CreateRouteOptions, PropsGetter } from './createRouteOptions';
|
|
2
|
+
import { Route } from './route';
|
|
3
3
|
import { RouterReject } from './routerReject';
|
|
4
4
|
import { RouterPush } from './routerPush';
|
|
5
5
|
import { RouterReplace } from './routerReplace';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Router } from '
|
|
1
|
+
import { Router } from './router';
|
|
2
2
|
/**
|
|
3
3
|
* Represents the state of currently registered router, and route meta. Used to provide correct type context for
|
|
4
4
|
* components like `RouterLink`, as well as for composables like `useRouter`, `useRoute`, and hooks.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { Route } from '
|
|
3
|
-
import { Router } from '
|
|
4
|
-
import { RouterReject } from '
|
|
5
|
-
import { Hooks } from '
|
|
2
|
+
import { Route } from './route';
|
|
3
|
+
import { Router } from './router';
|
|
4
|
+
import { RouterReject } from './routerReject';
|
|
5
|
+
import { Hooks } from '../models/hooks';
|
|
6
6
|
export declare const BUILT_IN_REJECTION_TYPES: readonly ["NotFound"];
|
|
7
7
|
export type BuiltInRejectionType = (typeof BUILT_IN_REJECTION_TYPES)[number];
|
|
8
8
|
export type RouterRejection<T extends Rejection = Rejection> = Ref<T | null>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Route, Routes } from '
|
|
2
|
-
import { ExtractRouteStateParamsAsOptional } from '
|
|
3
|
-
import { UrlString } from '
|
|
4
|
-
import { UrlParamsReading } from '
|
|
1
|
+
import { Route, Routes } from './route';
|
|
2
|
+
import { ExtractRouteStateParamsAsOptional } from './state';
|
|
3
|
+
import { UrlString } from './urlString';
|
|
4
|
+
import { UrlParamsReading } from './url';
|
|
5
5
|
/**
|
|
6
6
|
* Represents a route that the router has matched to current browser location.
|
|
7
7
|
* @template TRoute - Underlying Route that has been resolved.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Param } from '
|
|
2
|
-
import { PrefetchConfig } from '
|
|
3
|
-
import { RouteMeta } from '
|
|
4
|
-
import { LastInArray } from '
|
|
5
|
-
import { CreateRouteOptions } from '
|
|
6
|
-
import { RouteContext } from '
|
|
7
|
-
import { Url } from '
|
|
8
|
-
import { GetRouteTitle } from '
|
|
9
|
-
import { Hooks } from '
|
|
1
|
+
import { Param } from './paramTypes';
|
|
2
|
+
import { PrefetchConfig } from './prefetch';
|
|
3
|
+
import { RouteMeta } from './register';
|
|
4
|
+
import { LastInArray } from './utilities';
|
|
5
|
+
import { CreateRouteOptions } from './createRouteOptions';
|
|
6
|
+
import { RouteContext } from './routeContext';
|
|
7
|
+
import { Url } from './url';
|
|
8
|
+
import { GetRouteTitle } from './routeTitle';
|
|
9
|
+
import { Hooks } from '../models/hooks';
|
|
10
10
|
import { RouteRedirect } from './redirects';
|
|
11
11
|
export declare const IS_ROUTE_SYMBOL: unique symbol;
|
|
12
12
|
export declare function isRoute(value: unknown): value is Route & RouteInternal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ResolvedRoute } from '
|
|
2
|
-
import { RouterPushOptions } from '
|
|
1
|
+
import { ResolvedRoute } from './resolved';
|
|
2
|
+
import { RouterPushOptions } from './routerPush';
|
|
3
3
|
export type RouteUpdate<TRoute extends ResolvedRoute = ResolvedRoute> = ResolvedRoute extends TRoute ? {
|
|
4
4
|
(paramName: string, paramValue: unknown, options?: RouterPushOptions): Promise<void>;
|
|
5
5
|
(params: Partial<TRoute['params']>, options?: RouterPushOptions): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Route, Routes } from '
|
|
2
|
-
import { RoutesName, RoutesMap } from '
|
|
3
|
-
import { UrlParamsWriting } from '
|
|
1
|
+
import { Route, Routes } from './route';
|
|
2
|
+
import { RoutesName, RoutesMap } from './routesMap';
|
|
3
|
+
import { UrlParamsWriting } from './url';
|
|
4
4
|
export type RouteGetByKey<TRoutes extends Routes, TKey extends RoutesName<TRoutes>> = RoutesMap<TRoutes>[TKey];
|
|
5
5
|
export type RouteParamsByKey<TRoutes extends Routes, TKey extends string> = RouteGetByKey<TRoutes, TKey> extends Route ? UrlParamsWriting<RouteGetByKey<TRoutes, TKey>> : Record<string, unknown>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { App, InjectionKey, Ref } from 'vue';
|
|
2
|
-
import { RouterHistoryMode } from '
|
|
3
|
-
import { RouterRoute } from '
|
|
4
|
-
import { AddBeforeEnterHook, AddBeforeUpdateHook, AddBeforeLeaveHook, AddAfterEnterHook, AddAfterUpdateHook, AddAfterLeaveHook, AddErrorHook, AddRejectionHook } from '
|
|
5
|
-
import { PrefetchConfig } from '
|
|
6
|
-
import { ResolvedRoute } from '
|
|
7
|
-
import { Route, Routes } from '
|
|
8
|
-
import { RouterPush } from '
|
|
9
|
-
import { RouterReplace } from '
|
|
10
|
-
import { RouterResolve, RouterResolveOptions } from '
|
|
11
|
-
import { RouterReject } from '
|
|
12
|
-
import { RouterPlugin } from '
|
|
13
|
-
import { RoutesName } from '
|
|
14
|
-
import { ExtractRejections, ExtractRejectionTypes, Rejections, BuiltInRejectionType } from '
|
|
2
|
+
import { RouterHistoryMode } from '../services/createRouterHistory';
|
|
3
|
+
import { RouterRoute } from './routerRoute';
|
|
4
|
+
import { AddBeforeEnterHook, AddBeforeUpdateHook, AddBeforeLeaveHook, AddAfterEnterHook, AddAfterUpdateHook, AddAfterLeaveHook, AddErrorHook, AddRejectionHook } from './hooks';
|
|
5
|
+
import { PrefetchConfig } from './prefetch';
|
|
6
|
+
import { ResolvedRoute } from './resolved';
|
|
7
|
+
import { Route, Routes } from './route';
|
|
8
|
+
import { RouterPush } from './routerPush';
|
|
9
|
+
import { RouterReplace } from './routerReplace';
|
|
10
|
+
import { RouterResolve, RouterResolveOptions } from './routerResolve';
|
|
11
|
+
import { RouterReject } from './routerReject';
|
|
12
|
+
import { RouterPlugin } from './routerPlugin';
|
|
13
|
+
import { RoutesName } from './routesMap';
|
|
14
|
+
import { ExtractRejections, ExtractRejectionTypes, Rejections, BuiltInRejectionType } from './rejection';
|
|
15
15
|
/**
|
|
16
16
|
* Options to initialize a {@link Router} instance.
|
|
17
17
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { PrefetchConfig } from '
|
|
2
|
-
import { UrlString } from '
|
|
3
|
-
import { ResolvedRoute } from '
|
|
4
|
-
import { Router } from '
|
|
5
|
-
import { RouterPushOptions } from '
|
|
1
|
+
import { PrefetchConfig } from './prefetch';
|
|
2
|
+
import { UrlString } from './urlString';
|
|
3
|
+
import { ResolvedRoute } from './resolved';
|
|
4
|
+
import { Router } from './router';
|
|
5
|
+
import { RouterPushOptions } from './routerPush';
|
|
6
6
|
export type ToCallback<TRouter extends Router> = (resolve: TRouter['resolve']) => ResolvedRoute | UrlString | undefined;
|
|
7
7
|
export type RouterLinkProps<TRouter extends Router> = RouterPushOptions & {
|
|
8
8
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { HookRemove } from './hooks';
|
|
2
2
|
import { Routes } from './route';
|
|
3
3
|
import { Rejections } from './rejection';
|
|
4
|
-
import { Hooks } from '
|
|
4
|
+
import { Hooks } from '../models/hooks';
|
|
5
5
|
import { ResolvedRoute } from './resolved';
|
|
6
6
|
import { RouterReject } from './routerReject';
|
|
7
7
|
import { RouterPush } from './routerPush';
|
|
8
8
|
import { RouterReplace } from './routerReplace';
|
|
9
|
-
import { CallbackContextAbort } from '
|
|
9
|
+
import { CallbackContextAbort } from '../services/createRouterCallbackContext';
|
|
10
10
|
import { MaybePromise } from './utilities';
|
|
11
11
|
export type EmptyRouterPlugin = RouterPlugin<[], []>;
|
|
12
12
|
export declare const IS_ROUTER_PLUGIN_SYMBOL: unique symbol;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Routes } from '
|
|
2
|
-
import { RoutesName } from '
|
|
3
|
-
import { RouteParamsByKey } from '
|
|
4
|
-
import { RouteStateByName } from '
|
|
5
|
-
import { UrlString } from '
|
|
6
|
-
import { AllPropertiesAreOptional } from '
|
|
7
|
-
import { QuerySource } from '
|
|
8
|
-
import { ResolvedRoute } from '
|
|
1
|
+
import { Routes } from './route';
|
|
2
|
+
import { RoutesName } from './routesMap';
|
|
3
|
+
import { RouteParamsByKey } from './routeWithParams';
|
|
4
|
+
import { RouteStateByName } from './state';
|
|
5
|
+
import { UrlString } from './urlString';
|
|
6
|
+
import { AllPropertiesAreOptional } from './utilities';
|
|
7
|
+
import { QuerySource } from './querySource';
|
|
8
|
+
import { ResolvedRoute } from './resolved';
|
|
9
9
|
export type RouterPushOptions<TState = unknown> = {
|
|
10
10
|
/**
|
|
11
11
|
* The query string to add to the url.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BuiltInRejectionType, Rejections, RejectionType } from '
|
|
1
|
+
import { BuiltInRejectionType, Rejections, RejectionType } from './rejection';
|
|
2
2
|
export type RouterReject<TRejections extends Rejections | undefined> = <TSource extends (RejectionType<TRejections> | BuiltInRejectionType)>(type: TSource) => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Routes } from '
|
|
2
|
-
import { RoutesName } from '
|
|
3
|
-
import { RouteParamsByKey } from '
|
|
4
|
-
import { RouteStateByName } from '
|
|
5
|
-
import { UrlString } from '
|
|
6
|
-
import { AllPropertiesAreOptional } from '
|
|
7
|
-
import { QuerySource } from '
|
|
8
|
-
import { ResolvedRoute } from '
|
|
1
|
+
import { Routes } from './route';
|
|
2
|
+
import { RoutesName } from './routesMap';
|
|
3
|
+
import { RouteParamsByKey } from './routeWithParams';
|
|
4
|
+
import { RouteStateByName } from './state';
|
|
5
|
+
import { UrlString } from './urlString';
|
|
6
|
+
import { AllPropertiesAreOptional } from './utilities';
|
|
7
|
+
import { QuerySource } from './querySource';
|
|
8
|
+
import { ResolvedRoute } from './resolved';
|
|
9
9
|
export type RouterReplaceOptions<TState = unknown> = {
|
|
10
10
|
query?: QuerySource;
|
|
11
11
|
hash?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Routes } from '
|
|
2
|
-
import { RoutesName } from '
|
|
3
|
-
import { RouteParamsByKey } from '
|
|
4
|
-
import { AllPropertiesAreOptional } from '
|
|
5
|
-
import { QuerySource } from '
|
|
6
|
-
import { ResolvedRoute } from '
|
|
7
|
-
import { RouteStateByName } from '
|
|
1
|
+
import { Routes } from './route';
|
|
2
|
+
import { RoutesName } from './routesMap';
|
|
3
|
+
import { RouteParamsByKey } from './routeWithParams';
|
|
4
|
+
import { AllPropertiesAreOptional } from './utilities';
|
|
5
|
+
import { QuerySource } from './querySource';
|
|
6
|
+
import { ResolvedRoute } from './resolved';
|
|
7
|
+
import { RouteStateByName } from './state';
|
|
8
8
|
export type RouterResolveOptions<TState = unknown> = {
|
|
9
9
|
query?: QuerySource;
|
|
10
10
|
hash?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RouteUpdate } from '
|
|
2
|
-
import { ResolvedRoute } from '
|
|
3
|
-
import { QuerySource } from '
|
|
1
|
+
import { RouteUpdate } from './routeUpdate';
|
|
2
|
+
import { ResolvedRoute } from './resolved';
|
|
3
|
+
import { QuerySource } from './querySource';
|
|
4
4
|
export type RouterRoute<TRoute extends ResolvedRoute = ResolvedRoute> = {
|
|
5
5
|
/**
|
|
6
6
|
* Unique identifier for the route, generated by router.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Route, Routes } from '
|
|
2
|
-
import { StringHasValue } from '
|
|
1
|
+
import { Route, Routes } from './route';
|
|
2
|
+
import { StringHasValue } from '../utilities/guards';
|
|
3
3
|
type IsRouteUnnamed<T extends Route> = StringHasValue<T['name']> extends true ? false : true;
|
|
4
4
|
type AsNamedRoute<T extends Route> = IsRouteUnnamed<T> extends true ? never : T;
|
|
5
5
|
export type RoutesMap<TRoutes extends Routes = []> = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ExtractParamName, ExtractParamType } from '
|
|
2
|
-
import { Param } from '
|
|
3
|
-
import { Routes } from '
|
|
4
|
-
import { RouteGetByKey } from '
|
|
5
|
-
import { MakeOptional } from '
|
|
6
|
-
import { Identity } from '
|
|
1
|
+
import { ExtractParamName, ExtractParamType } from './params';
|
|
2
|
+
import { Param } from './paramTypes';
|
|
3
|
+
import { Routes } from './route';
|
|
4
|
+
import { RouteGetByKey } from './routeWithParams';
|
|
5
|
+
import { MakeOptional } from '../utilities/makeOptional';
|
|
6
|
+
import { Identity } from './utilities';
|
|
7
7
|
export type ToState<TState extends Record<string, Param> | undefined> = TState extends undefined ? Record<string, Param> : unknown extends TState ? {} : TState;
|
|
8
8
|
export type ExtractRouteStateParamsAsOptional<TParams extends Record<string, Param>> = {
|
|
9
9
|
[K in keyof TParams]: ExtractParamType<TParams[K]> | undefined;
|
package/dist/src/types/url.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OptionalUrlParam, UrlQueryPart, ToUrlQueryPart, RequiredUrlParam, ToUrlPart, UrlParams, UrlPart } from '
|
|
2
|
-
import { ExtractParamType } from '
|
|
3
|
-
import { AllPropertiesAreOptional, Identity } from '
|
|
4
|
-
import { UrlString } from '
|
|
5
|
-
import { ParamGetSet } from '
|
|
6
|
-
import { MakeOptional } from '
|
|
1
|
+
import { OptionalUrlParam, UrlQueryPart, ToUrlQueryPart, RequiredUrlParam, ToUrlPart, UrlParams, UrlPart } from '../services/withParams';
|
|
2
|
+
import { ExtractParamType } from './params';
|
|
3
|
+
import { AllPropertiesAreOptional, Identity } from './utilities';
|
|
4
|
+
import { UrlString } from './urlString';
|
|
5
|
+
import { ParamGetSet } from './paramTypes';
|
|
6
|
+
import { MakeOptional } from '../utilities/makeOptional';
|
|
7
7
|
export declare const IS_URL_SYMBOL: unique symbol;
|
|
8
8
|
export type UrlInternal = {
|
|
9
9
|
[IS_URL_SYMBOL]: true;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ComputedRef, Ref } from 'vue';
|
|
2
|
-
import { PrefetchConfig } from '
|
|
3
|
-
import { ResolvedRoute } from '
|
|
4
|
-
import { RouterPushOptions } from '
|
|
5
|
-
import { RouterReplaceOptions } from '
|
|
6
|
-
import { UrlString } from '
|
|
2
|
+
import { PrefetchConfig } from './prefetch';
|
|
3
|
+
import { ResolvedRoute } from './resolved';
|
|
4
|
+
import { RouterPushOptions } from './routerPush';
|
|
5
|
+
import { RouterReplaceOptions } from './routerReplace';
|
|
6
|
+
import { UrlString } from './urlString';
|
|
7
7
|
export type UseLink = {
|
|
8
8
|
/**
|
|
9
9
|
* A template ref to bind to the dom for automatic prefetching
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Routes } from '
|
|
1
|
+
import { Routes } from '../types/route';
|
|
2
2
|
export declare function checkDuplicateNames(routes: Routes): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PrefetchConfig, PrefetchConfigOptions, PrefetchConfigs, PrefetchStrategy } from '
|
|
1
|
+
import { PrefetchConfig, PrefetchConfigOptions, PrefetchConfigs, PrefetchStrategy } from '../types/prefetch';
|
|
2
2
|
export declare const DEFAULT_PREFETCH_STRATEGY: PrefetchStrategy;
|
|
3
3
|
export declare function getPrefetchOption({ routerPrefetch, routePrefetch, linkPrefetch }: PrefetchConfigs, setting: keyof PrefetchConfigOptions): false | PrefetchStrategy;
|
|
4
4
|
export declare function getPrefetchConfigValue(prefetch: PrefetchConfig | undefined, setting: keyof PrefetchConfigOptions): boolean | PrefetchStrategy | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ResolvedRoute } from '
|
|
1
|
+
import { ResolvedRoute } from '../types/resolved';
|
|
2
2
|
export declare function setDocumentTitle(to: ResolvedRoute | null): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QuerySource } from '
|
|
1
|
+
import { QuerySource } from '../types/querySource';
|
|
2
2
|
export declare function combineUrlSearchParams(...paramGroups: (URLSearchParams | QuerySource)[]): URLSearchParams;
|