/**
 * `express-routes` adapter — surfaces HTTP routes from Express-style
 * router files as synthetic *Controller classes.
 *
 * Why this exists: idle-meta-style codebases keep their HTTP API in
 * `routes/<resource>.ts` modules using `const router = Router()` +
 * `router.<verb>(path, handler)` declarations. There are NO class-based
 * `*Controller`s — but the API surface is real and architecturally
 * meaningful. Without this adapter the spec loses the entire
 * controllers: layer (every action collapses into services or
 * Unassigned).
 *
 * Each route file becomes one synthetic controller in the prepass
 * output. Each `router.<verb>(path, handler)` becomes one method on
 * that controller. The handler's body is extracted verbatim so the
 * existing candidate-step classifier can run on it unmodified.
 *
 * Detection criteria (must match BOTH):
 *   - File contains `Router()` or `import { Router }` from express
 *   - File has at least one `router.<verb>(...)` call where verb is
 *     get|post|put|patch|delete|all|head|options
 *
 * Naming derivation:
 *   - filename `auth.ts` → `AuthController`
 *   - filename `games.v3.ts` → `GamesV3Controller`
 *   - filename `user-profile.ts` → `UserProfileController`
 *
 * Action-name derivation (per handler, in priority order):
 *   1. Named handler reference: `router.post('/x', registerHandler)` →
 *      strip `Handler` suffix → `register`
 *   2. Single-word path with no parameters: `router.post('/login', ...)` →
 *      `login`
 *   3. Verb + path PascalCase: `router.get('/users/:id', ...)` → `getUsers`
 *   4. Fallback: `<verb><N>` where N is the handler ordinal
 */
export interface ExpressRouteHandler {
    /** Action name (suitable as a yaml key — lowercase first char, [a-z][a-zA-Z0-9_]*). */
    methodName: string;
    /** Whether the handler is declared async. */
    isAsync: boolean;
    /** The handler function body (between matching braces, no wrapping). */
    body: string;
    /** Source line range of the FULL handler declaration (start of router.x() call to closing brace). */
    sourceLineRange: [number, number];
    /** Original HTTP verb, lowercase. */
    httpVerb: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'all' | 'head' | 'options';
    /** Original path. */
    routePath: string;
}
export interface ExpressRouteFile {
    filePath: string;
    /** Synthesized controller name (PascalCase + Controller suffix). */
    controllerName: string;
    handlers: ExpressRouteHandler[];
}
/** True when the source looks like an Express router file. */
export declare function isExpressRouterFile(source: string): boolean;
/**
 * Scan an Express router file and extract every `router.<verb>(path, handler)` call.
 * Returns one `ExpressRouteHandler` per call — handler body included verbatim.
 */
export declare function parseExpressRoutes(source: string): ExpressRouteHandler[];
/**
 * Wrap a list of handlers in a synthetic class body. The output is
 * suitable for `walkMethodBodies` / `extractCandidateSteps` to consume.
 * Each handler becomes a `<methodName>(req, res) { <body> }` member.
 */
export declare function synthesizeControllerClass(controllerName: string, handlers: ExpressRouteHandler[]): string;
/** Derive a controller name from a route file's basename. */
export declare function deriveControllerName(filePath: string): string;
//# sourceMappingURL=express-routes.d.ts.map