/** * Adapter: AST extraction → `ControllerSubtreeSpec` (plan: * `.plans/refactor/queued/codegen-ast.md`). Turns a controller's parsed source * (`astResolve`) into the same plain spec the runtime builds from an instance, * so codegen feeds the SHARED `buildSubtreeFromSpec` → `RouteRegistry.flatten()` * — the real resolver, no parallel matcher. * * The spec carries SYNTHETIC stand-ins: handlers are no-op functions whose * `.name` is the handler name, and each middleware is an opaque entry whose * `Class.name` is the import BINDING. The registry/flatten treat both opaquely * (route by scope, never call the class), and codegen reads only those names — * so the live classes the boot path needed (and the identity matching that came * with them) are gone. The emittable `binding → specifier` map comes from * `astResolve` (`resolved.imports`), never from a live class. */ import { type ControllerSubtreeSpec } from '../controllers/index.ts'; import { type ExtractCache, type ResolvedController } from './astResolve.ts'; export interface AstSpec { spec: ControllerSubtreeSpec; /** The resolved data (routes + effective middleware + emittable imports). */ resolved: ResolvedController; } /** Build a `ControllerSubtreeSpec` from a controller's source (no instance). * `prefix` is the controller's folder relative to the controllers root. */ export declare function specFromExtracted(srcPath: string, prefix?: string, cache?: ExtractCache): Promise;