camox 0.33.0 → 0.34.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/components/AuthGate.js +5 -4
- package/dist/core/createBlock.js +19 -19
- package/dist/core/defineDocument.d.ts +7 -0
- package/dist/core/defineDocument.js +7 -0
- package/dist/features/agent-chat/components/AgentChatSidebar.js +3 -3
- package/dist/features/agent-chat/components/AgentChatThread.js +10 -11
- package/dist/features/navigation/navigation.d.ts +39 -0
- package/dist/features/navigation/navigation.js +231 -0
- package/dist/features/preview/CamoxPreview.d.ts +3 -0
- package/dist/features/preview/CamoxPreview.js +12 -12
- package/dist/features/preview/components/AddBlockSidebar.js +4 -4
- package/dist/features/preview/components/AssetLightbox.js +10 -9
- package/dist/features/preview/components/CreatePageModal.js +3 -3
- package/dist/features/preview/components/FieldToolbar.js +1 -1
- package/dist/features/preview/components/PageInfoSidebar.js +23 -23
- package/dist/features/preview/components/PageNavigatorSidebar.js +6 -6
- package/dist/features/preview/components/PagePicker.js +1 -1
- package/dist/features/preview/components/PreviewToolbar.js +3 -3
- package/dist/features/preview/components/useUpdateBlockPosition.js +3 -3
- package/dist/features/provider/CamoxProvider.js +10 -8
- package/dist/features/routes/pageRuntime.js +6 -0
- package/dist/features/runtime/pageApp.js +75 -0
- package/dist/features/runtime/pageClient.d.ts +7 -0
- package/dist/features/runtime/pageClient.js +37 -0
- package/dist/features/runtime/pageNavigation.js +170 -0
- package/dist/features/runtime/pageServer.d.ts +9 -0
- package/dist/features/runtime/pageServer.js +18 -0
- package/dist/features/runtime/runtime.d.ts +24 -0
- package/dist/features/runtime/runtime.js +44 -0
- package/dist/features/runtime/studioApp.d.ts +15 -0
- package/dist/features/runtime/studioApp.js +117 -0
- package/dist/features/runtime/studioNavigation.js +115 -0
- package/dist/features/runtime/studioServer.d.ts +9 -0
- package/dist/features/runtime/studioServer.js +18 -0
- package/dist/features/studio/CamoxStudio.js +3 -3
- package/dist/features/studio/components/Navbar.js +7 -7
- package/dist/features/studio/components/ProjectMenu.js +9 -9
- package/dist/features/studio/components/UserButton.js +3 -3
- package/dist/features/vite/appGeneration.js +16 -5
- package/dist/features/vite/blockBoilerplate.js +1 -1
- package/dist/features/vite/definitionsSync.js +4 -4
- package/dist/features/vite/routeGeneration.js +9 -156
- package/dist/features/vite/runtimeDev.js +270 -0
- package/dist/features/vite/utils.js +3 -1
- package/dist/features/vite/vite.d.ts +22 -3
- package/dist/features/vite/vite.js +36 -19
- package/dist/hooks/use-file-upload.js +3 -1
- package/dist/lib/api-client.js +6 -3
- package/dist/lib/auth.js +45 -68
- package/dist/lib/queries.js +6 -4
- package/dist/lib/telemetry.js +1 -24
- package/dist/lib/utils.js +1 -1
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/Matches.d.ts +114 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/RouterProvider.d.ts +25 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/config.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/defer.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/fileRoute.d.ts +20 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/global.d.ts +8 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/hash-scroll.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/index.d.ts +18 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/link.d.ts +161 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/load-matches.d.ts +6 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/location.d.ts +54 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/lru-cache.d.ts +8 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts +32 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.d.ts +115 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/not-found.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts +49 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/rewrite.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/root.d.ts +6 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/route.d.ts +343 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/routeInfo.d.ts +48 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/router.d.ts +695 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/scroll-restoration.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchMiddleware.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/searchParams.d.ts +5 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/RawStream.d.ts +38 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/seroval-plugins.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/ssr/serializer/transformer.d.ts +65 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/stores.d.ts +69 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/structuralSharing.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/typePrimitives.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderData.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useLoaderDeps.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useNavigate.d.ts +10 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useParams.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useRouteContext.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/useSearch.d.ts +1 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/utils.d.ts +28 -0
- package/dist/node_modules/.pnpm/@tanstack_router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/validators.d.ts +49 -0
- package/package.json +34 -12
- package/skills/camox-block/SKILL.md +4 -4
- package/skills/camox-cli/SKILL.md +3 -3
- package/skills/camox-layout/SKILL.md +2 -2
- package/dist/features/routes/ogRoute.d.ts +0 -12
- package/dist/features/routes/ogRoute.js +0 -20
- package/dist/features/routes/pageRoute.d.ts +0 -48
- package/dist/features/routes/pageRoute.js +0 -254
- package/dist/lib/api-client.d.ts +0 -7
- package/dist/lib/queries.d.ts +0 -12
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FileRouteTypes, InferFileRouteTypes, LazyRoute, LazyRouteOptions } from "./fileRoute.js";
|
|
2
|
+
import { Assign, Awaitable, Constrain, ConstrainLiteral, ControlledPromise, Expand, ExtractObjects, ExtractPrimitives, IntersectAssign, IsNonEmptyObject, LooseAsyncReturnType, LooseReturnType, MakeDifferenceOptional, MergeAllPrimitive, NoInfer, NonNullableUpdater, PartialMergeAll, PartialMergeAllObject, PickAsRequired, Updater } from "./utils.js";
|
|
3
|
+
import { AbsoluteToPath, AddLeadingSlash, AddTrailingSlash, FindDescendantToPaths, FromPathOption, InferDescendantToPaths, IsRequiredParams, MakeOptionalPathParams, MakeOptionalSearchParams, MaskOptions, NavigateOptions, PathParamOptions, RelativeToCurrentPath, RelativeToParentPath, RelativeToPath, RelativeToPathAutoComplete, RemoveLeadingSlashes, RemoveTrailingSlashes, RequiredToOptions, ResolveCurrentPath, ResolveParentPath, ResolveRelativePath, ResolveRoute, SearchParamOptions, ToMaskOptions, ToOptions, ToPathOption, ToSubOptions, ToSubOptionsProps } from "./link.js";
|
|
4
|
+
import { AllParams, CodeRouteToPath, FullSearchSchema, FullSearchSchemaInput, ParseRoute, RouteById, RouteByPath, RoutePaths, RouteToPath, RoutesById, RoutesByPath, TrailingSlashOptionByRouter } from "./routeInfo.js";
|
|
5
|
+
import { AnyRedirect, Redirect, RedirectFnRoute, RedirectOptions, RedirectOptionsRoute } from "./redirect.js";
|
|
6
|
+
import { AnyRouteMatch, MakeRouteMatchFromRoute, MakeRouteMatchUnion, MatchRouteOptions, RouteMatch, RouteMatchExtensions } from "./Matches.js";
|
|
7
|
+
import { RootRouteId, rootRouteId } from "./root.js";
|
|
8
|
+
import { BuildLocationFn, CommitLocationOptions, NavigateFn } from "./RouterProvider.js";
|
|
9
|
+
import { RawStream, RawStreamHint, RawStreamOptions } from "./ssr/serializer/RawStream.js";
|
|
10
|
+
import { AnySerializationAdapter, DefaultSerializable, RegisteredSerializableInput, Serializable, SerializableExtensions, SerializationAdapter, SerializationError, SerializerExtensions, TSR_SERIALIZABLE, TsrSerializable, ValidateSerializable, ValidateSerializableInput } from "./ssr/serializer/transformer.js";
|
|
11
|
+
import { AnyContext, AnyPathParams, AnyRoute, BaseRouteOptions, BeforeLoadContextOptions, BeforeLoadContextParameter, ContextAsyncReturnType, ContextOptions, ContextReturnType, FileBaseRouteOptions, FilebaseRouteOptionsInterface, FullSearchSchemaOption, InferAllContext, InferAllParams, InferFullSearchSchema, InferFullSearchSchemaInput, LoaderFnContext, LoaderStaleReloadMode, MakeRemountDepsOptionsUnion, ParamsOptions, ParseParamsFn, RemountDepsOptions, ResolveAllContext, ResolveAllParamsFromParent, ResolveFullSearchSchema, ResolveFullSearchSchemaInput, ResolveLoaderData, ResolveOptionalParams, ResolveParams, ResolveRequiredParams, ResolveRouteContext, Route, RouteAddChildrenFn, RouteAddFileChildrenFn, RouteAddFileTypesFn, RouteContextOptions, RouteContextParameter, RouteExtensions, RouteLazyFn, RouteLoaderFn, RouteMask, RouteOptions, RoutePathOptions, RouteTypes, SearchFilter, SearchMiddleware, SearchMiddlewareContext, SearchSchemaInput, StaticDataRouteOption, StringifyParamsFn, TrimPathRight, UpdatableRouteOptions, UpdatableRouteOptionsExtensions, UpdatableStaticRouteOption } from "./route.js";
|
|
12
|
+
import { AnySchema, AnyStandardSchemaValidate, AnyStandardSchemaValidateFailure, AnyStandardSchemaValidateIssue, AnyStandardSchemaValidateSuccess, AnyStandardSchemaValidator, AnyValidator, AnyValidatorAdapter, AnyValidatorObj, DefaultValidator, ResolveSearchValidatorInput, ResolveSearchValidatorInputFn, ResolveValidatorOutput, ResolveValidatorOutputFn, StandardSchemaValidator, StandardSchemaValidatorProps, StandardSchemaValidatorTypes, Validator, ValidatorAdapter, ValidatorFn, ValidatorObj } from "./validators.js";
|
|
13
|
+
import { ParsedLocation } from "./location.js";
|
|
14
|
+
import { SearchParser, SearchSerializer } from "./searchParams.js";
|
|
15
|
+
import { AssetCrossOrigin, Manifest, ManifestAssetLink, RouterManagedTag } from "./manifest.js";
|
|
16
|
+
import { GetStoreConfig, RouterBatchFn, RouterReadableStore, RouterStores, RouterWritableStore } from "./stores.js";
|
|
17
|
+
import { AnyRouter, BuildNextOptions, ClearCacheFn, CommitLocationFn, DefaultRemountDepsFn, EmitFn, GetMatchFn, GetMatchRoutesFn, InvalidateFn, ListenerFn, LoadFn, LocationRewrite, LocationRewriteFunction, MatchRouteFn, MatchRoutesFn, MatchRoutesOpts, ParseLocationFn, PreloadRouteFn, Register, RegisteredRouter, RouterConstructorOptions, RouterContextOptions, RouterCore, RouterEvent, RouterEvents, RouterListener, RouterOptions, RouterOptionsExtensions, RouterState, SSROption, StartTransitionFn, SubscribeFn, TrailingSlashOption, UpdateFn, UpdateMatchFn, ViewTransitionOptions, trailingSlashOptions } from "./router.js";
|
|
18
|
+
import { UseNavigateResult } from "./useNavigate.js";
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { ConstrainLiteral, Expand, MakeDifferenceOptional, NoInfer, NonNullableUpdater, Updater } from "./utils.js";
|
|
2
|
+
import { AllParams, CatchAllPaths, CurrentPath, FullSearchSchema, FullSearchSchemaInput, ParentPath, RouteByPath, RouteByToPath, RoutePaths, RouteToPath, ToPath } from "./routeInfo.js";
|
|
3
|
+
import { ParsedLocation } from "./location.js";
|
|
4
|
+
import { AnyRouter, RegisteredRouter, ViewTransitionOptions } from "./router.js";
|
|
5
|
+
import { HistoryState, ParsedHistoryState } from "@tanstack/history";
|
|
6
|
+
|
|
7
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/link.d.ts
|
|
8
|
+
type IsRequiredParams<TParams> = Record<never, never> extends TParams ? never : true;
|
|
9
|
+
interface ParsePathParamsResult<in out TRequired, in out TOptional, in out TRest> {
|
|
10
|
+
required: TRequired;
|
|
11
|
+
optional: TOptional;
|
|
12
|
+
rest: TRest;
|
|
13
|
+
}
|
|
14
|
+
type ParsePathParamsBoundaryStart<T extends string> = T extends `${infer TLeft}{-${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['required'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : T extends `${infer TLeft}{${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'] | ParsePathParams<TRight>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : never;
|
|
15
|
+
type ParsePathParamsSymbol<T extends string> = T extends `${string}$${infer TRight}` ? TRight extends `${string}/${string}` ? TRight extends `${infer TParam}/${infer TRest}` ? TParam extends '' ? ParsePathParamsResult<ParsePathParams<TRest>['required'], '_splat' | ParsePathParams<TRest>['optional'], ParsePathParams<TRest>['rest']> : ParsePathParamsResult<TParam | ParsePathParams<TRest>['required'], ParsePathParams<TRest>['optional'], ParsePathParams<TRest>['rest']> : never : TRight extends '' ? ParsePathParamsResult<never, '_splat', never> : ParsePathParamsResult<TRight, never, never> : never;
|
|
16
|
+
type ParsePathParamsBoundaryEnd<T extends string> = T extends `${infer TLeft}}${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'] | ParsePathParams<TRight>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : never;
|
|
17
|
+
type ParsePathParamsEscapeStart<T extends string> = T extends `${infer TLeft}[${infer TRight}` ? ParsePathParamsResult<ParsePathParams<TLeft>['required'] | ParsePathParams<TRight>['required'], ParsePathParams<TLeft>['optional'] | ParsePathParams<TRight>['optional'], ParsePathParams<TRight>['rest']> : never;
|
|
18
|
+
type ParsePathParamsEscapeEnd<T extends string> = T extends `${string}]${infer TRight}` ? ParsePathParams<TRight> : never;
|
|
19
|
+
type ParsePathParams<T extends string> = T extends `${string}[${string}` ? ParsePathParamsEscapeStart<T> : T extends `${string}]${string}` ? ParsePathParamsEscapeEnd<T> : T extends `${string}}${string}` ? ParsePathParamsBoundaryEnd<T> : T extends `${string}{${string}` ? ParsePathParamsBoundaryStart<T> : T extends `${string}$${string}` ? ParsePathParamsSymbol<T> : never;
|
|
20
|
+
type AddTrailingSlash<T> = T extends `${string}/` ? T : `${T & string}/`;
|
|
21
|
+
type RemoveTrailingSlashes<T> = T & `${string}/` extends never ? T : T extends `${infer R}/` ? R : T;
|
|
22
|
+
type AddLeadingSlash<T> = T & `/${string}` extends never ? `/${T & string}` : T;
|
|
23
|
+
type RemoveLeadingSlashes<T> = T & `/${string}` extends never ? T : T extends `/${infer R}` ? R : T;
|
|
24
|
+
type JoinPath<TLeft extends string, TRight extends string> = TRight extends '' ? TLeft : TLeft extends '' ? TRight : `${RemoveTrailingSlashes<TLeft>}/${RemoveLeadingSlashes<TRight>}`;
|
|
25
|
+
type RemoveLastSegment<T extends string, TAcc extends string = ''> = T extends `${infer TSegment}/${infer TRest}` ? TRest & `${string}/${string}` extends never ? TRest extends '' ? TAcc : `${TAcc}${TSegment}` : RemoveLastSegment<TRest, `${TAcc}${TSegment}/`> : TAcc;
|
|
26
|
+
type ResolveCurrentPath<TFrom extends string, TTo extends string> = TTo extends '.' ? TFrom : TTo extends './' ? AddTrailingSlash<TFrom> : TTo & `./${string}` extends never ? never : TTo extends `./${infer TRest}` ? AddLeadingSlash<JoinPath<TFrom, TRest>> : never;
|
|
27
|
+
type ResolveParentPath<TFrom extends string, TTo extends string> = TTo extends '../' | '..' ? TFrom extends '' | '/' ? never : AddLeadingSlash<RemoveLastSegment<TFrom>> : TTo & `../${string}` extends never ? AddLeadingSlash<JoinPath<TFrom, TTo>> : TFrom extends '' | '/' ? never : TTo extends `../${infer ToRest}` ? ResolveParentPath<RemoveLastSegment<TFrom>, ToRest> : AddLeadingSlash<JoinPath<TFrom, TTo>>;
|
|
28
|
+
type ResolveRelativePath<TFrom, TTo = '.'> = string extends TFrom ? TTo : string extends TTo ? TFrom : undefined extends TTo ? TFrom : TTo extends string ? TFrom extends string ? TTo extends `/${string}` ? TTo : TTo extends `..${string}` ? ResolveParentPath<TFrom, TTo> : TTo extends `.${string}` ? ResolveCurrentPath<TFrom, TTo> : AddLeadingSlash<JoinPath<TFrom, TTo>> : never : never;
|
|
29
|
+
type FindDescendantToPaths<TRouter extends AnyRouter, TPrefix extends string> = `${TPrefix}/${string}` & RouteToPath<TRouter>;
|
|
30
|
+
type InferDescendantToPaths<TRouter extends AnyRouter, TPrefix extends string, TPaths = FindDescendantToPaths<TRouter, TPrefix>> = TPaths extends `${TPrefix}/` ? never : TPaths extends `${TPrefix}/${infer TRest}` ? TRest : never;
|
|
31
|
+
type RelativeToPath<TRouter extends AnyRouter, TTo extends string, TResolvedPath extends string> = (TResolvedPath & RouteToPath<TRouter> extends never ? never : ToPath<TRouter, TTo>) | `${RemoveTrailingSlashes<TTo>}/${InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TResolvedPath>>}`;
|
|
32
|
+
type RelativeToParentPath<TRouter extends AnyRouter, TFrom extends string, TTo extends string, TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>> = RelativeToPath<TRouter, TTo, TResolvedPath> | (TTo extends `${string}..` | `${string}../` ? TResolvedPath extends '/' | '' ? never : FindDescendantToPaths<TRouter, RemoveTrailingSlashes<TResolvedPath>> extends never ? never : `${RemoveTrailingSlashes<TTo>}/${ParentPath<TRouter>}` : never);
|
|
33
|
+
type RelativeToCurrentPath<TRouter extends AnyRouter, TFrom extends string, TTo extends string, TResolvedPath extends string = ResolveRelativePath<TFrom, TTo>> = RelativeToPath<TRouter, TTo, TResolvedPath> | CurrentPath<TRouter>;
|
|
34
|
+
type AbsoluteToPath<TRouter extends AnyRouter, TFrom extends string> = (string extends TFrom ? CurrentPath<TRouter> : TFrom extends `/` ? never : CurrentPath<TRouter>) | (string extends TFrom ? ParentPath<TRouter> : TFrom extends `/` ? never : ParentPath<TRouter>) | RouteToPath<TRouter> | (TFrom extends '/' ? never : string extends TFrom ? never : InferDescendantToPaths<TRouter, RemoveTrailingSlashes<TFrom>>);
|
|
35
|
+
type RelativeToPathAutoComplete<TRouter extends AnyRouter, TFrom extends string, TTo extends string> = string extends TTo ? string : string extends TFrom ? AbsoluteToPath<TRouter, TFrom> : TTo & `..${string}` extends never ? TTo & `.${string}` extends never ? AbsoluteToPath<TRouter, TFrom> : RelativeToCurrentPath<TRouter, TFrom, TTo> : RelativeToParentPath<TRouter, TFrom, TTo>;
|
|
36
|
+
type NavigateOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = ToOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & NavigateOptionProps;
|
|
37
|
+
/**
|
|
38
|
+
* The NavigateOptions type is used to describe the options that can be used when describing a navigation action in TanStack Router.
|
|
39
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType)
|
|
40
|
+
*/
|
|
41
|
+
interface NavigateOptionProps {
|
|
42
|
+
/**
|
|
43
|
+
* If set to `true`, the router will scroll the element with an id matching the hash into view with default `ScrollIntoViewOptions`.
|
|
44
|
+
* If set to `false`, the router will not scroll the element with an id matching the hash into view.
|
|
45
|
+
* If set to `ScrollIntoViewOptions`, the router will scroll the element with an id matching the hash into view with the provided options.
|
|
46
|
+
* @default true
|
|
47
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#hashscrollintoview)
|
|
48
|
+
* @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)
|
|
49
|
+
*/
|
|
50
|
+
hashScrollIntoView?: boolean | ScrollIntoViewOptions;
|
|
51
|
+
/**
|
|
52
|
+
* `replace` is a boolean that determines whether the navigation should replace the current history entry or push a new one.
|
|
53
|
+
* @default false
|
|
54
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#replace)
|
|
55
|
+
*/
|
|
56
|
+
replace?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Defaults to `true` so that the scroll position will be reset to 0,0 after the location is committed to the browser history.
|
|
59
|
+
* If `false`, the scroll position will not be reset to 0,0 after the location is committed to history.
|
|
60
|
+
* @default true
|
|
61
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#resetscroll)
|
|
62
|
+
*/
|
|
63
|
+
resetScroll?: boolean;
|
|
64
|
+
/** @deprecated All navigations now use startTransition under the hood */
|
|
65
|
+
startTransition?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* If set to `true`, the router will wrap the resulting navigation in a `document.startViewTransition()` call.
|
|
68
|
+
* If `ViewTransitionOptions`, route navigations will be called using `document.startViewTransition({update, types})`
|
|
69
|
+
* where `types` will be the strings array passed with `ViewTransitionOptions["types"]`.
|
|
70
|
+
* If the browser does not support viewTransition types, the navigation will fall back to normal `document.startTransition()`, same as if `true` was passed.
|
|
71
|
+
*
|
|
72
|
+
* If the browser does not support this api, this option will be ignored.
|
|
73
|
+
* @default false
|
|
74
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#viewtransition)
|
|
75
|
+
* @see [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition)
|
|
76
|
+
* @see [Google](https://developer.chrome.com/docs/web-platform/view-transitions/same-document#view-transition-types)
|
|
77
|
+
*/
|
|
78
|
+
viewTransition?: boolean | ViewTransitionOptions;
|
|
79
|
+
/**
|
|
80
|
+
* If `true`, navigation will ignore any blockers that might prevent it.
|
|
81
|
+
* @default false
|
|
82
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#ignoreblocker)
|
|
83
|
+
*/
|
|
84
|
+
ignoreBlocker?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* If `true`, navigation to a route inside of router will trigger a full page load instead of the traditional SPA navigation.
|
|
87
|
+
* @default false
|
|
88
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#reloaddocument)
|
|
89
|
+
*/
|
|
90
|
+
reloadDocument?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* This can be used instead of `to` to navigate to a fully built href, e.g. pointing to an external target.
|
|
93
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
|
|
94
|
+
*/
|
|
95
|
+
href?: string;
|
|
96
|
+
}
|
|
97
|
+
type ToOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.', TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = ToSubOptions<TRouter, TFrom, TTo> & MaskOptions<TRouter, TMaskFrom, TMaskTo>;
|
|
98
|
+
interface MaskOptions<in out TRouter extends AnyRouter, in out TMaskFrom extends string, in out TMaskTo extends string> {
|
|
99
|
+
_fromLocation?: ParsedLocation;
|
|
100
|
+
mask?: ToMaskOptions<TRouter, TMaskFrom, TMaskTo>;
|
|
101
|
+
}
|
|
102
|
+
type ToMaskOptions<TRouter extends AnyRouter = RegisteredRouter, TMaskFrom extends string = string, TMaskTo extends string = '.'> = ToSubOptions<TRouter, TMaskFrom, TMaskTo> & {
|
|
103
|
+
unmaskOnReload?: boolean;
|
|
104
|
+
};
|
|
105
|
+
type ToSubOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = '.'> = ToSubOptionsProps<TRouter, TFrom, TTo> & SearchParamOptions<TRouter, TFrom, TTo> & PathParamOptions<TRouter, TFrom, TTo>;
|
|
106
|
+
interface RequiredToOptions<in out TRouter extends AnyRouter, in out TFrom extends string, in out TTo extends string | undefined> {
|
|
107
|
+
/**
|
|
108
|
+
* The internal route path to navigate to. This should be a relative or absolute path within your application.
|
|
109
|
+
* For external URLs, use the `href` property instead.
|
|
110
|
+
* @example "/dashboard" or "../profile"
|
|
111
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
|
|
112
|
+
*/
|
|
113
|
+
to: ToPathOption<TRouter, TFrom, TTo> & {};
|
|
114
|
+
}
|
|
115
|
+
interface OptionalToOptions<in out TRouter extends AnyRouter, in out TFrom extends string, in out TTo extends string | undefined> {
|
|
116
|
+
/**
|
|
117
|
+
* The internal route path to navigate to. This should be a relative or absolute path within your application.
|
|
118
|
+
* For external URLs, use the `href` property instead.
|
|
119
|
+
* @example "/dashboard" or "../profile"
|
|
120
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/NavigateOptionsType#href)
|
|
121
|
+
*/
|
|
122
|
+
to?: ToPathOption<TRouter, TFrom, TTo> & {};
|
|
123
|
+
}
|
|
124
|
+
type MakeToRequired<TRouter extends AnyRouter, TFrom extends string, TTo extends string | undefined> = string extends TFrom ? string extends TTo ? OptionalToOptions<TRouter, TFrom, TTo> : TTo & CatchAllPaths<TRouter> extends never ? RequiredToOptions<TRouter, TFrom, TTo> : OptionalToOptions<TRouter, TFrom, TTo> : OptionalToOptions<TRouter, TFrom, TTo>;
|
|
125
|
+
type ToSubOptionsProps<TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths<TRouter['routeTree']> | string = string, TTo extends string | undefined = '.'> = MakeToRequired<TRouter, TFrom, TTo> & {
|
|
126
|
+
hash?: true | Updater<string>;
|
|
127
|
+
state?: true | NonNullableUpdater<ParsedHistoryState, HistoryState>;
|
|
128
|
+
from?: FromPathOption<TRouter, TFrom> & {};
|
|
129
|
+
unsafeRelative?: 'path';
|
|
130
|
+
};
|
|
131
|
+
type ParamsReducerFn<in out TRouter extends AnyRouter, in out TParamVariant extends ParamVariant, in out TFrom, in out TTo> = (current: Expand<ResolveFromParams<TRouter, TParamVariant, TFrom>>) => Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>>;
|
|
132
|
+
type ParamsReducer<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = Expand<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>> | (ParamsReducerFn<TRouter, TParamVariant, TFrom, TTo> & {});
|
|
133
|
+
type ParamVariant = 'PATH' | 'SEARCH';
|
|
134
|
+
type ResolveRoute<TRouter extends AnyRouter, TFrom, TTo, TPath = ResolveRelativePath<TFrom, TTo>> = TPath extends string ? TFrom extends TPath ? RouteByPath<TRouter['routeTree'], TPath> : RouteByToPath<TRouter, TPath> : never;
|
|
135
|
+
type ResolveFromParamType<TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchema';
|
|
136
|
+
type ResolveFromAllParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? AllParams<TRouter['routeTree']> : FullSearchSchema<TRouter['routeTree']>;
|
|
137
|
+
type ResolveFromParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom> = string extends TFrom ? ResolveFromAllParams<TRouter, TParamVariant> : RouteByPath<TRouter['routeTree'], TFrom>['types'][ResolveFromParamType<TParamVariant>];
|
|
138
|
+
type ResolveToParamType<TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? 'allParams' : 'fullSearchSchemaInput';
|
|
139
|
+
type ResolveAllToParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant> = TParamVariant extends 'PATH' ? AllParams<TRouter['routeTree']> : FullSearchSchemaInput<TRouter['routeTree']>;
|
|
140
|
+
type ResolveToParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = ResolveRelativePath<TFrom, TTo> extends infer TPath ? undefined extends TPath ? never : string extends TPath ? ResolveAllToParams<TRouter, TParamVariant> : TPath extends CatchAllPaths<TRouter> ? ResolveAllToParams<TRouter, TParamVariant> : ResolveRoute<TRouter, TFrom, TTo>['types'][ResolveToParamType<TParamVariant>] : never;
|
|
141
|
+
type ResolveRelativeToParams<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo, TToParams = ResolveToParams<TRouter, TParamVariant, TFrom, TTo>> = TParamVariant extends 'SEARCH' ? TToParams : string extends TFrom ? TToParams : MakeDifferenceOptional<ResolveFromParams<TRouter, TParamVariant, TFrom>, TToParams>;
|
|
142
|
+
interface MakeOptionalSearchParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
|
|
143
|
+
search?: true | (ParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {});
|
|
144
|
+
}
|
|
145
|
+
interface MakeOptionalPathParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
|
|
146
|
+
params?: true | (ParamsReducer<TRouter, 'PATH', TFrom, TTo> & {});
|
|
147
|
+
}
|
|
148
|
+
type MakeRequiredParamsReducer<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = (string extends TFrom ? never : ResolveFromParams<TRouter, TParamVariant, TFrom> extends ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo> ? true : never) | (ParamsReducer<TRouter, TParamVariant, TFrom, TTo> & {});
|
|
149
|
+
interface MakeRequiredPathParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
|
|
150
|
+
params: MakeRequiredParamsReducer<TRouter, 'PATH', TFrom, TTo> & {};
|
|
151
|
+
}
|
|
152
|
+
interface MakeRequiredSearchParams<in out TRouter extends AnyRouter, in out TFrom, in out TTo> {
|
|
153
|
+
search: MakeRequiredParamsReducer<TRouter, 'SEARCH', TFrom, TTo> & {};
|
|
154
|
+
}
|
|
155
|
+
type IsRequired<TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo> = ResolveRelativePath<TFrom, TTo> extends infer TPath ? undefined extends TPath ? never : TPath extends CatchAllPaths<TRouter> ? never : IsRequiredParams<ResolveRelativeToParams<TRouter, TParamVariant, TFrom, TTo>> : never;
|
|
156
|
+
type SearchParamOptions<TRouter extends AnyRouter, TFrom, TTo> = IsRequired<TRouter, 'SEARCH', TFrom, TTo> extends never ? MakeOptionalSearchParams<TRouter, TFrom, TTo> : MakeRequiredSearchParams<TRouter, TFrom, TTo>;
|
|
157
|
+
type PathParamOptions<TRouter extends AnyRouter, TFrom, TTo> = IsRequired<TRouter, 'PATH', TFrom, TTo> extends never ? MakeOptionalPathParams<TRouter, TFrom, TTo> : MakeRequiredPathParams<TRouter, TFrom, TTo>;
|
|
158
|
+
type ToPathOption<TRouter extends AnyRouter = AnyRouter, TFrom extends string = string, TTo extends string | undefined = string> = ConstrainLiteral<TTo, RelativeToPathAutoComplete<TRouter, NoInfer<TFrom> extends string ? NoInfer<TFrom> : '', NoInfer<TTo> & string>>;
|
|
159
|
+
type FromPathOption<TRouter extends AnyRouter, TFrom> = ConstrainLiteral<TFrom, RoutePaths<TRouter['routeTree']>>;
|
|
160
|
+
//#endregion
|
|
161
|
+
export { AbsoluteToPath, AddLeadingSlash, AddTrailingSlash, FindDescendantToPaths, FromPathOption, InferDescendantToPaths, IsRequiredParams, MakeOptionalPathParams, MakeOptionalSearchParams, MaskOptions, NavigateOptions, ParsePathParams, PathParamOptions, RelativeToCurrentPath, RelativeToParentPath, RelativeToPath, RelativeToPathAutoComplete, RemoveLeadingSlashes, RemoveTrailingSlashes, RequiredToOptions, ResolveCurrentPath, ResolveParentPath, ResolveRelativePath, ResolveRoute, SearchParamOptions, ToMaskOptions, ToOptions, ToPathOption, ToSubOptions, ToSubOptionsProps };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AnyRoute } from "./route.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/load-matches.d.ts
|
|
3
|
+
type RouteComponentType = 'component' | 'errorComponent' | 'pendingComponent' | 'notFoundComponent';
|
|
4
|
+
declare function loadRouteChunk(route: AnyRoute, componentTypesToLoad?: Array<RouteComponentType>): Promise<void> | undefined;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { loadRouteChunk };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { AnySchema } from "./validators.js";
|
|
2
|
+
import { ParsedHistoryState } from "@tanstack/history";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/location.d.ts
|
|
5
|
+
interface ParsedLocation<TSearchObj extends AnySchema = {}> {
|
|
6
|
+
/**
|
|
7
|
+
* The full path of the location, including pathname, search, and hash.
|
|
8
|
+
* Does not include the origin. Is the equivalent of calling
|
|
9
|
+
* `url.replace(url.origin, '')`
|
|
10
|
+
*/
|
|
11
|
+
href: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description The pathname of the location, including the leading slash.
|
|
14
|
+
*/
|
|
15
|
+
pathname: string;
|
|
16
|
+
/**
|
|
17
|
+
* The parsed search parameters of the location in object form.
|
|
18
|
+
*/
|
|
19
|
+
search: TSearchObj;
|
|
20
|
+
/**
|
|
21
|
+
* The search string of the location, including the leading question mark.
|
|
22
|
+
*/
|
|
23
|
+
searchStr: string;
|
|
24
|
+
/**
|
|
25
|
+
* The in-memory state of the location as it *may* exist in the browser's history.
|
|
26
|
+
*/
|
|
27
|
+
state: ParsedHistoryState;
|
|
28
|
+
/**
|
|
29
|
+
* The hash of the location, excluding the leading hash character.
|
|
30
|
+
* (e.g., '123' instead of '#123')
|
|
31
|
+
*/
|
|
32
|
+
hash: string;
|
|
33
|
+
/**
|
|
34
|
+
* The masked location of the location.
|
|
35
|
+
*/
|
|
36
|
+
maskedLocation?: ParsedLocation<TSearchObj>;
|
|
37
|
+
/**
|
|
38
|
+
* Whether to unmask the location on reload.
|
|
39
|
+
*/
|
|
40
|
+
unmaskOnReload?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @private
|
|
43
|
+
* @description The public href of the location.
|
|
44
|
+
* If a rewrite is applied, the `href` property will be the rewritten URL.
|
|
45
|
+
*/
|
|
46
|
+
publicHref: string;
|
|
47
|
+
/**
|
|
48
|
+
* @private
|
|
49
|
+
* @description Whether the publicHref is external (different origin from rewrite).
|
|
50
|
+
*/
|
|
51
|
+
external: boolean;
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { ParsedLocation };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/lru-cache.d.ts
|
|
2
|
+
type LRUCache<TKey, TValue> = {
|
|
3
|
+
get: (key: TKey) => TValue | undefined;
|
|
4
|
+
set: (key: TKey, value: TValue) => void;
|
|
5
|
+
clear: () => void;
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { LRUCache };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/manifest.d.ts
|
|
2
|
+
type AssetCrossOrigin = 'anonymous' | 'use-credentials';
|
|
3
|
+
type ManifestAssetLink = string | {
|
|
4
|
+
href: string;
|
|
5
|
+
crossOrigin?: AssetCrossOrigin;
|
|
6
|
+
};
|
|
7
|
+
type Manifest = {
|
|
8
|
+
routes: Record<string, {
|
|
9
|
+
filePath?: string;
|
|
10
|
+
preloads?: Array<ManifestAssetLink>;
|
|
11
|
+
assets?: Array<RouterManagedTag>;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
type RouterManagedTag = {
|
|
15
|
+
tag: 'title';
|
|
16
|
+
attrs?: Record<string, any>;
|
|
17
|
+
children: string;
|
|
18
|
+
} | {
|
|
19
|
+
tag: 'meta' | 'link';
|
|
20
|
+
attrs?: Record<string, any>;
|
|
21
|
+
children?: never;
|
|
22
|
+
} | {
|
|
23
|
+
tag: 'script';
|
|
24
|
+
attrs?: Record<string, any>;
|
|
25
|
+
children?: string;
|
|
26
|
+
} | {
|
|
27
|
+
tag: 'style';
|
|
28
|
+
attrs?: Record<string, any>;
|
|
29
|
+
children?: string;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { AssetCrossOrigin, Manifest, ManifestAssetLink, RouterManagedTag };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { LRUCache } from "./lru-cache.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/new-process-route-tree.d.ts
|
|
4
|
+
declare const SEGMENT_TYPE_PATHNAME = 0;
|
|
5
|
+
declare const SEGMENT_TYPE_PARAM = 1;
|
|
6
|
+
declare const SEGMENT_TYPE_WILDCARD = 2;
|
|
7
|
+
declare const SEGMENT_TYPE_OPTIONAL_PARAM = 3;
|
|
8
|
+
declare const SEGMENT_TYPE_INDEX = 4;
|
|
9
|
+
declare const SEGMENT_TYPE_PATHLESS = 5;
|
|
10
|
+
/**
|
|
11
|
+
* All the kinds of segments that can be present in a route path.
|
|
12
|
+
*/
|
|
13
|
+
type SegmentKind = typeof SEGMENT_TYPE_PATHNAME | typeof SEGMENT_TYPE_PARAM | typeof SEGMENT_TYPE_WILDCARD | typeof SEGMENT_TYPE_OPTIONAL_PARAM;
|
|
14
|
+
/**
|
|
15
|
+
* All the kinds of segments that can be present in the segment tree.
|
|
16
|
+
*/
|
|
17
|
+
type ExtendedSegmentKind = SegmentKind | typeof SEGMENT_TYPE_INDEX | typeof SEGMENT_TYPE_PATHLESS;
|
|
18
|
+
type StaticSegmentNode<T extends RouteLike> = SegmentNode<T> & {
|
|
19
|
+
kind: typeof SEGMENT_TYPE_PATHNAME | typeof SEGMENT_TYPE_PATHLESS | typeof SEGMENT_TYPE_INDEX;
|
|
20
|
+
};
|
|
21
|
+
type DynamicSegmentNode<T extends RouteLike> = SegmentNode<T> & {
|
|
22
|
+
kind: typeof SEGMENT_TYPE_PARAM | typeof SEGMENT_TYPE_WILDCARD | typeof SEGMENT_TYPE_OPTIONAL_PARAM;
|
|
23
|
+
prefix?: string;
|
|
24
|
+
suffix?: string;
|
|
25
|
+
caseSensitive: boolean;
|
|
26
|
+
};
|
|
27
|
+
type AnySegmentNode<T extends RouteLike> = StaticSegmentNode<T> | DynamicSegmentNode<T>;
|
|
28
|
+
type SegmentNode<T extends RouteLike> = {
|
|
29
|
+
kind: ExtendedSegmentKind;
|
|
30
|
+
pathless: Array<StaticSegmentNode<T>> | null; /** Exact index segment (highest priority) */
|
|
31
|
+
index: StaticSegmentNode<T> | null; /** Static segments (2nd priority) */
|
|
32
|
+
static: Map<string, StaticSegmentNode<T>> | null; /** Case insensitive static segments (3rd highest priority) */
|
|
33
|
+
staticInsensitive: Map<string, StaticSegmentNode<T>> | null; /** Dynamic segments ($param) */
|
|
34
|
+
dynamic: Array<DynamicSegmentNode<T>> | null; /** Optional dynamic segments ({-$param}) */
|
|
35
|
+
optional: Array<DynamicSegmentNode<T>> | null; /** Wildcard segments ($ - lowest priority) */
|
|
36
|
+
wildcard: Array<DynamicSegmentNode<T>> | null; /** Terminal route (if this path can end here) */
|
|
37
|
+
route: T | null; /** The full path for this segment node (will only be valid on leaf nodes) */
|
|
38
|
+
fullPath: string;
|
|
39
|
+
parent: AnySegmentNode<T> | null;
|
|
40
|
+
depth: number; /** route.options.params.parse function, set on the last node of the route */
|
|
41
|
+
parse: null | ((params: Record<string, string>) => any); /** options.skipRouteOnParseError.params ?? false */
|
|
42
|
+
skipOnParamError: boolean; /** options.skipRouteOnParseError.priority ?? 0 */
|
|
43
|
+
parsingPriority: number;
|
|
44
|
+
};
|
|
45
|
+
type RouteLike = {
|
|
46
|
+
id?: string;
|
|
47
|
+
path?: string;
|
|
48
|
+
children?: Array<RouteLike>;
|
|
49
|
+
parentRoute?: RouteLike;
|
|
50
|
+
isRoot?: boolean;
|
|
51
|
+
options?: {
|
|
52
|
+
skipRouteOnParseError?: {
|
|
53
|
+
params?: boolean;
|
|
54
|
+
priority?: number;
|
|
55
|
+
};
|
|
56
|
+
caseSensitive?: boolean;
|
|
57
|
+
params?: {
|
|
58
|
+
parse?: (params: Record<string, string>) => any;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
} & ({
|
|
62
|
+
fullPath: string;
|
|
63
|
+
from?: never;
|
|
64
|
+
} | {
|
|
65
|
+
fullPath?: never;
|
|
66
|
+
from: string;
|
|
67
|
+
});
|
|
68
|
+
type ProcessedTree<TTree extends Extract<RouteLike, {
|
|
69
|
+
fullPath: string;
|
|
70
|
+
}>, TFlat extends Extract<RouteLike, {
|
|
71
|
+
from: string;
|
|
72
|
+
}>, TSingle extends Extract<RouteLike, {
|
|
73
|
+
from: string;
|
|
74
|
+
}>> = {
|
|
75
|
+
/** a representation of the `routeTree` as a segment tree */segmentTree: AnySegmentNode<TTree>; /** a mini route tree generated from the flat `routeMasks` list */
|
|
76
|
+
masksTree: AnySegmentNode<TFlat> | null; /** @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree */
|
|
77
|
+
singleCache: LRUCache<string, AnySegmentNode<TSingle>>; /** a cache of route matches from the `segmentTree` */
|
|
78
|
+
matchCache: LRUCache<string, RouteMatch<TTree> | null>; /** a cache of route matches from the `masksTree` */
|
|
79
|
+
flatCache: LRUCache<string, ReturnType<typeof findMatch<TFlat>>> | null;
|
|
80
|
+
};
|
|
81
|
+
type RouteMatch<T extends Extract<RouteLike, {
|
|
82
|
+
fullPath: string;
|
|
83
|
+
}>> = {
|
|
84
|
+
route: T;
|
|
85
|
+
rawParams: Record<string, string>;
|
|
86
|
+
parsedParams?: Record<string, unknown>;
|
|
87
|
+
branch: ReadonlyArray<T>;
|
|
88
|
+
};
|
|
89
|
+
interface ProcessRouteTreeResult<TRouteLike extends Extract<RouteLike, {
|
|
90
|
+
fullPath: string;
|
|
91
|
+
}> & {
|
|
92
|
+
id: string;
|
|
93
|
+
}> {
|
|
94
|
+
/** Should be considered a black box, needs to be provided to all matching functions in this module. */
|
|
95
|
+
processedTree: ProcessedTree<TRouteLike, any, any>;
|
|
96
|
+
/** A lookup map of routes by their unique IDs. */
|
|
97
|
+
routesById: Record<string, TRouteLike>;
|
|
98
|
+
/** A lookup map of routes by their trimmed full paths. */
|
|
99
|
+
routesByPath: Record<string, TRouteLike>;
|
|
100
|
+
}
|
|
101
|
+
declare function findMatch<T extends RouteLike>(path: string, segmentTree: AnySegmentNode<T>, fuzzy?: boolean): {
|
|
102
|
+
route: T;
|
|
103
|
+
/**
|
|
104
|
+
* The raw (unparsed) params extracted from the path.
|
|
105
|
+
* This will be the exhaustive list of all params defined in the route's path.
|
|
106
|
+
*/
|
|
107
|
+
rawParams: Record<string, string>;
|
|
108
|
+
/**
|
|
109
|
+
* The accumlulated parsed params of each route in the branch that had `skipRouteOnParseError` enabled.
|
|
110
|
+
* Will not contain all params defined in the route's path. Those w/ a `params.parse` but no `skipRouteOnParseError` will need to be parsed separately.
|
|
111
|
+
*/
|
|
112
|
+
parsedParams?: Record<string, unknown>;
|
|
113
|
+
} | null;
|
|
114
|
+
//#endregion
|
|
115
|
+
export { ProcessRouteTreeResult, ProcessedTree };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { NavigateOptions } from "./link.js";
|
|
2
|
+
import { AnyRouter, RegisteredRouter } from "./router.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/redirect.d.ts
|
|
5
|
+
type AnyRedirect = Redirect<any, any, any, any, any>;
|
|
6
|
+
/**
|
|
7
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
|
|
8
|
+
*/
|
|
9
|
+
type Redirect<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = Response & {
|
|
10
|
+
options: NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo> & {};
|
|
11
|
+
redirectHandled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type RedirectOptions<TRouter extends AnyRouter = RegisteredRouter, TFrom extends string = string, TTo extends string | undefined = undefined, TMaskFrom extends string = TFrom, TMaskTo extends string = '.'> = {
|
|
14
|
+
href?: string;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `statusCode` instead
|
|
17
|
+
**/
|
|
18
|
+
code?: number;
|
|
19
|
+
/**
|
|
20
|
+
* The HTTP status code to use when redirecting.
|
|
21
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#statuscode-property)
|
|
22
|
+
*/
|
|
23
|
+
statusCode?: number;
|
|
24
|
+
/**
|
|
25
|
+
* If provided, will throw the redirect object instead of returning it. This can be useful in places where `throwing` in a function might cause it to have a return type of `never`. In that case, you can use `redirect({ throw: true })` to throw the redirect object instead of returning it.
|
|
26
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#throw-property)
|
|
27
|
+
*/
|
|
28
|
+
throw?: any;
|
|
29
|
+
/**
|
|
30
|
+
* The HTTP headers to use when redirecting.
|
|
31
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType#headers-property)
|
|
32
|
+
*/
|
|
33
|
+
headers?: HeadersInit;
|
|
34
|
+
} & NavigateOptions<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>;
|
|
35
|
+
/**
|
|
36
|
+
* Options for route-bound redirect, where 'from' is automatically set.
|
|
37
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
|
|
38
|
+
*/
|
|
39
|
+
type RedirectOptionsRoute<TDefaultFrom extends string = string, TRouter extends AnyRouter = RegisteredRouter, TTo extends string | undefined = undefined, TMaskTo extends string = ''> = Omit<RedirectOptions<TRouter, TDefaultFrom, TTo, TDefaultFrom, TMaskTo>, 'from'>;
|
|
40
|
+
/**
|
|
41
|
+
* A redirect function bound to a specific route, with 'from' pre-set to the route's fullPath.
|
|
42
|
+
* This enables relative redirects like `Route.redirect({ to: './overview' })`.
|
|
43
|
+
* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType)
|
|
44
|
+
*/
|
|
45
|
+
interface RedirectFnRoute<in out TDefaultFrom extends string = string> {
|
|
46
|
+
<TRouter extends AnyRouter = RegisteredRouter, const TTo extends string | undefined = undefined, const TMaskTo extends string = ''>(opts: RedirectOptionsRoute<TDefaultFrom, TRouter, TTo, TMaskTo>): Redirect<TRouter, TDefaultFrom, TTo, TDefaultFrom, TMaskTo>;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { AnyRedirect, Redirect, RedirectFnRoute, RedirectOptions, RedirectOptionsRoute };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tanstack+router-core@1.168.14/node_modules/@tanstack/router-core/dist/esm/root.d.ts
|
|
2
|
+
/** Stable identifier used for the root route in a route tree. */
|
|
3
|
+
declare const rootRouteId = "__root__";
|
|
4
|
+
type RootRouteId = typeof rootRouteId;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { RootRouteId, rootRouteId };
|