import { type Matcher } from '@janux/server'; /** * The half of an error's Janux chain that only the server knows: which route * file answered the URL and which `_layout` chain wrapped it. The browser can * read the island, the intent, the guard and the origin off the runtime; it * cannot read the router. * * Served by the dev middleware only (see plugin.ts). A built app has no Vite * and therefore no such endpoint. */ export interface DevRouteInfo { path: string; /** The route pattern that matched, e.g. `/orders/[id]`. Absent when nothing matched. */ pattern?: string; /** Route module, relative to the app root. */ file?: string; /** `_layout` modules wrapping the route, outermost first, relative to the app root. */ layouts: string[]; params: Record; } /** Where `janux dev` answers it. Not a route: the dev middleware owns this path. */ export declare const DEV_ROUTE_PATH = "/_janux/dev/route"; /** The app config fields the endpoint needs — the same two the dev server routes with. */ interface DevRouteApp { routesDir: string; matchersModule?: string; } /** * The endpoint as the middleware uses it: resolves the app's own `src/matchers.ts` * first, exactly as `loadServerOptions` does. Without them a declared * `[post=slug]` route renders fine but reports here as unmatched, and a * diagnostic that lies about supported routing is worse than no diagnostic. */ export declare function devRouteHandler(root: string, app: DevRouteApp, loadModule: (file: string) => Promise>, url: string): Promise; /** The endpoint itself: `undefined` for every URL that is not it, so the middleware passes those on. */ export declare function devRouteResponse(root: string, routesDir: string, url: string, matchers?: Record): Response | undefined; /** Resolves one URL path against the app's file-system router. */ export declare function devRouteInfo(root: string, routesDir: string, path: string, matchers?: Record): DevRouteInfo; export {};