/** * Go code emitter — Declaration IR → Go source code. * * Replaces `file.go.njk` Nunjucks template with a typed TypeScript function * that walks the TypeDecl tree and produces a complete Go source file. * * Each file contains one type hierarchy (parent + children). * Go has no inheritance — child structs duplicate parent fields. * Polymorphic types use interface{} and type switches. * * Structural blocks emitted per type (in order): * 1. Description comment * 2. Struct definition * 3. Load function * 4. Save method * 5. ToJSON method * 6. ToYAML method * 7. FromJSON function * 8. FromYAML function */ import { TypeDecl, EnumDef } from "../../ir/declarations.js"; import { ExprVisitor } from "../../ir/visitor.js"; /** * Emit a complete Go source file for a type hierarchy. * * @param types - All TypeDecls in this file (parent first, then children) * @param packageName - Go package name (lowercase) * @param visitor - Expression visitor for coercion rendering * @param polymorphicTypeNames - Set of type names that are polymorphic bases * @param enums - Enum definitions used in this file * @param group - Semantic group from TSP source subfolder (used as header comment only; Go stays flat) */ export declare function emitGoFileContent(types: TypeDecl[], packageName: string, visitor: ExprVisitor, polymorphicTypeNames: Set, enums?: EnumDef[], group?: string, scalarCoercibleTypeNames?: Set, declarationUniverse?: TypeDecl[]): string; /** Map a protocol type string to a Go type. */ export declare function protocolGoType(typeStr: string, modelQualifier?: string): string;