-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add types definition
index.d.ts
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export interface ListItem { | ||
name: string; // name of file/dir (path | ||
size: string; // size | ||
compressed: string; // packed size | ||
date: string; // modified date | ||
time: string; // modified time | ||
attr: string; // attributes | ||
crc: string; // CRC | ||
encrypted: string; // encrypted | ||
method: string; // compression method | ||
block: string; // block | ||
} | ||
|
||
export type CallbackFn = (err: Error | null, output?: string) => void; | ||
export type ListCallbackFn = (err: Error | null, listItems?: ListItem[]) => void; | ||
|
||
export function unpack(pathToPack: string, destPath?: string): Promise<string>; | ||
export function unpack(pathToPack: string, cb: CallbackFn): void; | ||
export function unpack(pathToPack: string, destPath: string, cb: CallbackFn): void; | ||
|
||
export function pack(pathToSrc: string, pathToDest: string): Promise<string>; | ||
export function pack(pathToSrc: string, pathToDest: string, cb: CallbackFn): void; | ||
|
||
export function list(pathToSrc: string): Promise<ListItem[]>; | ||
export function list(pathToSrc: string, cb: ListCallbackFn): void; | ||
|
||
export function cmd(paramsArr: string[]): Promise<string>; | ||
export function cmd(paramsArr: string[], cb: CallbackFn): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters