/** * Parameter emission for functions and methods * * Handles both simple identifier patterns and destructuring patterns. * For destructuring patterns, generates synthetic parameter names (__param0, etc.) * and returns lowering info for the caller to inject destructuring statements. */ import { IrParameter, IrType } from "@tsonic/frontend"; import { EmitterContext } from "../../types.js"; import type { CSharpExpressionAst, CSharpParameterAst, CSharpStatementAst } from "../../core/format/backend-ast/types.js"; import { RuntimeParameterDefaultInfo } from "../parameter-defaults.js"; /** * Info about a parameter that needs destructuring in the function body */ type ParameterDestructuringInfo = { readonly syntheticName: string; readonly pattern: IrParameter["pattern"]; readonly type: IrType | undefined; }; /** * Result of parameter emission */ export type ParameterEmissionResult = { /** The C# parameter ASTs */ readonly parameters: readonly CSharpParameterAst[]; /** Parameters that need destructuring in the function body */ readonly destructuringParams: readonly ParameterDestructuringInfo[]; /** Runtime defaults that must be applied in the body instead of the signature */ readonly runtimeDefaultInitializers: readonly RuntimeParameterDefaultInfo[]; /** Wrapper arities needed when omitted suffixes cannot be expressed in C# signatures */ readonly wrapperPrefixLengths: readonly number[]; /** Synthesized default arguments for suppressed parameters */ readonly suppressedDefaultArguments: readonly (CSharpExpressionAst | undefined)[]; /** Updated context */ readonly context: EmitterContext; }; export declare const applyRuntimeParameterDefaultShadows: (runtimeDefaults: readonly RuntimeParameterDefaultInfo[], context: EmitterContext) => [readonly CSharpStatementAst[], EmitterContext]; /** * Emit parameters for functions and methods as CSharpParameterAst[]. * * For simple identifier patterns, emits directly as C# parameters. * For complex patterns (array/object), generates synthetic parameter names * and returns info for destructuring in the function body. */ export declare const emitParameters: (parameters: readonly IrParameter[], context: EmitterContext) => [readonly CSharpParameterAst[], EmitterContext]; /** * Emit parameters with full destructuring support * * Returns both the parameter ASTs and info about parameters that need * destructuring statements in the function body. */ export declare const emitParametersWithDestructuring: (parameters: readonly IrParameter[], context: EmitterContext) => ParameterEmissionResult; /** * Generate destructuring statements as AST nodes. */ export declare const generateParameterDestructuringAst: (destructuringParams: readonly ParameterDestructuringInfo[], context: EmitterContext) => [readonly CSharpStatementAst[], EmitterContext]; export {}; //# sourceMappingURL=parameters.d.ts.map