mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-09-21 16:40:26 +00:00
Add extract-zip types (#13713)
This commit is contained in:
@@ -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');
|
||||
});
|
||||
Vendored
+21
@@ -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;
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user