/** * Express 5 / `router@^2.x` discards the original mount-path string at Layer * construction time. To recover it, we patch `Router.prototype.use` and * `.route` to record the path argument on the resulting Layer(s) before * returning to the user. The patch is idempotent and a no-op for consumers * who don't have the `router` package installed (Express 4 only). * * Side-effected by `src/index.ts` import so consumers don't need a setup * call. Patches `Router.prototype` once; subsequent imports are no-ops. */ export interface CapturedPath { /** * The original path argument passed to `router.use(path, ...)` or * `router.route(path)`. Stored on each newly-created Layer as a hidden * symbol property so the v5 walker can reconstruct full paths. */ path: string | RegExp | (string | RegExp)[]; } /** * Hidden property attached to v5 Layer instances by the patch. The v5 parser * reads this to recover mount paths. The symbol form prevents collisions * with any Layer field upstream might add. */ export declare const ORIGINAL_PATH: unique symbol; /** * Idempotent. Returns true if patching took effect (or was already in place); * false if the `router` package isn't installed (Express 4 only deployment). * * Exported for tests and for the documented escape hatch * `EXPRESS_ROUTE_PARSER_NO_AUTO_INSTRUMENT=1`. */ export declare const instrumentExpress5Router: () => boolean;