import { FileTransfer , FileTransferObject } from '@ionic-native/file-transfer' ; export interface FileUploadOptions { /**
     * The name of the form element.
     * Defaults to 'file'.
     */ fileKey ? : string ; /**
     * The file name to use when saving the file on the server.
     * Defaults to 'image.jpg'.
     */ fileName ? : string ; /**
     * The HTTP method to use - either PUT or POST.
     * Defaults to POST.
     */ httpMethod ? : string ; /**
     * The mime type of the data to upload.
     * Defaults to image/jpeg.
     */ mimeType ? : string ; /**
     * A set of optional key/value pairs to pass in the HTTP request.
     */ params ? : { [ s ] : any ; } ; /**
     * Whether to upload the data in chunked streaming mode.
     * Defaults to true.
     */ chunkedMode ? : boolean ; /**
     * A map of header name/header values. Use an array to specify more
     * than one value. On iOS, FireOS, and Android, if a header named
     * Content-Type is present, multipart form data will NOT be used.
     */ headers ? : { [ s ] : any ; } ; } export interface FileUploadResult { /**
     * The number of bytes sent to the server as part of the upload.
     */ bytesSent : number ; /**
     * The HTTP response code returned by the server.
     */ responseCode : number ; /**
     * The HTTP response returned by the server.
     */ response : string ; /**
     * The HTTP response headers by the server.
     */ headers : { [ s ] : any ; } ; } export interface FileTransferError { /**
     * One of the predefined error codes listed below.
     */ code : number ; /**
     * URL to the source.
     */ source : string ; /**
     * URL to the target.
     */ target : string ; /**
     * HTTP status code. This attribute is only available when a response
     * code is received from the HTTP connection.
     */ http_status : number ; /**
     * Response body. This attribute is only available when a response is received from the HTTP connection.
     */ body : string ; /**
     * Either e.getMessage or e.toString.
     */ exception : string ; } export class FileTransferMock extends FileTransfer { enum { number } FileTransferErrorCode : { FILE_NOT_FOUND_ERR : number ; INVALID_URL_ERR : number ; CONNECTION_ERR : number ; ABORT_ERR : number ; NOT_MODIFIED_ERR : number ; } ; return { FileTransferObject } create ( ) { return new FileTransferObjectMock ( ) ; } ; } hidden export class FileTransferObjectMock extends FileTransferObject { constructor ( ) { super ( ) ; } ; param { string } fileUrl param { string } url param { FileUploadOptions } options param { boolean } trustAllHosts returns { Promise < FileUploadResult > } upload ( fileUrl , url , options ? , trustAllHosts ? ) { let response ; return new Promise ( ( resolve , reject ) => { resolve ( response ) ; } ) ; } ; param { string } source param { string } target param { boolean } trustAllHosts param { object } Optional returns { Promise < any > } download ( source , target , trustAllHosts ? , options ? ) { return new Promise ( ( resolve , reject ) => { resolve ( ) ; } ) ; } ; param listener { function } onProgress ( listener ) { } ; /**
     * Aborts an in-progress transfer. The onerror callback is passed a FileTransferError
     * object which has an error code of FileTransferError.ABORT_ERR.
     */ abort ( ) { } ; }