//#region src/modules/electronic-signature/types.d.ts type ElectronicSignatureVariant = 'ae' | 'qe'; type ElectronicSignatureConfig = { variant?: ElectronicSignatureVariant; uploadDocument?: boolean; downloadDocument?: boolean; }; type ElectronicSignatureDocument = { documentRef: string; documentUrl: string; }; type SignedDocument = { /** * Whether the signing endpoint acknowledged this document as signed. Set from * either the AES signed-PDF URL or the QES `{ success: true }` acknowledgment. */ signed: boolean; /** * URL of the signed PDF when the endpoint returns one (AES `/process/sign`). * QES `/process/signQes` returns only `{ success: true }` with no document * URL, so this is absent for the QE variant. */ signedDocumentUrl?: string; }; declare const AE_CONSENT_KEYS: readonly ["terms", "signElectronically", "signDisplayed"]; declare const QE_CONSENT_KEYS: readonly ["issuance", "qesAcknowledgement", "qscdConfirmation", "termsAgreement", "documentsReviewed"]; type AeConsentKey = (typeof AE_CONSENT_KEYS)[number]; type QeConsentKey = (typeof QE_CONSENT_KEYS)[number]; type ConsentKey = AeConsentKey | QeConsentKey; type ConsentChecks = Partial>; declare function getConsentKeys(variant: ElectronicSignatureVariant): readonly ConsentKey[]; declare function getDefaultConsentChecks(variant: ElectronicSignatureVariant): ConsentChecks; declare function areAllConsented(checks: ConsentChecks): boolean; type UnsignedDocsResponse = { documents: ElectronicSignatureDocument[]; }; type ElectronicSignatureErrorSource = 'upload' | 'fetchDocs' | 'signing'; /** * Mutable in-memory holder for the document selected for upload. * * The actor and manager must share this exact object so `selectFile()` updates * the bytes later consumed by the machine's upload actor. */ type ElectronicSignatureFileDataHolder = { current: ArrayBuffer | null; }; type ElectronicSignatureContext = { config: ElectronicSignatureConfig; fileDataHolder: ElectronicSignatureFileDataHolder; documents: ElectronicSignatureDocument[]; signedDocuments: SignedDocument[]; fileName: string | null; fileSize: number | null; fileUrl: string | null; /** * Upload destination for the single document this session may hold. * Generated exactly once (`POST /generateDocumentUploadUrl` creates a * server-side document) and reused across upload retries so a session can * never accumulate more than one document — see the AES "two documents" * bug where a retry created a second, unremovable document. */ preSignedUrl: string | null; consentChecks: ConsentChecks; viewingDocumentUrl: string | null; errorMessage: string; errorSource: ElectronicSignatureErrorSource | null; }; type ElectronicSignatureInput = { config: ElectronicSignatureConfig; fileDataHolder: ElectronicSignatureFileDataHolder; getFileData?: never; } | { config: ElectronicSignatureConfig; /** * @deprecated Pass `fileDataHolder` so actor and manager ownership is * explicit. Retained for existing direct machine integrations. */ getFileData: () => ArrayBuffer | null; fileDataHolder?: never; }; //#endregion export { getDefaultConsentChecks as _, ElectronicSignatureConfig as a, ElectronicSignatureFileDataHolder as c, QE_CONSENT_KEYS as d, QeConsentKey as f, getConsentKeys as g, areAllConsented as h, ConsentKey as i, ElectronicSignatureInput as l, UnsignedDocsResponse as m, AeConsentKey as n, ElectronicSignatureContext as o, SignedDocument as p, ConsentChecks as r, ElectronicSignatureDocument as s, AE_CONSENT_KEYS as t, ElectronicSignatureVariant as u };