import type { ScannedEvent } from "./scan-events.js"; /** * Start-of-block markers for the two handler-derived sections that * `run-codegen.ts` may need to carry forward verbatim from a previous * run (when the current run has no `handlerQns` to render a fresh * block from). Each marker is always the last thing its renderer * emits, so a caller can locate it in a previously-written file and * slice from the marker to EOF to recover the whole block. */ export declare const WRITE_HANDLER_QN_MARKER = "// --- WriteHandlerQn (generated from live registry / feature-manifest.json) ---"; export declare const TYPED_DISPATCHER_MARKER = "// --- TypedDispatcher (generated from live registry / feature-manifest.json) ---"; /** * Render `types.generated.d.ts`. Imports the schema-identifiers as * type-only — sources can be either named exports of feature-events * files (kind: "imported") or extracted const-exports of the * co-generated schemas.generated.ts (kind: "inline"). Result is wired * via `z.infer` into the augmentation. Empty events list → * minimal but valid file (still augmentable, just no entries yet — * useful first-time scaffold). */ export declare function renderTypesAugmentation(events: readonly ScannedEvent[], outputDirAbs: string): string; /** * Render `schemas.generated.ts`. One `export const` per inline-schema * event, named via the qualifiedName-derived stable identifier. The * source-text of the original `z.*(...)` expression is replayed — we * don't try to be cleverer than the zod compiler about reconstructing * the schema. Returns undefined when no inline-schemas exist (so the * runner can skip writing the file entirely). */ export declare function renderInlineSchemasFile(events: readonly ScannedEvent[], appRootAbs: string): string | undefined; /** * Render `define.ts` — local thin wrappers that fix TMap to * KumikoEventTypeMap. Apps import `defineWriteHandler` / * `defineQueryHandler` from this file; framework's strict-overload * becomes the only matching overload because TMap is no longer the * eager-resolved default. * * The wrappers are intentionally *thin* — same signature as the * framework's, just with TMap pre-bound. Apps stay portable: switch * the import back to "@cosmicdrift/kumiko-framework/engine" and you're back on the * loose default. Migration is reversible, no behavioural surface change. */ export declare function renderDefineFile(handlerQns?: readonly string[]): string; /** * Render `WriteHandlerQn` type lines — exports a union of all registered * write handler QNs so custom-screen code can type-check dispatcher.write * calls at compile time: * * ```ts * import type { WriteHandlerQn } from "@app/define"; * dispatcher.write("tenant:write:create", payload); // ✓ * dispatcher.write("tenant:write:creat", payload); // ✗ TS error * ``` */ export declare function renderWriteHandlerTypes(handlerQns: readonly string[]): string;