import { Data, Effect, SubscriptionRef, Schema } from 'effect'; import * as _effuse_core from '@effuse/core'; import { EffuseChild, BlueprintDef, RoutePattern } from '@effuse/core'; import * as effect_Unify from 'effect/Unify'; /** * MIT License * * Copyright (c) 2025 Chris M. Perez * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ interface RouterHistory { readonly push: (path: string) => void; readonly replace: (path: string) => void; readonly go: (delta: number) => void; readonly back: () => void; readonly forward: () => void; readonly listen: (callback: () => void) => () => void; readonly getCurrentPath: () => string; } declare const createWebHistory: (base?: string) => RouterHistory; declare const createHashHistory: () => RouterHistory; /** Memory history for testing and SSR environments. */ declare const createMemoryHistory: (initialPath?: string) => RouterHistory; type NavigationResult = Data.TaggedEnum<{ NavigationAllowed: {}; NavigationCancelled: { readonly reason: string | undefined; }; NavigationRedirected: { readonly to: RouteLocation; }; NavigationFailed: { readonly error: Error; }; }>; declare const NavigationResult: { allowed: () => NavigationResult; cancelled: (reason?: string) => NavigationResult; redirected: (to: RouteLocation) => NavigationResult; failed: (error: Error) => NavigationResult; isAllowed: (u: unknown) => u is { readonly _tag: "NavigationAllowed"; }; isCancelled: (u: unknown) => u is { readonly _tag: "NavigationCancelled"; readonly reason: string | undefined; }; isRedirected: (u: unknown) => u is { readonly _tag: "NavigationRedirected"; readonly to: RouteLocation; }; isFailed: (u: unknown) => u is { readonly _tag: "NavigationFailed"; readonly error: Error; }; match: { any; readonly NavigationCancelled: (args: { readonly _tag: "NavigationCancelled"; readonly reason: string | undefined; }) => any; readonly NavigationRedirected: (args: { readonly _tag: "NavigationRedirected"; readonly to: RouteLocation; }) => any; readonly NavigationFailed: (args: { readonly _tag: "NavigationFailed"; readonly error: Error; }) => any; }>(cases: Cases & { [K in Exclude]: never; }): (value: { readonly _tag: "NavigationAllowed"; } | { readonly _tag: "NavigationCancelled"; readonly reason: string | undefined; } | { readonly _tag: "NavigationRedirected"; readonly to: RouteLocation; } | { readonly _tag: "NavigationFailed"; readonly error: Error; }) => effect_Unify.Unify>; any; readonly NavigationCancelled: (args: { readonly _tag: "NavigationCancelled"; readonly reason: string | undefined; }) => any; readonly NavigationRedirected: (args: { readonly _tag: "NavigationRedirected"; readonly to: RouteLocation; }) => any; readonly NavigationFailed: (args: { readonly _tag: "NavigationFailed"; readonly error: Error; }) => any; }>(value: { readonly _tag: "NavigationAllowed"; } | { readonly _tag: "NavigationCancelled"; readonly reason: string | undefined; } | { readonly _tag: "NavigationRedirected"; readonly to: RouteLocation; } | { readonly _tag: "NavigationFailed"; readonly error: Error; }, cases: Cases & { [K in Exclude]: never; }): effect_Unify.Unify>; }; fromLegacy: (value: unknown) => NavigationResult; }; type NavigationGuardReturn = NavigationResult | boolean | string | RouteLocation | Error | undefined; type NavigationGuard = (to: ResolvedRoute, from: Route) => NavigationGuardReturn | Promise | Effect.Effect; type AfterEachHook = (to: Route, from: Route) => void; declare const combineGuards: (...guards: NavigationGuard[]) => NavigationGuard; declare const guardWhen: (condition: (to: ResolvedRoute, from: Route) => boolean, guard: NavigationGuard) => NavigationGuard; declare const guardMeta: (key: string, handler: (value: unknown, to: ResolvedRoute, from: Route) => NavigationResult | Promise) => NavigationGuard; declare const createAuthGuard: (isAuthenticated: () => boolean | Promise, loginPath?: string) => NavigationGuard; declare const createUnsavedChangesGuard: (hasUnsavedChanges: () => boolean, confirmMessage?: string, confirmLeave?: (message: string) => boolean) => NavigationGuard; /** * MIT License * * Copyright (c) 2025 Chris M. Perez * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ type RouteComponent = ((props?: Record) => EffuseChild) | BlueprintDef; declare const EFFUSE_LAZY_ROUTE: unique symbol; interface LazyRouteComponent { (): Promise<{ default: RouteComponent; }>; readonly [EFFUSE_LAZY_ROUTE]?: true; } interface LazyRouteComponentOptions { readonly export?: string; } declare const isLazyRouteComponent: (value: unknown) => value is LazyRouteComponent; declare const lazyRouteComponent: (loader: () => Promise>>, options?: LazyRouteComponentOptions) => LazyRouteComponent; declare const lazyRoute: (loader: () => Promise>>, options?: LazyRouteComponentOptions) => LazyRouteComponent; interface RouteRecord { readonly path: string; readonly component?: RouteComponent | LazyRouteComponent; readonly components?: Record; readonly name?: string; readonly children?: readonly RouteRecord[]; readonly meta?: Record; readonly redirect?: string | RouteLocation; readonly alias?: string | readonly string[]; /** * Controls the props injected into the matched component. This option is the * single source of truth for prop injection — route params are never merged * on top of it: * * - absent or `true` — the route params are injected as props (default). * - `false` — nothing is injected; params remain available via `useRoute()`. * - object — exactly that object is injected; params are not auto-merged. * - function — exactly its return value is injected; it receives the current * `route`, so it can spread `route.params` explicitly when desired. */ readonly props?: boolean | Record | ((route: Route) => Record); readonly beforeEnter?: NavigationGuard; } interface RouteGroupMetadata { /** Route groups declared by the canonical record and its canonical ancestors. */ readonly canonicalRouteGroups: readonly string[]; /** Additional route groups introduced by the alias path that matched the URL. */ readonly aliasRouteGroups: readonly string[]; /** Ordered, duplicate-free union of canonical and alias route groups. */ readonly routeGroups: readonly string[]; } interface NormalizedRouteRecord extends RouteRecord, RouteGroupMetadata { readonly path: string; readonly regex: RegExp; readonly paramNames: readonly string[]; readonly pattern: RoutePattern; readonly fullPath: string; readonly parent: NormalizedRouteRecord | undefined; readonly aliasOf?: NormalizedRouteRecord; } type RouteLocation = string | { path: string; query?: Record; hash?: string; } | { name: string; params?: Record; query?: Record; hash?: string; }; interface ResolvedRoute extends RouteGroupMetadata { readonly path: string; readonly fullPath: string; readonly params: Record; readonly query: Record; readonly hash: string; readonly matched: readonly NormalizedRouteRecord[]; readonly name: string | undefined; readonly meta: Record; readonly redirectedFrom?: ResolvedRoute; } interface Route extends RouteGroupMetadata { readonly path: string; readonly fullPath: string; readonly params: Record; readonly query: Record; readonly hash: string; readonly matched: readonly NormalizedRouteRecord[]; readonly name: string | undefined; readonly meta: Record; } interface NavigationFailureBase { readonly to: ResolvedRoute; readonly from: ResolvedRoute; } type NavigationFailure = Data.TaggedEnum<{ NavigationAborted: NavigationFailureBase; NavigationGuardCancelled: NavigationFailureBase & { readonly reason: string | undefined; }; NavigationGuardFailed: NavigationFailureBase & { readonly error: Error; }; NavigationRedirect: NavigationFailureBase & { readonly redirectTo: RouteLocation; }; NavigationRedirectLoop: NavigationFailureBase & { readonly paths: readonly string[]; }; NavigationDuplicated: NavigationFailureBase; }>; declare const NavigationFailure: { aborted: (to: ResolvedRoute, from: ResolvedRoute) => NavigationFailure; guardCancelled: (to: ResolvedRoute, from: ResolvedRoute, reason?: string) => NavigationFailure; guardFailed: (to: ResolvedRoute, from: ResolvedRoute, error: Error) => NavigationFailure; redirect: (to: ResolvedRoute, from: ResolvedRoute, redirectTo: RouteLocation) => NavigationFailure; redirectLoop: (to: ResolvedRoute, from: ResolvedRoute, paths: readonly string[]) => NavigationFailure; duplicated: (to: ResolvedRoute, from: ResolvedRoute) => NavigationFailure; isNavigationFailure: (value: unknown) => value is NavigationFailure; isAborted: (u: unknown) => u is { readonly _tag: "NavigationAborted"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; }; isCancelled: (u: unknown) => u is { readonly _tag: "NavigationGuardCancelled"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly reason: string | undefined; }; isFailed: (u: unknown) => u is { readonly _tag: "NavigationGuardFailed"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly error: Error; }; isRedirect: (u: unknown) => u is { readonly _tag: "NavigationRedirect"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly redirectTo: RouteLocation; }; isRedirectLoop: (u: unknown) => u is { readonly _tag: "NavigationRedirectLoop"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly paths: readonly string[]; }; isDuplicated: (u: unknown) => u is { readonly _tag: "NavigationDuplicated"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; }; match: { any; readonly NavigationGuardCancelled: (args: { readonly _tag: "NavigationGuardCancelled"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly reason: string | undefined; }) => any; readonly NavigationGuardFailed: (args: { readonly _tag: "NavigationGuardFailed"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly error: Error; }) => any; readonly NavigationRedirect: (args: { readonly _tag: "NavigationRedirect"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly redirectTo: RouteLocation; }) => any; readonly NavigationRedirectLoop: (args: { readonly _tag: "NavigationRedirectLoop"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly paths: readonly string[]; }) => any; readonly NavigationDuplicated: (args: { readonly _tag: "NavigationDuplicated"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; }) => any; }>(cases: Cases & { [K in Exclude]: never; }): (value: { readonly _tag: "NavigationAborted"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; } | { readonly _tag: "NavigationGuardCancelled"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly reason: string | undefined; } | { readonly _tag: "NavigationGuardFailed"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly error: Error; } | { readonly _tag: "NavigationRedirect"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly redirectTo: RouteLocation; } | { readonly _tag: "NavigationRedirectLoop"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly paths: readonly string[]; } | { readonly _tag: "NavigationDuplicated"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; }) => effect_Unify.Unify>; any; readonly NavigationGuardCancelled: (args: { readonly _tag: "NavigationGuardCancelled"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly reason: string | undefined; }) => any; readonly NavigationGuardFailed: (args: { readonly _tag: "NavigationGuardFailed"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly error: Error; }) => any; readonly NavigationRedirect: (args: { readonly _tag: "NavigationRedirect"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly redirectTo: RouteLocation; }) => any; readonly NavigationRedirectLoop: (args: { readonly _tag: "NavigationRedirectLoop"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly paths: readonly string[]; }) => any; readonly NavigationDuplicated: (args: { readonly _tag: "NavigationDuplicated"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; }) => any; }>(value: { readonly _tag: "NavigationAborted"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; } | { readonly _tag: "NavigationGuardCancelled"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly reason: string | undefined; } | { readonly _tag: "NavigationGuardFailed"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly error: Error; } | { readonly _tag: "NavigationRedirect"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly redirectTo: RouteLocation; } | { readonly _tag: "NavigationRedirectLoop"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; readonly paths: readonly string[]; } | { readonly _tag: "NavigationDuplicated"; readonly to: ResolvedRoute; readonly from: ResolvedRoute; }, cases: Cases & { [K in Exclude]: never; }): effect_Unify.Unify>; }; }; /** * MIT License * * Copyright (c) 2025 Chris M. Perez * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ type ScrollBehavior = (to: Route, from: Route, savedPosition: { left: number; top: number; } | null) => { left?: number; top?: number; el?: string; behavior?: ScrollBehavior; } | undefined; interface RouterOptions { readonly routes: readonly RouteRecord[]; readonly history?: RouterHistory; readonly base?: string; readonly scrollBehavior?: ScrollBehavior; } interface NavigateOptions { readonly replace?: boolean; } interface RouterInstance { readonly currentRoute: SubscriptionRef.SubscriptionRef; readonly routes: readonly NormalizedRouteRecord[]; readonly options: RouterOptions; readonly push: (to: RouteLocation) => Promise; readonly replace: (to: RouteLocation) => Promise; readonly back: () => void; readonly forward: () => void; readonly go: (delta: number) => void; readonly beforeEach: (guard: NavigationGuard) => () => void; readonly beforeResolve: (guard: NavigationGuard) => () => void; readonly afterEach: (hook: AfterEachHook) => () => void; readonly resolve: (to: RouteLocation) => ResolvedRoute; readonly hasRoute: (name: string) => boolean; readonly addRoute: (route: RouteRecord, parentName?: string) => void; readonly removeRoute: (name: string) => void; readonly getRoutes: () => readonly NormalizedRouteRecord[]; readonly start: () => () => void; readonly isReady: boolean; } declare const createRouter: (options: RouterOptions) => RouterInstance; declare const runWithRouter: (router: RouterInstance, fn: () => T) => T; declare const installRouter: (router: RouterInstance) => RouterInstance & { cleanup: () => void; }; /** * MIT License * * Copyright (c) 2025 Chris M. Perez * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ declare module '@effuse/core' { interface EffuseRegistry { router: RouterInstance; } } /** * MIT License * * Copyright (c) 2025 Chris M. Perez * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ declare const useRouter: () => RouterInstance; declare const useRoute: () => Route; declare const onRouteChange: (callback: (route: Route) => void) => (() => void); declare const navigateTo: (to: RouteLocation, options?: { replace?: boolean; }) => Promise; declare const goBack: () => void; declare const goForward: () => void; declare const isActiveRoute: (path: string, exact?: boolean) => boolean; declare const getLinkClasses: (to: string, options?: { activeClass?: string; exactActiveClass?: string; inactiveClass?: string; }) => string; type RouterViewFallback = EffuseChild | ((route: Route) => EffuseChild); type RouterViewErrorFallback = EffuseChild | ((error: unknown, route: Route) => EffuseChild); interface RouterViewProps { readonly name?: string; readonly route?: Route; readonly fallback?: RouterViewFallback; readonly errorFallback?: RouterViewErrorFallback; readonly slot?: (component: RouteComponent, route: Route, props: Record) => EffuseChild; } declare const RouterView: _effuse_core.Component; /** * MIT License * * Copyright (c) 2025 Chris M. Perez * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ interface LinkProps { [key: string]: unknown; to: string | (() => string); activeClass?: string; exactActiveClass?: string; class?: string; className?: string; children?: unknown; } declare const Link: _effuse_core.Component; declare const RouterLink: _effuse_core.Component; /** * MIT License * * Copyright (c) 2025 Chris M. Perez * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ interface TypedRouteRecord = Record, Query extends Record = Record, Meta extends Record = Record> extends RouteRecord { readonly paramsSchema?: Schema.Schema; readonly querySchema?: Schema.Schema; readonly meta?: Meta; } interface TypedRoute = Record, Query extends Record = Record, Meta extends Record = Record> extends Route { readonly params: Params; readonly query: Query; readonly meta: Meta; } type TypedRouteLocation> = Record> = { name: Name; params?: Params extends Record ? undefined : Params; query?: Record; hash?: string; }; declare const defineRoutes: (routes: Routes) => Routes; declare const createTypedNavigator: , Query extends Record = Record>(name: string, _paramsSchema?: Schema.Schema, _querySchema?: Schema.Schema) => { to: (params: Params, query?: Query) => RouteLocation; matches: (route: Route) => route is TypedRoute; }; declare const validateParams: (params: Record, schema: Schema.Schema) => A | null; declare const createParamsGuard: (schema: Schema.Schema, onInvalid?: (params: Record) => RouteLocation | string) => (to: Route) => true | RouteLocation; /** * MIT License * * Copyright (c) 2025 Chris M. Perez * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ type TransitionMode = 'in-out' | 'out-in' | 'default'; interface TransitionConfig { readonly name?: string; readonly mode?: TransitionMode; readonly duration?: number | { enter: number; leave: number; }; readonly enterClass?: string; readonly enterActiveClass?: string; readonly enterToClass?: string; readonly leaveClass?: string; readonly leaveActiveClass?: string; readonly leaveToClass?: string; } declare const transitions: { fade: TransitionConfig; slide: TransitionConfig; slideLeft: TransitionConfig; slideRight: TransitionConfig; scale: TransitionConfig; }; export { type AfterEachHook, EFFUSE_LAZY_ROUTE, type LazyRouteComponent, type LazyRouteComponentOptions, Link, type NavigateOptions, NavigationFailure, NavigationFailure as NavigationFailureUtils, type NavigationGuard, type NavigationGuardReturn, NavigationResult, NavigationResult as NavigationResultUtils, type Route, type RouteComponent, type RouteGroupMetadata, type RouteLocation, type RouteRecord, type RouterHistory, type RouterInstance, RouterLink, type RouterOptions, RouterView, type RouterViewProps, type TransitionConfig, type TransitionMode, type TypedRoute, type TypedRouteLocation, type TypedRouteRecord, combineGuards, createAuthGuard, createHashHistory, createMemoryHistory, createParamsGuard, createRouter, createTypedNavigator, createUnsavedChangesGuard, createWebHistory, defineRoutes, getLinkClasses, goBack, goForward, guardMeta, guardWhen, installRouter, isActiveRoute, isLazyRouteComponent, lazyRoute, lazyRouteComponent, navigateTo, onRouteChange, runWithRouter, transitions, useRoute, useRouter, validateParams };