import { DamlLfNodeKind } from "./daml-lf-node-kind.js"; export interface IDamlLfValueReference { readonly packageId: string; readonly moduleName: string; readonly definitionName: string; } export interface IDamlLfExpressionSourceLocation { readonly packageId?: string; readonly moduleName?: string; readonly startLine: number; readonly startColumn: number; readonly endLine: number; readonly endColumn: number; } export interface IDamlLfLambdaExpression { readonly parameters: readonly string[]; readonly body: DamlLfExpression; } export interface IDamlLfApplicationExpression { readonly function: DamlLfExpression; readonly arguments: readonly DamlLfExpression[]; } export interface IDamlLfLetBinding { readonly name: string; readonly value: DamlLfExpression; } export interface IDamlLfLetExpression { readonly bindings: readonly IDamlLfLetBinding[]; readonly body: DamlLfExpression; } export interface IDamlLfRecordFieldExpression { readonly name: string; readonly value: DamlLfExpression; } export interface IDamlLfRecordConstructionExpression { readonly fields: readonly IDamlLfRecordFieldExpression[]; } export interface IDamlLfRecordProjectionExpression { readonly fieldName: string; readonly record: DamlLfExpression; } export interface IDamlLfRecordUpdateExpression { readonly fieldName: string; readonly record: DamlLfExpression; readonly value: DamlLfExpression; } export interface IDamlLfThrowExpression { readonly exception: DamlLfExpression; } export type DamlLfBuiltinConstructor = "unit" | "false" | "true"; export type DamlLfBuiltinFunction = "equal" | "greater" | "appendText" | string; export interface IDamlLfVariantConstructionExpression { readonly constructorName: string; readonly argument: DamlLfExpression; } export interface IDamlLfOptionalConstructionExpression { readonly value?: DamlLfExpression; } export interface IDamlLfEnumConstructionExpression { readonly constructorName: string; } export interface IDamlLfListConstructionExpression { readonly front: readonly DamlLfExpression[]; readonly tail?: DamlLfExpression; } export interface IDamlLfUpdateBinding { readonly name: string; readonly value: DamlLfExpression; } export interface IDamlLfUpdateExpression { readonly kind: "pure" | "block" | "embedExpr" | "tryCatch" | "create" | "createInterface" | "fetch" | "fetchInterface" | "exercise" | "exerciseInterface" | "getTime" | "ledgerTimeLt"; readonly expression?: DamlLfExpression; readonly bindings?: readonly IDamlLfUpdateBinding[]; readonly body?: DamlLfExpression; readonly catchVariableName?: string; readonly catchExpression?: DamlLfExpression; readonly templateId?: { readonly packageId: string; readonly moduleName: string; readonly templateName: string; }; readonly interfaceId?: { readonly packageId: string; readonly moduleName: string; readonly templateName: string; }; readonly choiceName?: string; readonly contractId?: DamlLfExpression; readonly argument?: DamlLfExpression; readonly guardExpression?: DamlLfExpression; } export interface IDamlLfCaseAlternative { readonly patternKind: "default" | "builtinCon" | "variant" | "optionalNone" | "optionalSome" | "enum" | "nil" | "cons"; readonly builtinConstructor?: DamlLfBuiltinConstructor; readonly constructorName?: string; readonly binderName?: string; readonly headBinderName?: string; readonly tailBinderName?: string; readonly body: DamlLfExpression; } export interface IDamlLfCaseExpression { readonly scrutinee: DamlLfExpression; readonly alternatives: readonly IDamlLfCaseAlternative[]; } export declare class DamlLfExpression { readonly nodeKind = DamlLfNodeKind.expression; readonly textLiteral?: string; readonly numericLiteral?: string; readonly int64Literal?: string; readonly valueReference?: IDamlLfValueReference; readonly variableName?: string; readonly lambda?: IDamlLfLambdaExpression; readonly application?: IDamlLfApplicationExpression; readonly letExpression?: IDamlLfLetExpression; readonly recordConstruction?: IDamlLfRecordConstructionExpression; readonly recordProjection?: IDamlLfRecordProjectionExpression; readonly recordUpdate?: IDamlLfRecordUpdateExpression; readonly throwExpression?: IDamlLfThrowExpression; readonly builtinConstructor?: DamlLfBuiltinConstructor; readonly builtinFunction?: DamlLfBuiltinFunction; readonly caseExpression?: IDamlLfCaseExpression; readonly variantConstruction?: IDamlLfVariantConstructionExpression; readonly optionalConstruction?: IDamlLfOptionalConstructionExpression; readonly enumConstruction?: IDamlLfEnumConstructionExpression; readonly listConstruction?: IDamlLfListConstructionExpression; readonly updateExpression?: IDamlLfUpdateExpression; readonly unsupportedNodeKind?: string; readonly sourceLocation?: IDamlLfExpressionSourceLocation; constructor(init: { textLiteral?: string; numericLiteral?: string; int64Literal?: string; valueReference?: IDamlLfValueReference; variableName?: string; lambda?: IDamlLfLambdaExpression; application?: IDamlLfApplicationExpression; letExpression?: IDamlLfLetExpression; recordConstruction?: IDamlLfRecordConstructionExpression; recordProjection?: IDamlLfRecordProjectionExpression; recordUpdate?: IDamlLfRecordUpdateExpression; throwExpression?: IDamlLfThrowExpression; builtinConstructor?: DamlLfBuiltinConstructor; builtinFunction?: DamlLfBuiltinFunction; caseExpression?: IDamlLfCaseExpression; variantConstruction?: IDamlLfVariantConstructionExpression; optionalConstruction?: IDamlLfOptionalConstructionExpression; enumConstruction?: IDamlLfEnumConstructionExpression; listConstruction?: IDamlLfListConstructionExpression; updateExpression?: IDamlLfUpdateExpression; unsupportedNodeKind?: string; sourceLocation?: IDamlLfExpressionSourceLocation; }); withSourceLocation(sourceLocation: IDamlLfExpressionSourceLocation | undefined): DamlLfExpression; }