@kitbag/router 0.24.1 → 0.24.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 +0 -1
- package/dist/kitbag-router.js +970 -998
- package/dist/kitbag-router.umd.cjs +2 -2
- package/dist/{components → src/components}/routerLink.d.ts +4 -4
- package/dist/{components → src/components}/routerView.d.ts +3 -3
- package/dist/{compositions → src/compositions}/useComponentsStore.d.ts +2 -2
- package/dist/{compositions → src/compositions}/useLink.d.ts +6 -6
- package/dist/{compositions → src/compositions}/usePrefetching.d.ts +3 -3
- package/dist/{compositions → src/compositions}/usePropStore.d.ts +2 -2
- package/dist/{compositions → src/compositions}/useQueryValue.d.ts +3 -3
- package/dist/{compositions → src/compositions}/useRejection.d.ts +2 -2
- package/dist/{compositions → src/compositions}/useRoute.d.ts +2 -2
- package/dist/{compositions → src/compositions}/useRouter.d.ts +1 -1
- package/dist/{compositions → src/compositions}/useRouterDepth.d.ts +1 -1
- package/dist/{compositions → src/compositions}/useRouterHooks.d.ts +2 -2
- package/dist/{compositions → src/compositions}/useVisibilityObserver.d.ts +1 -1
- package/dist/{devtools → src/devtools}/createRouterDevtools.d.ts +2 -2
- package/dist/{devtools → src/devtools}/filters.d.ts +1 -1
- package/dist/{errors → src/errors}/contextAbortError.d.ts +1 -1
- package/dist/{errors → src/errors}/contextPushError.d.ts +1 -1
- package/dist/{errors → src/errors}/contextRejectionError.d.ts +1 -1
- package/dist/{errors → src/errors}/invalidRouteParamValueError.d.ts +1 -1
- package/dist/{guards → src/guards}/routes.d.ts +2 -2
- package/dist/{main.d.ts → src/main.d.ts} +2 -2
- package/dist/{models → src/models}/hooks.d.ts +2 -2
- package/dist/{services → src/services}/arrayOf.d.ts +2 -2
- package/dist/{services → src/services}/combineHash.d.ts +2 -2
- package/dist/{services → src/services}/combinePath.d.ts +2 -2
- package/dist/{services → src/services}/combineQuery.d.ts +2 -2
- package/dist/{services → src/services}/combineState.d.ts +1 -1
- package/dist/{services → src/services}/combineUrl.d.ts +2 -2
- package/dist/{services → src/services}/component.d.ts +2 -2
- package/dist/{services → src/services}/createComponentHooks.d.ts +4 -4
- package/dist/{services → src/services}/createComponentsStore.d.ts +2 -2
- package/dist/{services → src/services}/createCurrentRejection.d.ts +4 -1
- package/dist/{services → src/services}/createCurrentRoute.d.ts +4 -4
- package/dist/{services → src/services}/createExternalRoute.d.ts +4 -4
- package/dist/{services → src/services}/createParam.d.ts +3 -3
- package/dist/{services → src/services}/createPropStore.d.ts +3 -3
- package/dist/src/services/createRejection.d.ts +8 -0
- package/dist/{services → src/services}/createRejectionHooks.d.ts +3 -3
- package/dist/src/services/createResolvedRoute.d.ts +4 -0
- package/dist/{services → src/services}/createResolvedRouteQuery.d.ts +1 -1
- package/dist/{services → src/services}/createRoute.d.ts +5 -5
- package/dist/{services → src/services}/createRouteHooks.d.ts +5 -5
- package/dist/{services → src/services}/createRouteRedirects.d.ts +2 -2
- package/dist/{services → src/services}/createRouter.d.ts +3 -3
- package/dist/{services → src/services}/createRouterAssets.d.ts +10 -10
- package/dist/{services → src/services}/createRouterCallbackContext.d.ts +7 -7
- package/dist/{services → src/services}/createRouterHistory.d.ts +1 -1
- package/dist/{services → src/services}/createRouterHooks.d.ts +2 -2
- package/dist/{services → src/services}/createRouterKeyStore.d.ts +1 -1
- package/dist/{services → src/services}/createRouterPlugin.d.ts +3 -3
- package/dist/{services → src/services}/createRouterRoute.d.ts +4 -4
- package/dist/{services → src/services}/createUrl.d.ts +1 -1
- package/dist/src/services/getGlobalHooksForRouter.d.ts +3 -0
- package/dist/{services → src/services}/getGlobalRouteHooks.d.ts +2 -2
- package/dist/{services → src/services}/getMatchesForUrl.d.ts +3 -3
- package/dist/{services → src/services}/getParamsForString.d.ts +2 -2
- package/dist/src/services/getRejectionHooks.d.ts +3 -0
- package/dist/{services → src/services}/getRouteHooks.d.ts +2 -2
- package/dist/{services → src/services}/getRoutesForRouter.d.ts +6 -6
- package/dist/{services → src/services}/hooks.d.ts +2 -2
- package/dist/{services → src/services}/insertBaseRoute.d.ts +1 -1
- package/dist/{services → src/services}/literal.d.ts +1 -1
- package/dist/{services → src/services}/params.d.ts +3 -3
- package/dist/{services → src/services}/queryParamFilter.d.ts +1 -1
- package/dist/{services → src/services}/routeRegex.d.ts +1 -1
- package/dist/{services → src/services}/state.d.ts +1 -1
- package/dist/{services → src/services}/tupleOf.d.ts +2 -2
- package/dist/src/services/unionOf.d.ts +3 -0
- package/dist/{services → src/services}/urlParser.d.ts +2 -2
- package/dist/{services → src/services}/valibot.d.ts +1 -1
- package/dist/{services → src/services}/withDefault.d.ts +2 -2
- package/dist/{services → src/services}/withParams.d.ts +4 -4
- package/dist/{services → src/services}/zod.d.ts +2 -2
- package/dist/{types → src/types}/createRouteOptions.d.ts +22 -18
- package/dist/{types → src/types}/hooks.d.ts +12 -12
- package/dist/{types → src/types}/paramTypes.d.ts +2 -2
- package/dist/{types → src/types}/params.d.ts +1 -1
- package/dist/{types → src/types}/props.d.ts +2 -2
- package/dist/{types → src/types}/register.d.ts +1 -1
- package/dist/{types → src/types}/rejection.d.ts +6 -10
- package/dist/{types → src/types}/resolved.d.ts +4 -4
- package/dist/{types → src/types}/route.d.ts +10 -10
- package/dist/src/types/routeTitle.d.ts +22 -0
- package/dist/{types → src/types}/routeUpdate.d.ts +2 -2
- package/dist/{types → src/types}/routeWithParams.d.ts +3 -3
- package/dist/{types → src/types}/router.d.ts +13 -13
- package/dist/{types → src/types}/routerLink.d.ts +5 -5
- package/dist/{types → src/types}/routerPlugin.d.ts +2 -2
- package/dist/{types → src/types}/routerPush.d.ts +8 -8
- package/dist/{types → src/types}/routerReject.d.ts +1 -1
- package/dist/{types → src/types}/routerReplace.d.ts +8 -8
- package/dist/{types → src/types}/routerResolve.d.ts +7 -7
- package/dist/{types → src/types}/routerRoute.d.ts +3 -3
- package/dist/{types → src/types}/routesMap.d.ts +2 -2
- package/dist/{types → src/types}/state.d.ts +6 -6
- package/dist/{types → src/types}/url.d.ts +6 -6
- package/dist/{types → src/types}/useLink.d.ts +5 -5
- package/dist/{utilities → src/utilities}/checkDuplicateNames.d.ts +1 -1
- package/dist/{utilities → src/utilities}/isNamedRoute.d.ts +1 -1
- package/dist/{utilities → src/utilities}/prefetch.d.ts +1 -1
- package/dist/src/utilities/setDocumentTitle.d.ts +2 -0
- package/dist/{utilities → src/utilities}/testHelpers.d.ts +100 -100
- package/dist/{utilities → src/utilities}/urlSearchParams.d.ts +1 -1
- package/package.json +12 -12
- package/dist/services/createRejection.d.ts +0 -7
- package/dist/services/createResolvedRoute.d.ts +0 -4
- package/dist/services/getGlobalHooksForRouter.d.ts +0 -3
- package/dist/services/getRejectionHooks.d.ts +0 -3
- package/dist/services/unionOf.d.ts +0 -3
- package/dist/types/titles.d.ts +0 -22
- package/dist/utilities/setDocumentTitle.d.ts +0 -2
- /package/dist/{components → src/components}/echo.d.ts +0 -0
- /package/dist/{components → src/components}/helloWorld.d.ts +0 -0
- /package/dist/{components → src/components}/rejection.d.ts +0 -0
- /package/dist/{components → src/components}/routerLink.browser.spec.d.ts +0 -0
- /package/dist/{components → src/components}/routerView.browser.spec.d.ts +0 -0
- /package/dist/{components → src/components}/routerView.spec.d.ts +0 -0
- /package/dist/{compositions → src/compositions}/useEventListener.d.ts +0 -0
- /package/dist/{compositions → src/compositions}/useQueryValue.browser.spec.d.ts +0 -0
- /package/dist/{compositions → src/compositions}/useQueryValue.spec-d.d.ts +0 -0
- /package/dist/{compositions → src/compositions}/useRoute.browser.spec.d.ts +0 -0
- /package/dist/{compositions → src/compositions}/useRoute.spec-d.d.ts +0 -0
- /package/dist/{devtools → src/devtools}/getDevtoolsLabel.d.ts +0 -0
- /package/dist/{devtools → src/devtools}/types.d.ts +0 -0
- /package/dist/{errors → src/errors}/contextError.d.ts +0 -0
- /package/dist/{errors → src/errors}/duplicateNamesError.d.ts +0 -0
- /package/dist/{errors → src/errors}/duplicateParamsError.d.ts +0 -0
- /package/dist/{errors → src/errors}/initialRouteMissingError.d.ts +0 -0
- /package/dist/{errors → src/errors}/invalidRouteRedirectError.d.ts +0 -0
- /package/dist/{errors → src/errors}/metaPropertyConflict.d.ts +0 -0
- /package/dist/{errors → src/errors}/multipleRouteRedirectsError.d.ts +0 -0
- /package/dist/{errors → src/errors}/routeNotFoundError.d.ts +0 -0
- /package/dist/{errors → src/errors}/routerNotInstalledError.d.ts +0 -0
- /package/dist/{errors → src/errors}/useRouteInvalidError.d.ts +0 -0
- /package/dist/{guards → src/guards}/routes.spec-d.d.ts +0 -0
- /package/dist/{keys.d.ts → src/keys.d.ts} +0 -0
- /package/dist/{services → src/services}/arrayOf.spec.d.ts +0 -0
- /package/dist/{services → src/services}/combineHash.spec.d.ts +0 -0
- /package/dist/{services → src/services}/combineMeta.d.ts +0 -0
- /package/dist/{services → src/services}/combineMeta.spec.d.ts +0 -0
- /package/dist/{services → src/services}/combinePath.spec-d.d.ts +0 -0
- /package/dist/{services → src/services}/combinePath.spec.d.ts +0 -0
- /package/dist/{services → src/services}/combineQuery.spec.d.ts +0 -0
- /package/dist/{services → src/services}/combineState.spec.d.ts +0 -0
- /package/dist/{services → src/services}/combineUrl.spec.d.ts +0 -0
- /package/dist/{services → src/services}/component.browser.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createExternalRoute.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createIsExternal.d.ts +0 -0
- /package/dist/{services → src/services}/createIsExternal.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createResolvedRoute.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createRoute.spec-d.d.ts +0 -0
- /package/dist/{services → src/services}/createRoute.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createRouteId.d.ts +0 -0
- /package/dist/{services → src/services}/createRouteRedirects.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createRouter.browser.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createRouter.spec-d.d.ts +0 -0
- /package/dist/{services → src/services}/createRouter.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createRouterHistory.browser.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createRouterPlugin.browser.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createRouterPlugin.spec-d.d.ts +0 -0
- /package/dist/{services → src/services}/createRouterRoute.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createUniqueIdSequence.d.ts +0 -0
- /package/dist/{services → src/services}/createUrl.spec.d.ts +0 -0
- /package/dist/{services → src/services}/createVisibilityObserver.d.ts +0 -0
- /package/dist/{services → src/services}/createVueAppStore.d.ts +0 -0
- /package/dist/{services → src/services}/getInitialUrl.browser.spec.d.ts +0 -0
- /package/dist/{services → src/services}/getInitialUrl.d.ts +0 -0
- /package/dist/{services → src/services}/getInitialUrl.spec.d.ts +0 -0
- /package/dist/{services → src/services}/getMatchesForUrl.spec.d.ts +0 -0
- /package/dist/{services → src/services}/getRouteHooks.spec.d.ts +0 -0
- /package/dist/{services → src/services}/getRoutesForRouter.spec.d.ts +0 -0
- /package/dist/{services → src/services}/history.browser.spec.d.ts +0 -0
- /package/dist/{services → src/services}/history.d.ts +0 -0
- /package/dist/{services → src/services}/hooks.browser.spec.d.ts +0 -0
- /package/dist/{services → src/services}/hooks.spec.d.ts +0 -0
- /package/dist/{services → src/services}/insertBaseRoute.spec.d.ts +0 -0
- /package/dist/{services → src/services}/params.spec.d.ts +0 -0
- /package/dist/{services → src/services}/paramsFinder.d.ts +0 -0
- /package/dist/{services → src/services}/paramsFinder.spec.d.ts +0 -0
- /package/dist/{services → src/services}/queryParamFilter.spec.d.ts +0 -0
- /package/dist/{services → src/services}/routeRegex.spec.d.ts +0 -0
- /package/dist/{services → src/services}/state.spec.d.ts +0 -0
- /package/dist/{services → src/services}/tupleOf.spec.d.ts +0 -0
- /package/dist/{services → src/services}/unionOf.spec.d.ts +0 -0
- /package/dist/{services → src/services}/urlParser.spec.d.ts +0 -0
- /package/dist/{services → src/services}/valibot.spec-d.d.ts +0 -0
- /package/dist/{services → src/services}/valibot.spec.d.ts +0 -0
- /package/dist/{services → src/services}/withParams.spec-d.d.ts +0 -0
- /package/dist/{services → src/services}/withParams.spec.d.ts +0 -0
- /package/dist/{services → src/services}/zod.spec-d.d.ts +0 -0
- /package/dist/{services → src/services}/zod.spec.d.ts +0 -0
- /package/dist/{tests → src/tests}/hooks.spec.d.ts +0 -0
- /package/dist/{tests → src/tests}/routeProps.browser.spec.d.ts +0 -0
- /package/dist/{tests → src/tests}/routeProps.spec.d.ts +0 -0
- /package/dist/{types → src/types}/callbackContext.d.ts +0 -0
- /package/dist/{types → src/types}/meta.d.ts +0 -0
- /package/dist/{types → src/types}/name.d.ts +0 -0
- /package/dist/{types → src/types}/prefetch.d.ts +0 -0
- /package/dist/{types → src/types}/querySource.d.ts +0 -0
- /package/dist/{types → src/types}/redirects.d.ts +0 -0
- /package/dist/{types → src/types}/redirects.spec-d.d.ts +0 -0
- /package/dist/{types → src/types}/register.spec.d.ts +0 -0
- /package/dist/{types → src/types}/resolved.spec-d.d.ts +0 -0
- /package/dist/{types → src/types}/route.spec-d.d.ts +0 -0
- /package/dist/{types → src/types}/routeContext.d.ts +0 -0
- /package/dist/{types/routeWithParams.spec-d.d.ts → src/types/routeTitle.browser.spec.d.ts} +0 -0
- /package/dist/{types/routesMap.spec-ts.d.ts → src/types/routeWithParams.spec-d.d.ts} +0 -0
- /package/dist/{types → src/types}/routerAbort.d.ts +0 -0
- /package/dist/{types/titles.browser.spec.d.ts → src/types/routesMap.spec-ts.d.ts} +0 -0
- /package/dist/{types → src/types}/urlString.d.ts +0 -0
- /package/dist/{types → src/types}/utilities.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/array.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/checkDuplicateNames.spec.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/checkDuplicateParams.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/checkDuplicateParams.spec.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/components.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/components.spec.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/guards.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/guards.spec.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/index.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/isBrowser.browser.spec.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/isBrowser.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/isBrowser.spec.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/makeOptional.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/prefetch.spec.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/promises.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/props.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/trailingSlashes.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/trailingSlashes.spec.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/urlSearchParams.spec.d.ts +0 -0
|
@@ -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 '../../services/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 '../../services/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,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 '../../types/paramTypes';
|
|
5
|
+
import { PrefetchConfig } from '../../types/prefetch';
|
|
6
|
+
import { RouteMeta } from '../../types/register';
|
|
7
|
+
import { Route } from '../../types/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 '../../types/props';
|
|
11
|
+
import { Identity, MaybePromise } from '../../types/utilities';
|
|
12
|
+
import { ToMeta } from '../../types/meta';
|
|
13
|
+
import { ToState } from '../../types/state';
|
|
14
|
+
import { ToName } from '../../types/name';
|
|
15
|
+
import { UrlPart, UrlQueryPart } from '../../services/withParams';
|
|
16
|
+
import { RouteContext, ToRouteContext } from '../../types/routeContext';
|
|
17
|
+
import { RouterViewProps } from '../../components/routerView';
|
|
18
|
+
import { ToUrl } from '../../types/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.
|
|
@@ -100,6 +100,10 @@ export type CreateRouteOptions<TName extends string | undefined = string | undef
|
|
|
100
100
|
* Related routes and rejections for the route. The context is exposed to the hooks and props callback functions for this route.
|
|
101
101
|
*/
|
|
102
102
|
context?: RouteContext[];
|
|
103
|
+
/**
|
|
104
|
+
* When true, the route will be hoisted to the top of the route tree. The route will continue to inherit meta, state, hooks, matches, and context from it's parent, but not the "url" properties.
|
|
105
|
+
*/
|
|
106
|
+
hoist?: boolean;
|
|
103
107
|
};
|
|
104
108
|
export type PropsGetter<TOptions extends CreateRouteOptions = CreateRouteOptions, TComponent extends Component = Component> = (route: ResolvedRoute<ToRoute<TOptions>>, context: PropsCallbackContext<ToRoute<TOptions>, TOptions>) => MaybePromise<ComponentProps<TComponent>>;
|
|
105
109
|
export type RouterViewPropsGetter<TOptions extends CreateRouteOptions = CreateRouteOptions> = (route: ResolvedRoute<ToRoute<TOptions>>, context: PropsCallbackContext<ToRoute<TOptions>, TOptions>) => MaybePromise<RouterViewProps & Record<string, unknown>>;
|
|
@@ -124,7 +128,7 @@ type ToMatches<TOptions extends CreateRouteOptions, TProps extends CreateRoutePr
|
|
|
124
128
|
} ? [...TParent['matches'], ToMatch<TOptions, TProps>] : [ToMatch<Identity<TOptions & WithoutComponents>, TProps>];
|
|
125
129
|
export type ToRoute<TOptions extends CreateRouteOptions, TProps extends CreateRouteProps<TOptions> | undefined = undefined> = CreateRouteOptions extends TOptions ? Route : TOptions extends {
|
|
126
130
|
parent: infer TParent extends Route;
|
|
127
|
-
} ? Route<ToName<TOptions['name']>, CombineUrl<TParent, ToUrl<TOptions & WithoutComponents>>, CombineMeta<ToMeta<TParent['meta']>, ToMeta<TOptions['meta']>>, CombineState<ToState<TParent['state']>, ToState<TOptions['state']>>, ToMatches<TOptions, CreateRouteProps<TOptions> extends TProps ? undefined : TProps>, [
|
|
131
|
+
} ? Route<ToName<TOptions['name']>, TOptions['hoist'] extends true ? ToUrl<TOptions & WithoutComponents> : CombineUrl<TParent, ToUrl<TOptions & WithoutComponents>>, CombineMeta<ToMeta<TParent['meta']>, ToMeta<TOptions['meta']>>, CombineState<ToState<TParent['state']>, ToState<TOptions['state']>>, ToMatches<TOptions, CreateRouteProps<TOptions> extends TProps ? undefined : TProps>, [
|
|
128
132
|
...ToRouteContext<TParent['context']>,
|
|
129
133
|
...ToRouteContext<TOptions['context']>
|
|
130
134
|
]> : Route<ToName<TOptions['name']>, ToUrl<Identity<TOptions & WithoutComponents>>, ToMeta<TOptions['meta']>, ToState<TOptions['state']>, ToMatches<TOptions, CreateRouteProps<TOptions> extends TProps ? undefined : TProps>, ToRouteContext<TOptions['context']>>;
|
|
@@ -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 '../../types/resolved';
|
|
3
|
+
import { MaybePromise } from '../../types/utilities';
|
|
4
|
+
import { Route, Routes } from '../../types/route';
|
|
5
|
+
import { RouterReject } from '../../types/routerReject';
|
|
6
|
+
import { RouterPush } from '../../types/routerPush';
|
|
7
|
+
import { RouterReplace } from '../../types/routerReplace';
|
|
8
|
+
import { Rejection, Rejections } from '../../types/rejection';
|
|
9
|
+
import { RouteContext, RouteContextToRejection, RouteContextToRoute } from '../../types/routeContext';
|
|
10
|
+
import { RouterAbort } from '../../types/routerAbort';
|
|
11
|
+
import { CallbackContextAbort, CallbackContextPush, CallbackContextReject, CallbackContextSuccess } from '../../types/callbackContext';
|
|
12
|
+
import { RouteUpdate } from '../../types/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 '../../types/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 '../../types/createRouteOptions';
|
|
2
|
+
import { Route } from '../../types/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 '../../types/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
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Router } from '
|
|
4
|
-
import { RouterReject } from '
|
|
5
|
-
import { Hooks } from '
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Route } from '../../types/route';
|
|
3
|
+
import { Router } from '../../types/router';
|
|
4
|
+
import { RouterReject } from '../../types/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>;
|
|
@@ -11,7 +11,7 @@ export declare const IS_REJECTION_SYMBOL: unique symbol;
|
|
|
11
11
|
export declare function isRejection(value: unknown): value is Rejection & RejectionInternal;
|
|
12
12
|
export type RejectionInternal = {
|
|
13
13
|
[IS_REJECTION_SYMBOL]: true;
|
|
14
|
-
route:
|
|
14
|
+
route: Route;
|
|
15
15
|
hooks: Hooks[];
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
@@ -23,10 +23,6 @@ export type Rejection<TType extends string = string> = {
|
|
|
23
23
|
* The type of rejection.
|
|
24
24
|
*/
|
|
25
25
|
type: TType;
|
|
26
|
-
/**
|
|
27
|
-
* The component to render when the rejection occurs.
|
|
28
|
-
*/
|
|
29
|
-
component: Component;
|
|
30
26
|
};
|
|
31
27
|
export type RejectionType<TRejections extends Rejections | undefined> = unknown extends TRejections ? never : Rejections extends TRejections ? string : undefined extends TRejections ? string : TRejections extends Rejections ? TRejections[number]['type'] : never;
|
|
32
28
|
export type ExtractRejections<T> = T extends {
|
|
@@ -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 '../../types/route';
|
|
2
|
+
import { ExtractRouteStateParamsAsOptional } from '../../types/state';
|
|
3
|
+
import { UrlString } from '../../types/urlString';
|
|
4
|
+
import { UrlParamsReading } from '../../types/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 {
|
|
9
|
-
import { Hooks } from '
|
|
1
|
+
import { Param } from '../../types/paramTypes';
|
|
2
|
+
import { PrefetchConfig } from '../../types/prefetch';
|
|
3
|
+
import { RouteMeta } from '../../types/register';
|
|
4
|
+
import { LastInArray } from '../../types/utilities';
|
|
5
|
+
import { CreateRouteOptions } from '../../types/createRouteOptions';
|
|
6
|
+
import { RouteContext } from '../../types/routeContext';
|
|
7
|
+
import { Url } from '../../types/url';
|
|
8
|
+
import { GetRouteTitle } from '../../types/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;
|
|
@@ -15,7 +15,7 @@ export type RouteInternal = {
|
|
|
15
15
|
depth: number;
|
|
16
16
|
hooks: Hooks[];
|
|
17
17
|
redirect: RouteRedirect;
|
|
18
|
-
getTitle:
|
|
18
|
+
getTitle: GetRouteTitle;
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Represents an immutable array of Route instances. Return value of `createRoute`, expected param for `createRouter`.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ResolvedRoute, ResolvedRouteUnion } from '../../types/resolved';
|
|
2
|
+
import { Route } from './route';
|
|
3
|
+
import { MaybePromise } from './utilities';
|
|
4
|
+
export type SetRouteTitleContext = {
|
|
5
|
+
from: ResolvedRoute;
|
|
6
|
+
getParentTitle: () => Promise<string | undefined>;
|
|
7
|
+
};
|
|
8
|
+
export type SetRouteTitleCallback<TRoute extends Route = Route> = (to: ResolvedRouteUnion<TRoute>, context: SetRouteTitleContext) => MaybePromise<string>;
|
|
9
|
+
export type GetRouteTitle<TRoute extends Route = Route> = (to: ResolvedRouteUnion<TRoute>) => Promise<string | undefined>;
|
|
10
|
+
export type SetRouteTitle<TRoute extends Route = Route> = (callback: SetRouteTitleCallback<TRoute>) => void;
|
|
11
|
+
export type RouteSetTitle<TRoute extends Route = Route> = {
|
|
12
|
+
/**
|
|
13
|
+
* Adds a callback to set the document title for the route.
|
|
14
|
+
*/
|
|
15
|
+
setTitle: SetRouteTitle<TRoute>;
|
|
16
|
+
};
|
|
17
|
+
type CreateRouteTitle = {
|
|
18
|
+
setTitle: SetRouteTitle;
|
|
19
|
+
getTitle: GetRouteTitle;
|
|
20
|
+
};
|
|
21
|
+
export declare function createRouteTitle(parent?: Route): CreateRouteTitle;
|
|
22
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ResolvedRoute } from '
|
|
2
|
-
import { RouterPushOptions } from '
|
|
1
|
+
import { ResolvedRoute } from '../../types/resolved';
|
|
2
|
+
import { RouterPushOptions } from '../../types/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 '../../types/route';
|
|
2
|
+
import { RoutesName, RoutesMap } from '../../types/routesMap';
|
|
3
|
+
import { UrlParamsWriting } from '../../types/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 '../../types/routerRoute';
|
|
4
|
+
import { AddBeforeEnterHook, AddBeforeUpdateHook, AddBeforeLeaveHook, AddAfterEnterHook, AddAfterUpdateHook, AddAfterLeaveHook, AddErrorHook, AddRejectionHook } from '../../types/hooks';
|
|
5
|
+
import { PrefetchConfig } from '../../types/prefetch';
|
|
6
|
+
import { ResolvedRoute } from '../../types/resolved';
|
|
7
|
+
import { Route, Routes } from '../../types/route';
|
|
8
|
+
import { RouterPush } from '../../types/routerPush';
|
|
9
|
+
import { RouterReplace } from '../../types/routerReplace';
|
|
10
|
+
import { RouterResolve, RouterResolveOptions } from '../../types/routerResolve';
|
|
11
|
+
import { RouterReject } from '../../types/routerReject';
|
|
12
|
+
import { RouterPlugin } from '../../types/routerPlugin';
|
|
13
|
+
import { RoutesName } from '../../types/routesMap';
|
|
14
|
+
import { ExtractRejections, ExtractRejectionTypes, Rejections, BuiltInRejectionType } from '../../types/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 '../../types/prefetch';
|
|
2
|
+
import { UrlString } from '../../types/urlString';
|
|
3
|
+
import { ResolvedRoute } from '../../types/resolved';
|
|
4
|
+
import { Router } from '../../types/router';
|
|
5
|
+
import { RouterPushOptions } from '../../types/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 '../../types/route';
|
|
2
|
+
import { RoutesName } from '../../types/routesMap';
|
|
3
|
+
import { RouteParamsByKey } from '../../types/routeWithParams';
|
|
4
|
+
import { RouteStateByName } from '../../types/state';
|
|
5
|
+
import { UrlString } from '../../types/urlString';
|
|
6
|
+
import { AllPropertiesAreOptional } from '../../types/utilities';
|
|
7
|
+
import { QuerySource } from '../../types/querySource';
|
|
8
|
+
import { ResolvedRoute } from '../../types/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 '../../types/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 '../../types/route';
|
|
2
|
+
import { RoutesName } from '../../types/routesMap';
|
|
3
|
+
import { RouteParamsByKey } from '../../types/routeWithParams';
|
|
4
|
+
import { RouteStateByName } from '../../types/state';
|
|
5
|
+
import { UrlString } from '../../types/urlString';
|
|
6
|
+
import { AllPropertiesAreOptional } from '../../types/utilities';
|
|
7
|
+
import { QuerySource } from '../../types/querySource';
|
|
8
|
+
import { ResolvedRoute } from '../../types/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 '../../types/route';
|
|
2
|
+
import { RoutesName } from '../../types/routesMap';
|
|
3
|
+
import { RouteParamsByKey } from '../../types/routeWithParams';
|
|
4
|
+
import { AllPropertiesAreOptional } from '../../types/utilities';
|
|
5
|
+
import { QuerySource } from '../../types/querySource';
|
|
6
|
+
import { ResolvedRoute } from '../../types/resolved';
|
|
7
|
+
import { RouteStateByName } from '../../types/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 '../../types/routeUpdate';
|
|
2
|
+
import { ResolvedRoute } from '../../types/resolved';
|
|
3
|
+
import { QuerySource } from '../../types/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 '../../types/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 '../../types/params';
|
|
2
|
+
import { Param } from '../../types/paramTypes';
|
|
3
|
+
import { Routes } from '../../types/route';
|
|
4
|
+
import { RouteGetByKey } from '../../types/routeWithParams';
|
|
5
|
+
import { MakeOptional } from '../../utilities/makeOptional';
|
|
6
|
+
import { Identity } from '../../types/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;
|
|
@@ -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 '../../types/params';
|
|
3
|
+
import { AllPropertiesAreOptional, Identity } from '../../types/utilities';
|
|
4
|
+
import { UrlString } from '../../types/urlString';
|
|
5
|
+
import { ParamGetSet } from '../../types/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 '../../types/prefetch';
|
|
3
|
+
import { ResolvedRoute } from '../../types/resolved';
|
|
4
|
+
import { RouterPushOptions } from '../../types/routerPush';
|
|
5
|
+
import { RouterReplaceOptions } from '../../types/routerReplace';
|
|
6
|
+
import { UrlString } from '../../types/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;
|