import type { RouteManifestEntry } from "./manifest.ts"; export declare const glob: (path: string) => string[]; /** Normalize a file path to posix separators (bundler-agnostic). */ export declare function normalizePath(path: string): string; export interface FileSystemRouterConfig { /** * Route directory to scan. Relative paths are resolved against the * current working directory. */ dir: string; /** File extensions (without the dot) that participate in routing. */ extensions: string[]; /** * Pluggable filename convention: maps a route file (relative to `dir`, * extension stripped, e.g. `/blog/[id]`) to a route path in the neutral * pattern language, or `undefined` to skip the file. When omitted, the * router's own `toPath` implementation is used. */ toPath?: (routeFile: string, config: FileSystemRouterConfig) => string | undefined; /** * Pluggable module convention: maps a source file to a manifest entry, * or `undefined` to skip the file. When omitted, the router's own * `toRoute` implementation is used. */ toRoute?: (src: string, router: BaseFileSystemRouter) => RouteManifestEntry | undefined; } type RouterEvent = CustomEvent<{ route: string; type: "update" | "remove" | "add"; }>; /** Strips the route dir prefix and the file extension from a source path. */ export declare function cleanPath(src: string, config: FileSystemRouterConfig): string; /** * Bundler-agnostic file-system router: scans a directory into a flat, neutral * route manifest and keeps it up to date as files are added, changed and * removed. Delivery adapters (e.g. the Vite plugin) subscribe to `reload` * events; emission adapters consume the manifest. */ export declare class BaseFileSystemRouter extends EventTarget { routes: RouteManifestEntry[]; config: FileSystemRouterConfig; constructor(config: FileSystemRouterConfig); glob(): string; buildRoutes(): Promise; isRoute(src: string): boolean; toPath(src: string): string | undefined; toRoute(src: string): RouteManifestEntry | undefined; _addRoute(route: RouteManifestEntry): boolean; addRoute(src: string): Promise; reload(route: string, type: "update" | "remove" | "add"): void; updateRoute(src_: string): Promise; removeRoute(src: string): void; on(type: string, cb: (evt: RouterEvent) => void): () => void; buildRoutesPromise?: Promise; getRoutes(): Promise; } export {};