/** * vapor-chamber-router — the navigation engine. Vue 3.6-native: router state * IS a shallowRef (alien-signals-backed in 3.6) — no bridge layer. * * The two-layer URL model: * PATH change → resolve → guards → components + loaders (parallel, with * an AbortController created per navigation; starting a new * navigation aborts the previous one's fetches immediately) * → ONE atomic frozen snapshot commit (two-phase: data * loads during, commits with — a page never renders with * the previous page's data). * QUERY/HASH-only change → fast path: location commits immediately (no * matching, no guards, no remount); loaders whose template * depends on a changed key refetch in the background and * patch `snapshot.data` when done (isLoading tracks it). * * `navigate()` resolves to `RouterError | null` — null means committed. * Guard refusals ('aborted') and superseded navigations ('cancelled') are * returned but NOT dispatched to onError. */ import type { RouterError } from './errors'; import type { RouterHistory } from './history'; import type { RouteTable } from './table'; import type { AfterEachHook, NavigationGuard, QueryPatch, RenderEntry, RouteLocation, RouteLocationRaw, RouteSnapshot, TableRecord } from './types'; export declare const START_LOCATION: RouteLocation; export type EngineContext = { getTable: () => RouteTable | null; history: RouterHistory; /** Resolve the renderable chain into render entries (components loaded, * blade rows wrapped). Throws coded RouterErrors. */ resolveRender: (records: readonly TableRecord[], to: RouteLocation) => Promise; /** Run the load chain through the configured preset. Throws coded RouterErrors. */ runLoaders: (records: readonly TableRecord[], to: RouteLocation, signal: AbortSignal) => Promise>; /** Which loaders in the chain does a set of changed query keys affect? */ loadAffectedBy: (records: readonly TableRecord[], keys: readonly string[]) => readonly TableRecord[]; /** Real failures only — refusals never arrive here. */ onError: (error: unknown, to: RouteLocation) => void; /** After a committed PATH navigation (not query-only). */ onCommit?: (snapshot: RouteSnapshot, from: RouteLocation, info: { popstate: boolean; }) => void; }; export type NavigateOptions = { replace?: boolean; popstate?: boolean; delta?: number; }; export type Engine = ReturnType; export declare function createEngine(ctx: EngineContext): { snapshot: import("vue").ShallowRef; isLoading: import("vue").ShallowRef; navigate: (raw: RouteLocationRaw, opts?: NavigateOptions) => Promise; resolveLocation: (raw: RouteLocationRaw) => RouteLocation; handlePop: (fullPath: string, info: { delta: number; }) => void; setQuery: (patch: QueryPatch, opts: { history?: "push" | "replace"; }, resolveMode: (key: string) => "push" | "replace") => void; setRouteData: (recordName: string, value: unknown) => void; beforeEach: (guard: NavigationGuard) => () => void; afterEach: (hook: AfterEachHook) => () => void; }; //# sourceMappingURL=engine.d.ts.map