import ILovePDFTool from "@brunomartins24/ilovepdf-js-core/types/ILovePDFTool"; import TaskI from "@brunomartins24/ilovepdf-js-core/tasks/TaskI"; import { GetSignatureStatus, GetReceiverInfoResponse } from "@brunomartins24/ilovepdf-js-core/ILovePDFCoreApi"; import { TaskParams } from "@brunomartins24/ilovepdf-js-core/tasks/Task"; export interface ILovePDFApiI { /** * Creates a new task for a specific tool. * @param taskType - Task to run. */ newTask: (taskType: ILovePDFTool, params: TaskParams) => TaskI; /** * Returns a task lists from ILovePDF servers ordered from newest to older. */ listTasks: (params?: ListTasksParams) => Promise>; /** * Returns the signature identified by `signatureToken`. * @param signatureToken token_requester property from a created signature. * @returns Signature. */ getSignatureStatus: (signatureToken: string) => Promise; /** * Returns a list of the created signatures. * A pagination system is used to limit the response length. * @param page * @param pageLimit Limit of objects per page. * @returns List of signatures. */ getSignatureList: (page: number, pageLimit: number) => Promise>; /** * Voids a non-completed signature. * @param signatureToken token_requester property from a created signature. */ voidSignature: (signatureToken: string) => Promise; /** * Increases the expiration days limit from a signature. * @param signatureToken token_requester property from a created signature. * @param daysAmount Days to increase. */ increaseSignatureExpirationDays: (signatureToken: string, daysAmount: number) => Promise; /** * Sends reminders to all the receivers to sign, validate or witness a document. * @param signatureToken token_requester property from a created signature. */ sendReminders: (signatureToken: string) => Promise; /** * Returns a PDF or ZIP file with the original files, uploaded * at the beginning of the signature creation. * @param signatureToken token_requester property from a created signature. * @returns PDF or ZIP file with the original files. */ downloadOriginalFiles: (signatureToken: string) => Promise; /** * Returns a PDF or ZIP file with the signed files. * @param signatureToken token_requester property from a created signature. * @returns PDF or ZIP file with the signed files. */ downloadSignedFiles: (signatureToken: string) => Promise; /** * Returns a PDF or ZIP file with the audit files that inform about * files legitimity. * @param signatureToken token_requester property from a created signature. * @returns PDF or ZIP file with the audit files. */ downloadAuditFiles: (signatureToken: string) => Promise; /** * Returns a receiver information related to a specific sign process. * @param receiverTokenRequester token_requester from a receiver. * @returns Receiver information. */ getReceiverInfo: (receiverTokenRequester: string) => Promise; /** * Fixes a receiver's email. * @param receiverTokenRequester token_requester from a receiver. * @param email New email. */ fixReceiverEmail: (receiverTokenRequester: string, email: string) => Promise; /** * Fixes a receiver's phone. * @param receiverTokenRequester token_requester from a receiver. * @param phone New phone. */ fixReceiverPhone: (receiverTokenRequester: string, phone: string) => Promise; } export type ILovePDFApiParams = { file_encryption_key?: string; }; export default class ILovePDFApi implements ILovePDFApiI { private auth; private xhr; private taskFactory; constructor(publicKey: string, secretKey: string, params?: ILovePDFApiParams); /** * @inheritdoc */ newTask(taskType: ILovePDFTool, params?: TaskParams): TaskI; /** * @inheritdoc */ listTasks(params?: ListTasksParams): Promise; /** * @inheritdoc */ getSignatureStatus(signatureToken: string): Promise; /** * @inheritdoc */ getSignatureList(page?: number, pageLimit?: number): Promise>; /** * @inheritdoc */ voidSignature(signatureToken: string): Promise; /** * @inheritdoc */ increaseSignatureExpirationDays(signatureToken: string, daysAmount: number): Promise; /** * @inheritdoc */ sendReminders(signatureToken: string): Promise; /** * @inheritdoc */ downloadOriginalFiles(signatureToken: string): Promise; /** * @inheritdoc */ downloadSignedFiles(signatureToken: string): Promise; /** * @inheritdoc */ downloadAuditFiles(signatureToken: string): Promise; /** * @inheritdoc */ getReceiverInfo(receiverTokenRequester: string): Promise; /** * @inheritdoc */ fixReceiverEmail(receiverTokenRequester: string, email: string): Promise; /** * @inheritdoc */ fixReceiverPhone(receiverTokenRequester: string, phone: string): Promise; } type ListTasksParams = { page?: number; tool?: string; status?: string; custom_int?: number; }; export {};