/** * Local variable type AST resolution. * * Determines the C# type AST for local variable declarations, * handling asinterface, explicit annotations, nullish initializers, * nullable value unions, function expressions, and stackalloc. */ import { IrExpression, IrParameter, IrType, IrBlockStatement } from "@tsonic/frontend"; import { EmitterContext } from "../../types.js"; import type { CSharpTypeAst } from "../../core/format/backend-ast/types.js"; /** * Determine the C# type AST for a local variable declaration. * * Priority: * 1) asinterface initializer - use target type * 2) Explicit/inferred IR type (if C#-emittable) * 3) Nullish initializer with annotation - use explicit type * 4) Nullish initializer without annotation - use inferred or object? * 5) Types needing explicit declaration (byte, sbyte, short, ushort) * 6) stackalloc - target-typed to produce Span * 7) var */ export declare const resolveLocalTypeAst: (decl: { readonly type?: IrType; readonly initializer?: { readonly kind: string; readonly value?: unknown; readonly name?: string; readonly targetType?: IrType; readonly inferredType?: IrType; readonly parameters?: readonly IrParameter[]; readonly returnType?: IrType; readonly body?: IrBlockStatement | IrExpression; }; }, context: EmitterContext) => [CSharpTypeAst, EmitterContext]; //# sourceMappingURL=variable-local-type.d.ts.map