/** * Deterministic JSON-Schema → TypeScript expression converter for * `weft codegen`. * * Converts a single JSON Schema fragment ({@link jsonSchemaToTypeScript}) * into a TypeScript type expression, and emits a safely-quoted TypeScript * string literal or property key ({@link emitStringLiteral}, * {@link emitPropertyKey}). The JSON Schema subset supported here covers * what `definitionSchemaToJsonSchema` actually produces today (Zod via * `z.toJSONSchema` and Valibot via `@valibot/to-json-schema`). Anything * outside that subset degrades to `unknown` so the converter never claims * a type it cannot justify. * * `codegen-emit-registry.ts` is the module that actually assembles a full * `.d.ts` file (the `WorkflowRegistry` module augmentation, revision/ * workflowVersion literals, and schema-alias hoisting) from these * primitives — this module has no knowledge of the registry snapshot shape * or the augmented module's structure, only of JSON Schema → TypeScript * conversion. * * @module cli/codegen-emit */ export { CodegenEmitError } from './codegen-emit-keywords.ts'; /** * Emit a TypeScript string literal type for an arbitrary string value. * Shared by {@link emitPropertyKey} (a literal used as a property key) and * `codegen-emit-registry.ts`'s `revision`/`workflowVersion` emission (a * literal used as a value type) — both need the same `JSON.stringify` * safety property: quotes, backslashes, control characters, and any other * hostile content are always safely embedded inside the double-quoted * string, so neither call site can inject generated TypeScript. */ export declare function emitStringLiteral(value: string): string; /** Emit a TypeScript property key as a double-quoted string literal. */ export declare function emitPropertyKey(name: string): string; /** Convert a single JSON Schema fragment to a TypeScript type expression. */ export declare function jsonSchemaToTypeScript(schema: unknown): string;