File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
src/@awesome-cordova-plugins/plugins/zip Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ import { AwesomeCordovaNativePlugin , Cordova , Plugin } from '@awesome-cordova-plugins/core' ;
2+
3+ import { Injectable } from '@angular/core' ;
4+
5+ /**
6+ * @name Zip
7+ * @description
8+ * A Cordova plugin to unzip files in Android and iOS.
9+ * @usage
10+ * ```typescript
11+ * import { Zip } from '@awesome-cordova-plugins/zip/nx'
12+ * ...
13+ *
14+ * const result = await Zip.unzip('path/to/source.zip', 'path/to/dest', (progress) =>
15+ * console.log('Unzipping, ' + Math.round((progress.loaded / progress.total) * 100) + '%')
16+ * );
17+ *
18+ * if(result === 0) console.log('SUCCESS');
19+ * if(result === -1) console.log('FAILED');
20+ *
21+ * ```
22+ */
23+ @Plugin ( {
24+ pluginName : 'Zip' ,
25+ plugin : 'cordova-plugin-zip' ,
26+ pluginRef : 'zip' ,
27+ repo : 'https://github.com/MobileChromeApps/cordova-plugin-zip' ,
28+ platforms : [ 'Android' , 'iOS' ] ,
29+ } )
30+ @Injectable ( )
31+ export class Zip extends AwesomeCordovaNativePlugin {
32+ /**
33+ * Extracts files from a ZIP archive
34+ * @param {string } sourceZip Source ZIP file
35+ * @param {string } destFolder Destination folder
36+ * @param {Function } onProgress optional callback to be called on progress update
37+ * @returns {Promise<number> } returns a promise that resolves with a number. 0 is success, -1 is error
38+ */
39+ @Cordova ( )
40+ unzip ( sourceZip : string , destFolder : string , onProgress ?: Function ) : Promise < number > {
41+ return ;
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments