mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
Add extract-zip types (#13713)
This commit is contained in:
20
extract-zip/extract-zip-tests.ts
Normal file
20
extract-zip/extract-zip-tests.ts
Normal 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
21
extract-zip/index.d.ts
vendored
Normal 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
20
extract-zip/tsconfig.json
Normal 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
1
extract-zip/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user