/** * Codegen public entry. Used by: * - the `generatetypes` CLI command (`src/commands/GenerateTypes.ts`) * - any programmatic caller (build plugin, watch mode, etc.) * * Splits into two outputs: * - `genTypes.d.ts` at the project root (config + model maps) * - `.routes.gen.ts` next to each controller (handler request shapes) */ import type { IApp } from '../server.ts'; import { type CodegenLogger } from './appTypes.ts'; import { generateRouteTypesViaAst } from './astEmit.ts'; export type { CodegenLogger }; export { generateRouteTypesViaAst }; export interface GenerateAllOptions { /** Verify-only (CI drift guard): compare rendered output against disk, write * nothing, throw (non-zero exit) on any missing/stale/orphan file. */ check?: boolean; } /** * Generate both app-level and per-controller route types from the AST front-end * — no app boot, no model imports. A controller whose `routes` / `middleware` / * `getHttpPath` isn't a literal (a loop, conditional, computed key, or `super` * — e.g. one that extends another controller and merges `super.routes`) can't be * statically analyzed. Rather than abort the whole run, such controllers are * SKIPPED with a warning: they work at runtime, only their generated request * types are omitted. Types for every analyzable controller are still written. * * Analysis runs fully BEFORE any write, so a failure never leaves partially * refreshed output (atomicity). With `{ check: true }` nothing is written and * any drift throws — wire `generatetypes --check` into CI. */ export declare function generateAll(app: IApp, logger?: CodegenLogger | null, options?: GenerateAllOptions): Promise;