/** * `kern migrate native-handlers` — rewrite raw `<<<…>>>` handler bodies to * inferred-KERN body-statement form. * * Input: raw JS body in `<<<…>>>` that passes the slice 5a `classifyHandlerBody` * eligibility check (no arrow functions, unsupported loops, unsafe mutation, * regex literals, console/process/req/res access, …). * * Output: `handler` with structured body-statement children * (`let`/`return`/`if`/`else`/`try`/`catch`/`throw`). The parser * infers `lang="kern"` for this shape, so the migration no longer * emits explicit opt-in boilerplate. * * Anything outside the supported AST shape causes the whole handler to be * skipped — never half-migrated. Verify mode (`--verify`) is the safety net: * it pre-compiles, applies the migration, recompiles, and rolls back on any * codegen drift. */ export interface NativeHandlerHit { headerLine: number; endLine: number; literal: string; valueAttr: string; } /** Eligible handler that the rewriter declined to migrate, with the reason * the author can act on. Surfaced via `--check-equivalent` so authors see * why a handler stayed in raw form instead of silently being left behind. */ export interface NativeHandlerSkip { headerLine: number; endLine: number; reason: string; } export interface NativeHandlerResult { hits: NativeHandlerHit[]; skipped: NativeHandlerSkip[]; output: string; } export declare function rewriteNativeHandlers(source: string, opts?: { canonicalizeBraces?: boolean; }): NativeHandlerResult;