import { Subject } from 'rxjs'; import { FileManagerInterface } from '../interfaces/file-manager.interface'; /** * Abstract proctol class if someone want to write his own protocol */ export declare abstract class Protocol { progress: Subject; load: Subject; error: Subject; abort: Subject; set connection(obj: any); private _connections; /** * Creates an instance of Protocol and for each protocol an own unique ID. * * @memberOf Protocol */ constructor(); /** * Call uploader method _onCompleteFile. * * @memberOf Protocol */ _onLoad(_file: FileManagerInterface, response: any, status: number, headers: any): void; /** * Call uploader methodes _onErrorFile and _onCompleteFile. * * @memberOf Protocol */ _onError(_file: FileManagerInterface, response: any, status: number, headers: any): void; /** * Call uploader methodes _onErrorFile and _onCompleteFile. * * @memberOf Protocol */ _onAbort(_file: FileManagerInterface, response: any, status: number, headers: any): void; /** * Validate response status code.+ * * @memberOf Protocol */ _isSuccessCode(status: number): boolean; isConnected(_file: FileManagerInterface): any; removeConnection(_file: FileManagerInterface): void; /** * Must be implemented at each protocol class. * * @memberOf Protocol */ abstract run(_file: FileManagerInterface): any; abstract cancel(_file: FileManagerInterface): void; } /** * Standard protocol for server communication (file uploading) * * @export * @extends {Protocol} */ export declare class ProtocolXHR extends Protocol { constructor(); /** * Implementation of the abstract.protocol method `run` * * @memberOf ProtocolXHR */ run(_file: FileManagerInterface): void; cancel(_file: FileManagerInterface): void; }