/** * Best-effort route discovery for Next.js projects, so the coverage guard works * out of the box: a generated spec calls this at run time, so `expected` reflects * the app's *current* routes — a newly added page appears automatically, and the * guard fails until it has a surface. No static list to keep in sync (that drift * is the whole bug the guard exists to prevent). * * Covers the App Router (`app/`, `src/app/` — directories with a `page.*`) and the * Pages Router (`pages/`, `src/pages/` — page files, minus `_app`/`_document`/`api`). * Route groups `(group)` and parallel slots `@slot` are stripped; `[param]` / * `[...catchall]` segments mark a route dynamic. It reads the filesystem only — * no framework internals — so it's a heuristic, not a router; edit the generated * spec if your routing does something exotic. */ export type DiscoveredRoute = { /** Filename-safe surface key (`/` → `index`, `/blog/[slug]` → `blog-slug`). */ key: string; /** URL path to navigate (`/`, `/about`, `/blog/[slug]`). */ path: string; /** True when a segment is a `[param]` / `[...catchall]` — can't be navigated as-is. */ dynamic: boolean; }; /** * Discover a Next.js project's routes under `cwd` (default `process.cwd()`). * Returns one entry per route, deduped by path (App Router wins a tie) and sorted. * Empty array when no `app/` or `pages/` dir is found — the caller decides whether * that means "not a Next project". */ export declare function discoverNextRoutes(cwd?: string): DiscoveredRoute[];