/** * Expression visitor interface and shared helpers. * * The ExprVisitor interface is the contract between the shared IR and * per-language code emitters. Each language implements its own visitor * in `languages//visitor.ts`. */ import { Expr, Construct, VariantConstruct, TypeRegistry } from "./expansion.js"; export interface ExprVisitor { visitExpr(expr: Expr): string; /** Optional type registry for wire format generation and type-aware codegen. */ registry?: TypeRegistry; } /** * Render a Construct expression's fields as a plain object literal. * Used by TypeScript, Python, C#, Go coercions where the template wraps * the literal in language-specific loading logic (e.g., `TypeName.load({...}, ctx)`). * * @param expr - A Construct or VariantConstruct expression * @param visitor - The language-specific visitor for rendering field values * @param format - How to format the fields: * - "js": `{ field: value }` (TypeScript, Go) * - "py": `{"field": value}` (Python) */ export declare function renderObjectLiteral(expr: Construct | VariantConstruct, visitor: ExprVisitor, format?: "js" | "py"): string; /** camelCase → PascalCase (first char uppercase). */ export declare function toPascalCase(name: string): string; /** Exhaustive check helper — TypeScript enforces all Expr.kind arms are handled. */ export declare function assertNever(x: never): never;