mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-05-02 00:07:23 +08:00
chore(package): bump deps
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Plugin, CordovaInstance, IonicNativePlugin, } from '@ionic-native/core';
|
||||
import { Plugin, CordovaInstance, IonicNativePlugin } from '@ionic-native/core';
|
||||
|
||||
declare const window: any;
|
||||
|
||||
@@ -7,34 +7,34 @@ export enum UploadState {
|
||||
UPLOADED = 'UPLOADED',
|
||||
FAILED = 'FAILED',
|
||||
UPLOADING = 'UPLOADING',
|
||||
INITIALIZED = 'INITIALIZED'
|
||||
INITIALIZED = 'INITIALIZED',
|
||||
}
|
||||
|
||||
export type UploadStateType = keyof typeof UploadState;
|
||||
|
||||
export interface UploadEvent{
|
||||
id?: string, // id of the upload
|
||||
state?: UploadStateType, // state of the upload (either UPLOADING, UPLOADED or FAILED)
|
||||
statusCode?: number, // response code returned by server after upload is completed
|
||||
serverResponse?: any, // server response received after upload is completed
|
||||
error?: any, // error message in case of failure
|
||||
errorCode?: number, // error code for any exception encountered
|
||||
progress?: any, // progress for ongoing upload
|
||||
eventId?: string // id of the event
|
||||
export interface UploadEvent {
|
||||
id?: string; // id of the upload
|
||||
state?: UploadStateType; // state of the upload (either UPLOADING, UPLOADED or FAILED)
|
||||
statusCode?: number; // response code returned by server after upload is completed
|
||||
serverResponse?: any; // server response received after upload is completed
|
||||
error?: any; // error message in case of failure
|
||||
errorCode?: number; // error code for any exception encountered
|
||||
progress?: any; // progress for ongoing upload
|
||||
eventId?: string; // id of the event
|
||||
}
|
||||
|
||||
export interface FTMPayloadOptions {
|
||||
id: string,
|
||||
filePath: string,
|
||||
fileKey?: string,
|
||||
serverUrl: string,
|
||||
notificationTitle?: string,
|
||||
id: string;
|
||||
filePath: string;
|
||||
fileKey?: string;
|
||||
serverUrl: string;
|
||||
notificationTitle?: string;
|
||||
headers?: {
|
||||
[name: string]: string
|
||||
},
|
||||
[name: string]: string;
|
||||
};
|
||||
parameters?: {
|
||||
[name: string]: string
|
||||
}
|
||||
[name: string]: string;
|
||||
};
|
||||
[prop: string]: any;
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ export interface FTMOptions {
|
||||
callBack: (event: UploadEvent) => any;
|
||||
config?: {
|
||||
parallelUploadsLimit?: number;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export class FileTransferManager {
|
||||
private _objectInstance: any;
|
||||
|
||||
constructor(options: FTMOptions ) {
|
||||
constructor(options: FTMOptions) {
|
||||
this._objectInstance = window.FileTransferManager.init(options.config, options.callBack);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,6 @@ export class FileTransferManager {
|
||||
destroy(): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,6 +107,6 @@ export class BackgroundUpload extends IonicNativePlugin {
|
||||
FileTransferManager = FileTransferManager;
|
||||
|
||||
init(options: FTMOptions): FileTransferManager {
|
||||
return new FileTransferManager(options)
|
||||
return new FileTransferManager(options);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user