import type { IrType } from "@tsonic/frontend"; import { EmitterContext } from "../../types.js"; export type AllocatedLocalName = { readonly originalName: string; readonly emittedName: string; readonly context: EmitterContext; }; export declare const reserveLocalName: (emittedName: string, context: EmitterContext) => EmitterContext; /** * Allocate a unique C# local identifier for a TypeScript local name. * * This is intentionally global-within-method (not just lexical-scope) to avoid C# CS0136: * - TS allows: { const x = ... } const x = ... * - C# forbids declaring `x` in the outer scope after it appeared in a nested scope. * * We keep TS lexical scoping via `localNameMap`, but reserve emitted names via `usedLocalNames`. */ export declare const allocateLocalName: (originalName: string, context: EmitterContext) => AllocatedLocalName; export declare const registerLocalName: (originalName: string, emittedName: string, context: EmitterContext) => EmitterContext; /** * Register both semantic and storage types for a local symbol. * * Semantic type preserves alias identity, union structure, and type-parameter * shapes exactly as authored in the frontend IR. Storage type is the * CLR-normalized carrier used for C# declarations and runtime dispatch. */ export declare const registerLocalSymbolTypes: (originalName: string, semanticType: IrType | undefined, storageType: IrType | undefined, context: EmitterContext) => EmitterContext; /** * Register the same type as both semantic and storage for a local symbol. * * Used for cases where the authored type and CLR storage type are identical * (e.g., for-in keys are always `string` in both channels). */ export declare const registerLocalFixedType: (originalName: string, type: IrType, context: EmitterContext) => EmitterContext; /** * Register a local symbol from its semantic (frontend IR) type. * * Storage type is derived automatically via normalizeRuntimeStorageType. * Falls back to the semantic type itself when normalization returns undefined. * * Use this for parameters and pattern bindings where the authored type is * the single source of truth and storage is purely derived. */ export declare const registerLocalSemanticType: (originalName: string, semanticType: IrType | undefined, context: EmitterContext) => EmitterContext; /** * Emit a local/parameter identifier using lexical remaps (CS0136 shadowing avoidance). * * This intentionally does not consult import bindings or valueSymbols: it is only for * identifiers that are known to refer to locals/parameters in the current scope. */ export declare const emitRemappedLocalName: (originalName: string, context: EmitterContext) => string; //# sourceMappingURL=local-names.d.ts.map