/** * C# code emitter — Declaration IR → C# source code. * * Replaces `file.cs.njk` Nunjucks template with a typed TypeScript function * that walks the TypeDecl tree and produces a complete C# class file. * * Each TypeDecl becomes one C# file (one class per file). * Polymorphic types use abstract class + child : Base inheritance. * * Structural blocks emitted (in order): * 1. Copyright + using directives * 2. Namespace * 3. XML doc comment * 4. Class declaration * 5. ShorthandProperty * 6. Constructor * 7. Properties * 8. #region Load Methods * 9. #region Save Methods * 10. #region Factory Methods (if any) * 11. #region Helpers (if any) */ import { TypeDecl, EnumDef } from "../../ir/declarations.js"; import { ExprVisitor } from "../../ir/visitor.js"; /** * True when a TypeSpec scalar maps to C#'s 32-bit `float` (System.Single). * * Generated test literals must carry an `f` suffix for these and none for * 64-bit fields: `0.9f` widens to 0.8999999761581421 as a double, so an * unsuffixed literal compared against a `float?` — or a suffixed one compared * against a `double?` — fails on precision alone. */ export declare function isCSharpSinglePrecision(scalarType: string): boolean; /** * Emit a complete C# class file for a single TypeDecl. */ export declare function emitCSharpClass(type: TypeDecl, namespace: string, visitor: ExprVisitor, allTypes: TypeDecl[], findType: (name: string) => TypeDecl | undefined): string; /** * Emit a C# enum file for a named string-literal type. * Uses JsonStringEnumConverter for JSON serialization. */ export declare function emitCSharpEnum(enumDef: EnumDef, namespace: string): string; /** Map a protocol type string to a C# type. */ export declare function protocolCSharpType(typeStr: string): string;