anzip
anzip copied to clipboard
feat : add support for Typescript
Description
It will be cool to use this library using Typescript
I hand-rolled a type declaration file for this library to help TS with static typing. It might be helpful to you
declare module "anzip" {
interface Options {
pattern?: RegExp,
disableSave?: boolean,
outputContent?: boolean,
entryHandler?: Promise<boolean>,
outputPath?: string,
flattenPath?: boolean,
disableOutput?: boolean,
rules?: Options[]
}
interface File {
name: string,
directory: string,
saved: boolean,
content: Buffer,
error: Error
}
interface Result {
duration: number,
files: File[],
}
function anzip(
filename: string,
opts?: Options
): Promise<Result>;
export = anzip;
}