feat(zip): add callback param so the progress function can be calleds (#4519)

This commit is contained in:
Felix Salazar 2023-07-11 19:24:50 +02:00 committed by GitHub
parent bb1164f4fc
commit f9110cb429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,11 +33,12 @@ export class Zip extends AwesomeCordovaNativePlugin {
* Extracts files from a ZIP archive
* @param {string} sourceZip Source ZIP file
* @param {string} destFolder Destination folder
* @param {Function} onSuccess callback to be called on when done
* @param {Function} onProgress optional callback to be called on progress update
* @returns {Promise<number>} returns a promise that resolves with a number. 0 is success, -1 is error
*/
@Cordova()
unzip(sourceZip: string, destFolder: string, onProgress?: Function): Promise<number> {
unzip(sourceZip: string, destFolder: string, onSuccess: Function, onProgress?: Function): Promise<number> {
return;
}
}