export declare const LANGUAGES: readonly ["es", "en", "pt", "fr"]; export declare type Languages = typeof LANGUAGES[number]; export declare type SDKs = 'upload' | 'upload-v2' | 'read' | 'attachments' | 'validation-attachments' | 'validation' | 'sign' | 'list-validation' | 'fill'; export declare type EnvType = 'DEV' | 'STAGE' | 'PROD'; export declare type SDKTypeObjectKeys = { [x in SDKs]: string; }; export declare type SDKEvents = { onSDKReady: () => void; onSDKBack?: () => void; onSDKClose: (documentId?: string, redirectTo?: string) => void; onSDKFinish?: () => void; onSDKToken?: () => Promise; onSDKPay?: (data: { code: string; epaycoKey: string; validation?: boolean; packageId?: string; }) => void; onSDKNotification?: ({ message, options, }: { message: string; options: NotificationOptions; }) => void; }; interface BaseConfig { keyPublic?: string; keyPrivate?: string; country?: string; iframeId: string; language: Languages; events: SDKEvents; customOrigin?: string; env: EnvType; } interface userAttributes { name?: string; email?: string; phone?: string; identification?: string; identificationType?: string; country?: string; } interface BaseParticipantAttributes extends userAttributes { type: 'signer' | 'approver' | 'reader'; id: string; locked?: boolean; } interface SignerAttributes extends BaseParticipantAttributes { type: 'signer' | 'approver'; otpCode?: boolean; camera?: boolean; video?: boolean; disableAutoSign?: boolean; options?: { camera?: string; whatsapp?: boolean; flow?: boolean; }; } interface ReaderAttributes extends Pick { type: 'reader'; } interface IFullFlowData { type: 'complete'; participants: (SignerAttributes | ReaderAttributes)[]; files: File[]; platform: 'whatsapp' | 'auco'; validations: { otpCode?: 'phone' | 'email'; selfie: boolean; identification: boolean; identificationCardBack: boolean; flow: boolean; }; emailData: { name: string; message: string; subject: string; expire?: Date; remember?: '3' | '6' | '12' | '24' | '48'; notificationOff?: boolean; }; } interface IEditFlowData { type: 'edit'; code: string; keepPositions?: boolean; participants?: (SignerAttributes | ReaderAttributes)[]; files?: File[]; platform?: 'whatsapp' | 'auco'; validations?: { otpCode?: 'phone' | 'email'; selfie: boolean; identification: boolean; identificationCardBack: boolean; flow: boolean; }; emailData?: { name: string; message: string; subject: string; expire?: Date; remember?: '3' | '6' | '12' | '24' | '48'; notificationOff?: boolean; }; } interface IFlowDataOnlyParticipants { type: 'participants'; participants: (SignerAttributes | ReaderAttributes)[]; } export interface SDKUploadData { userAttributes?: userAttributes; users?: (SignerAttributes | ReaderAttributes)[]; flowData?: IFullFlowData | IFlowDataOnlyParticipants | IEditFlowData; custom?: Record; uxOptions: { primaryColor: string; alternateColor: string; redirectUrl?: string; hoverColor?: string; icons?: { gradient: string[]; }; }; } interface SDKUpload extends Omit { /** * Create an upload flow with signers and approvers */ sdkType: 'upload'; sdkData: SDKUploadData; events: Omit & { onSDKClose: (documentId?: string, redirectTo?: string, signProfile?: Array<{ id: string; name: string; email: string; phone: string; }>) => void; }; } interface SDKUploadV2 extends Omit { sdkType: 'upload-v2'; sdkData: Omit; events: Omit & { onSDKClose: (documentId?: string, redirectTo?: string, signProfile?: Array<{ id: string; name: string; email: string; phone: string; }>) => void; }; } interface SDKAttachments extends Omit { /** * Create an attachment flow with signers. You could not add approvers. * In this flow there is only one approver, that is the person who creates it. */ sdkType: 'attachments'; sdkData: SDKUploadData; events: SDKEvents; } interface SDKRead extends Omit { /** * Create an read flow with readers or generate a read link. */ sdkType: 'read'; sdkData: SDKUploadData; events: SDKEvents; } interface SDKValidationAttachments extends Omit { /** * Create an attachment flow with validation in restrictive list. You could not add approvers. */ sdkType: 'validation-attachments'; sdkData: SDKUploadData; events: SDKEvents; } interface SDKSign extends BaseConfig { /** * Sign flow, use this flow to let your users sign your documents */ sdkType: 'sign'; sdkData: { /** * Document Id , also known as code */ document: string; image?: string; name?: string; uxOptions: { primaryColor: string; alternateColor: string; redirectUrl?: string; hoverColor?: string; icons?: { gradient: string[]; }; }; signFlow?: 'document' | 'approve' | 'package' | 'read'; /** * Remove "Your invitation" badge when user has multiple pending documents * assumes user didn't open a specific document, and is opening the sign flow from a list of pending documents */ isFromDashboard?: boolean; /** * email is needed on read functionality when user is logged in */ email?: string; }; } interface SDKValidation extends Omit { /** * Create a validation flow, Your customer validate his face against his * ID Photo and you receive a response with the similarity between those two photos */ sdkType: 'validation'; events: Omit & { onSDKClose: (similarity?: number, status?: string) => void; }; sdkData: { /** * code from /validate API response */ document: string; uxOptions: { primaryColor: string; alternateColor: string; redirectUrl?: string; hoverColor?: string; icons?: { gradient: string[]; }; }; }; } interface SDKListValidation extends Omit { sdkType: 'list-validation'; sdkData: Omit & { showPrices: boolean; }; events: Required; } interface SDKFill extends BaseConfig { sdkType: 'fill'; sdkData: { /** * template Id */ document: string; /** * code if is editing template or finishing prebuild */ code?: string; /** * prebuild if it's first prebuild phase */ preBuild?: boolean; /** * reference if is filling a reusedocument */ reference?: string; uxOptions: { primaryColor: string; alternateColor: string; redirectUrl?: string; hoverColor?: string; icons?: { gradient: string[]; }; }; }; } export declare type Config = SDKUpload | SDKUploadV2 | SDKRead | SDKAttachments | SDKValidationAttachments | SDKSign | SDKValidation | SDKListValidation | SDKFill; export declare type TAucoSDK = (params: Config) => () => void; export {};