Skip to content

Commit

Permalink
added method extractAllToAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
abner committed Feb 10, 2016
1 parent 1a5b2a7 commit 384c385
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 38 deletions.
74 changes: 37 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
*.dll
*.exe
*.cmd
*.pdb
*.suo
*.js
*.user
*.cache
*.cs
*.sln
*.csproj
*.txt
*.map
*.swp
.DS_Store
npm-debug.log

_Resharper.DefinitelyTyped
bin
obj
Properties

# VIM backup files
*~

# test folder
_infrastructure/tests/build

.idea
*.iml
*.js.map
!*.js/

node_modules

.sublimets
.settings/launch.json
*.dll
*.exe
*.cmd
*.pdb
*.suo
*.js
*.user
*.cache
*.cs
*.sln
*.csproj
*.txt
*.map
*.swp
.DS_Store
npm-debug.log

_Resharper.DefinitelyTyped
bin
obj
Properties

# VIM backup files
*~

# test folder
_infrastructure/tests/build

.idea
*.iml
*.js.map
!*.js/

node_modules

.sublimets
.settings/launch.json
3 changes: 3 additions & 0 deletions adm-zip/adm-zip-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/hom
// extracts everything
zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true);

// extracts everything and calls callback -> async extracction
zip.extractAllToAsync(/*target path*/"/home/me/zipcontent/", /*overwrite*/true, (error: Error)=> {});


// creating archives
var zip = new AdmZip();
Expand Down
12 changes: 11 additions & 1 deletion adm-zip/adm-zip.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Type definitions for adm-zip v0.4.4
// Project: https://github.com/cthackers/adm-zip
// Definitions by: John Vilk <https://github.com/jvilk>
// Definitions by: John Vilk <https://github.com/jvilk>, Abner Oliveira <https://github.com/abner>
// Definitions: https://github.com/borisyankov/DefinitelyTyped

/// <reference path="../node/node.d.ts" />
Expand Down Expand Up @@ -211,6 +211,16 @@ declare module "adm-zip" {
* will be overwriten if this is true. Default is FALSE
*/
extractAllTo(targetPath: string, overwrite?: boolean): void;

/**
* Extracts the entire archive to the given location
* @param targetPath Target location
* @param overwrite If the file already exists at the target path, the file
* will be overwriten if this is true. Default is FALSE
* @param callback The callback function will be called afeter extraction
*/
extractAllToAsync(targetPath: string, overwrite: boolean, callback: (error: Error) => void): void;

/**
* Writes the newly created zip file to disk at the specified location or
* if a zip was opened and no ``targetFileName`` is provided, it will
Expand Down

0 comments on commit 384c385

Please sign in to comment.