//#region src/types.d.ts type MaybePromise = T | Promise; type RouteLocation = { pathname: string; search: string; hash: string; }; type RouterHistory = { location: () => RouteLocation; push: (location: RouteLocation) => void; replace: (location: RouteLocation) => void; listen: (listener: (location: RouteLocation) => void) => () => void; }; type RouteLoadCause = "navigation" | "preload" | "revalidate"; type RouteStaleReloadMode = "background" | "blocking"; type RouteMatchStatus = "pending" | "success" | "error" | "notFound" | "redirected"; type RouteMatchFetching = false | "loader"; type RouteNotFound = { type: "notFound"; data?: unknown; }; type RouteRedirect = { type: "redirect"; location: RouteLocation; }; declare function notFound(data?: unknown): RouteNotFound; declare function redirect(location: RouteLocation): RouteRedirect; type RouteHookOptions = { signal: AbortSignal; shouldRun: () => boolean; revalidating: boolean; location: RouteLocation; deps: string; cause: RouteLoadCause; }; type RouteLoaderOptions = RouteHookOptions; type RouteLoaderResult = TData | RouteNotFound | RouteRedirect; type RouterNavigationOptions = { history?: "none" | "push" | "replace"; revalidate?: boolean; }; type PageDefinition = { id: TRouteId; path: string; aliases?: readonly string[]; component: () => MaybePromise; loaderDeps?: (context: TLoadContext, location: RouteLocation) => string; loader?: (context: TLoadContext, options: RouteLoaderOptions) => MaybePromise>; staleTime?: number; staleReloadMode?: RouteStaleReloadMode; preloadStaleTime?: number; preloadGcTime?: number; gcTime?: number; onEnter?: (context: TLoadContext, data: TData | undefined, options: RouteHookOptions) => MaybePromise; onLeave?: (context: TLoadContext, data: TData | undefined, options: RouteHookOptions) => MaybePromise; }; type RouteMatch = { id: string; routeId: TRouteId; location: RouteLocation; deps: string; status: RouteMatchStatus; isFetching: RouteMatchFetching; data?: TData; module?: TModule; error?: unknown; updatedAt: number; fetchCount: number; abortController: AbortController; cause: RouteLoadCause; preload: boolean; invalid: boolean; }; type RouterState = { location: RouteLocation; resolvedLocation: RouteLocation | null; status: "idle" | "loading" | "success" | "error" | "notFound" | "redirected"; matches: readonly RouteMatch[]; pendingMatches: readonly RouteMatch[]; cachedMatches: readonly RouteMatch[]; }; type RouterStateSelector = (state: TState) => TSelected; type RouterOptions = { routes: readonly PageDefinition[]; staleTime?: number; defaultStaleReloadMode?: RouteStaleReloadMode; preloadStaleTime?: number; preloadGcTime?: number; gcTime?: number; }; type Router = { routes: readonly PageDefinition[]; getRoute: (routeId: TRouteId) => PageDefinition | null; getMatch: (matchId: string) => RouteMatch | undefined; preloadRoute: (routeId: TRouteId, context: TLoadContext) => Promise; preloadLocation: (location: RouteLocation, context: TLoadContext) => Promise; invalidate: (routeId?: TRouteId) => Promise; getState: () => RouterState; subscribe: (listener: (next: RouterState) => void) => () => boolean; subscribeSelector: (selector: RouterStateSelector, TSelected>, listener: (next: TSelected) => void, equal?: (previous: TSelected, next: TSelected) => boolean) => () => boolean; subscribeMatch: (matchId: string, listener: (next: RouteMatch | undefined) => void) => () => boolean; pathForRoute: (routeId: TRouteId, basePath?: string) => string; routeIdFromPath: (pathname: string, basePath?: string) => TRouteId | null; start: (history: RouterHistory, basePath: string, context: TLoadContext) => Promise; navigate: (routeId: TRouteId, context: TLoadContext, options?: RouterNavigationOptions, requestedLocation?: RouteLocation) => Promise; navigateLocation: (location: RouteLocation, context: TLoadContext) => Promise; revalidate: (context: TLoadContext, routeId?: TRouteId) => Promise; stop: () => void; }; declare function definePage(page: PageDefinition): PageDefinition; //#endregion //#region src/router.d.ts declare function createRouter(options: RouterOptions): Router; //#endregion //#region src/matches.d.ts declare function normalizeRouteBasePath(basePath: string): string; declare function normalizeRoutePath(path: string): string; //#endregion export { type MaybePromise, type PageDefinition, type RouteHookOptions, type RouteLoadCause, type RouteLoaderOptions, type RouteLoaderResult, type RouteLocation, type RouteMatch, type RouteMatchFetching, type RouteMatchStatus, type RouteNotFound, type RouteRedirect, type Router, type RouterHistory, type RouterNavigationOptions, type RouterOptions, type RouterState, type RouterStateSelector, createRouter, definePage, normalizeRouteBasePath, normalizeRoutePath, notFound, redirect };