import ILovePDFTool from '../types/ILovePDFTool'; import Auth from '../auth/Auth'; import XHRInterface from '../utils/XHRInterface'; import BaseFile from './BaseFile'; import TaskI, { AddFileParams } from './TaskI'; export type TaskParams = { id?: string; server?: string; files?: Array; }; export default abstract class Task implements TaskI { abstract type: ILovePDFTool; protected server: string; protected files: Array; protected auth: Auth; protected xhr: XHRInterface; private _id; private _remainingFiles; get id(): string; get remainingFiles(): number | undefined; /** * * @param publicKey - API public key. * @param secretKey - API private key. * @param makeStart - If true, start is called on instantiate a Task. */ constructor(auth: Auth, xhr: XHRInterface, params?: TaskParams); /** * @inheritdoc */ start(): Promise; /** * @inheritdoc */ addFile(file: BaseFile | string, params?: AddFileParams): Promise; private uploadFromUrl; private getBasename; private uploadFromFile; /** * @inheritdoc */ deleteFile(file: BaseFile): Promise; /** * @inheritdoc */ abstract process(params?: Object): Promise; protected getFilesBodyFormat(): ProcessFilesBody; /** * @inheritdoc */ download(): Promise; /** * @inheritdoc */ delete(): Promise; /** * @inheritdoc */ connect(nextTool: ILovePDFTool): Promise; } type ProcessFilesBody = Array<{ server_filename: string; filename: string; rotate?: number; password?: string; }>; export {};