/** * AST codegen emit (plan: `.plans/refactor/queued/codegen-ast.md`). Produces a * controller's `.routes.gen.ts` text WITHOUT booting the app or running * `importResolution`: parse → resolve (extends-walk) → build the shared * `ControllerSubtreeSpec` → flatten via the real `RouteRegistry` → feed the * shared `renderGenFile`. This is the project's sole codegen front-end (the old * boot/`importResolution` path was removed once this was proven byte-identical). * * `generateRouteTypesViaAst` registers ALL controllers into ONE registry (so * cross-controller bleed resolves exactly as runtime) and reports any controller * whose source isn't statically analyzable (`needsBoot`) so the caller * (`generateAll`) throws and names it — there is no boot fallback. */ import type { IApp } from '../server.ts'; import type { CodegenLogger } from './appTypes.ts'; /** A planned gen-file write: its target path and rendered text. */ export interface PlannedOutput { outPath: string; text: string; } /** Result of analyzing (but not writing) the route types. */ export interface RoutePlan { /** Gen files to write (user controllers only; framework-internal skipped). */ outputs: PlannedOutput[]; /** Controllers that aren't statically analyzable. By default the caller * throws; with `skipNonAnalyzable` they're skipped (no types) and listed * here so the caller can warn. */ needsBoot: string[]; /** Existing `*.routes.gen.ts` in the user folder with no sibling source. */ orphans: string[]; } /** * Analyze the project's controller sources (no import, no boot) and return the * gen files to write — WITHOUT writing anything. Registers all controllers * (framework-internal + user) into one registry so cross-controller bleed * resolves exactly like runtime, then renders each user controller's gen text. * * Pure analysis so the caller can fail before any write (atomicity) and so a * `--check` run can compare against disk using the exact same rendering path. */ export declare function planRouteTypes(app: IApp, logger?: CodegenLogger | null, options?: { skipNonAnalyzable?: boolean; }): Promise; /** * AST-primary route-type generation: plan, then write each user controller's * `.routes.gen.ts` and delete orphaned gen files. If ANY controller isn't * statically analyzable nothing is written and the paths are returned so the * caller throws and names them. There is no boot fallback. */ export declare function generateRouteTypesViaAst(app: IApp, logger?: CodegenLogger | null): Promise<{ written: number; needsBoot: string[]; }>; /** Write the planned gen files to disk. */ export declare function writePlanned(outputs: PlannedOutput[], logger?: CodegenLogger | null): Promise; /** Delete orphaned gen files (those with no sibling controller source). */ export declare function deleteOrphans(orphans: string[], logger?: CodegenLogger | null): Promise;