import { RouterRoute } from '../types/routerRoute'; import { Router, RouterRouteName } from '../types/router'; import { InjectionKey } from 'vue'; export type IsRouteOptions = { exact?: boolean; }; export type RouteWithMatch = TRoute extends RouterRoute ? TRouteName extends TRoute['matches'][number]['name'] ? TRoute : never : never; type IsRouteFunction = { /** * A type guard for determining if a value is a valid RouterRoute. * @param route - The value to check. * @returns `true` if the value is a valid RouterRoute, otherwise `false`. * @group Type Guards */ (route: unknown): route is RouterRoute; /** * A type guard for determining if a value is a valid RouterRoute with an exact match. * @param route - The value to check. * @param routeName - The expected route name. * @returns `true` if the value is a valid RouterRoute with an exact match, otherwise `false`. * @group Type Guards */ >(route: TRoute, routeName: TRouteName, options: IsRouteOptions & { exact: true; }): route is TRoute & { name: TRouteName; }; /** * A type guard for determining if a value is a valid RouterRoute with a partial match. * @param route - The value to check. * @param routeName - The expected route name. * @returns `true` if the value is a valid RouterRoute with a partial match, otherwise `false`. * @group Type Guards */ (route: TRoute, routeName: TRouteName, options?: IsRouteOptions): route is RouteWithMatch; /** * A type guard for determining if a value is a valid RouterRoute. * @param route - The value to check. * @param routeName - The expected route name. * @returns `true` if the value is a valid RouterRoute, otherwise `false`. * @group Type Guards */ (route: unknown, routeName?: string, options?: IsRouteOptions): boolean; }; export declare function createIsRoute(routerKey: InjectionKey): IsRouteFunction; export {};