diff --git a/types/7zip-min/7zip-min-tests.ts b/types/7zip-min/7zip-min-tests.ts new file mode 100644 index 0000000000..717f9bde0f --- /dev/null +++ b/types/7zip-min/7zip-min-tests.ts @@ -0,0 +1,5 @@ +import _7z = require('7zip-min'); + +_7z.pack("index.d.ts", "archive.7z", (err: any) => { }); +_7z.unpack("archive.7z", "./", (err: any) => { }); +_7z.list("archive.7z", (err: any, result: _7z.Result[]) => { }); diff --git a/types/7zip-min/index.d.ts b/types/7zip-min/index.d.ts new file mode 100644 index 0000000000..4500ccff3d --- /dev/null +++ b/types/7zip-min/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for 7zip-min 1.1 +// Project: https://github.com/onikienko/7zip-min +// Definitions by: Tanandara +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.6 + +export function unpack(pathToArchive: string, whereToUnpack: string, errorCallback: (err: any) => void): void; +export function pack(pathToDirOrFile: string, pathToArchive: string, errorCallback: (err: any) => void): void; +export function list(pathToArchive: string, callback: (err: any, result: Result[]) => void): void; +export function cmd(command: string[], errorCallback: (err: any) => void): void; +export interface Result { + name: string; + date: string; + time: string; + attr: string; + size: string; + compressed: string; +} diff --git a/types/7zip-min/tsconfig.json b/types/7zip-min/tsconfig.json new file mode 100644 index 0000000000..2bf809b380 --- /dev/null +++ b/types/7zip-min/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "7zip-min-tests.ts" + ] +} \ No newline at end of file diff --git a/types/7zip-min/tslint.json b/types/7zip-min/tslint.json new file mode 100644 index 0000000000..e60c15844f --- /dev/null +++ b/types/7zip-min/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} \ No newline at end of file