import { AnalyzedTemplate } from "../analysis/analyzed-template.js"; import { GeneratedNamedTypeFile } from "../emission-model/generated-named-type-file.js"; import { GeneratedTemplateBindingFile } from "../emission-model/generated-template-binding-file.js"; import { TypeScriptNameResolver } from "./type-script-name-resolver.js"; import { type DamlModuleImportStyle } from "./daml-module-import-style.js"; /** Emits typed contract and exercise-event bindings for analyzed DAML templates. */ export declare class TemplateBindingEmitter { private readonly nameResolver; private packageMetadata?; constructor(nameResolver?: TypeScriptNameResolver); /** Supplies per-package metadata so emitted identity checks can match by package NAME across upgrades. */ providePackageMetadata(metadata: ReadonlyMap): void; /** Prepares stable collision-safe names before emitting a complete project. */ prepareTemplatesOrThrow(templates: readonly AnalyzedTemplate[]): void; /** Emits a generated TypeScript file for one analyzed DAML template. */ emitTemplateFile(template: AnalyzedTemplate, namedTypeFiles?: readonly GeneratedNamedTypeFile[], moduleImportStyle?: DamlModuleImportStyle): GeneratedTemplateBindingFile; /** Emits binding metadata without source, for resolving named declaration exports first. */ emitTemplateBindingFile(template: AnalyzedTemplate): GeneratedTemplateBindingFile; private createBinding; private emitContents; private emitImports; private emitTemplateClass; private emitChoiceEventClass; /** * Emits the identity guard for materialization. Module and entity must match exactly; the package is * matched by NAME when the event provides one — never by exact package id, because smart contract * upgrades give every version its own id while contracts from any version stay materializable. */ private emitAssertTemplateIdentity; private emitTemplateDescriptor; private emitDescriptor; private getTypeName; private getArrayElementTypeName; private getPrimitiveTypeName; private resolveRuntimeWrapperTypeNames; private getSdkName; private emitImportedName; private normalizeType; private resolveNamedReferences; private walkNamedReferences; private getNamedReference; private getNamedReferenceKey; private toTypeName; private shortHash; /** * The emitted identity literal NEVER contains a package id when the package name is known: package ids * are version-specific under smart contract upgrades, while packageName:module:entity is stable. The * id-based form remains only for metadata-less invocations (tests driving the emitter directly). */ private templateIdLiteral; private moduleName; private entityName; private relativeFilePath; }