import type { RouteMetaData, RouteMetaDataMulti, ParseOptions } from '../types'; import { ORIGINAL_PATH } from './instrument'; /** * Parser for Express 5 / `router@^2.x` apps. * * Strategy: walk the router tree, joining captured mount paths * (recorded by the `instrument` patch) with each `route.path`. Path-parameter * extraction uses path-to-regexp v8's `parse()`, which exposes the structural * AST (`Text | Parameter | Wildcard | Group`). We walk the AST per layer and * accumulate parameters across nested mounts so the leaf route reports its * full ancestor chain, matching v4 behavior. */ export declare const parseV5: (router: V5RouterStack, options: ParseOptions) => RouteMetaData[] | RouteMetaDataMulti[]; interface V5RouterStack { stack: V5Layer[]; } type V5HandleFn = (...args: any[]) => unknown; interface V5Layer { name: string; handle?: V5HandleFn | V5RouterStack; route?: { path: string; stack: V5RouteEntry[]; }; [ORIGINAL_PATH]?: string | RegExp | (string | RegExp)[]; } interface V5RouteEntry { method?: string; handle?: { metadata?: unknown; }; } export {};