Add extract-zip types (#13713)

This commit is contained in:
Mizunashi Mana
2017-01-04 05:17:41 +09:00
committed by Andy
parent 18e96e67d7
commit 5f1f3ebb00
4 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import * as extract from 'extract-zip';
let str = 'str';
let num = 0;
let options: extract.Options = {
dir: str,
};
options = {
dir: str,
defaultFileMode: num,
};
extract(str, options, (err) => {
if (err) {
console.error(err);
return;
}
console.log('done');
});

21
extract-zip/index.d.ts vendored Normal file
View File

@@ -0,0 +1,21 @@
// Type definitions for extract-zip 1.6
// Project: https://github.com/maxogden/extract-zip
// Definitions by: Mizunashi Mana <https://github.com/mizunashi-mana>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace extract {
export interface Options {
dir?: string;
defaultDirMode?: number;
defaultFileMode?: number;
onEntry?: (entry: any, zipfile: any) => void;
}
}
declare function extract(
zipPath: string,
opts: extract.Options,
cb: (err?: Error) => void,
): void;
export = extract;

20
extract-zip/tsconfig.json Normal file
View File

@@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"extract-zip-tests.ts"
]
}

1
extract-zip/tslint.json Normal file
View File

@@ -0,0 +1 @@
{ "extends": "../tslint.json" }