added 7zip-min (#38693)

This commit is contained in:
Tanandara 2019-10-03 03:58:59 +07:00 committed by Ryan Cavanaugh
parent b11417df1c
commit cda261b922
4 changed files with 49 additions and 0 deletions

View File

@ -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[]) => { });

18
types/7zip-min/index.d.ts vendored Normal file
View File

@ -0,0 +1,18 @@
// Type definitions for 7zip-min 1.1
// Project: https://github.com/onikienko/7zip-min
// Definitions by: Tanandara <https://github.com/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;
}

View File

@ -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"
]
}

View File

@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}