mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
Added supporty for the 'directory' and 'bulk' functions of Archiver JS (#12011)
* Added support for the "directory" and "bulk" function calls https://archiverjs.com/docs/lib_core.js.html#line631 https://archiverjs.com/docs/lib_core.js.html#line559 * added funtion overloads and unit tests. * added returntype to bulk
This commit is contained in:
committed by
Masahiro Wakame
parent
09fd5a155b
commit
715c3d55d7
@@ -11,4 +11,13 @@ var readStream = FS.createReadStream('./archiver.d.ts');
|
||||
|
||||
archiver.pipe(writeStream);
|
||||
archiver.append(readStream, {name: 'archiver.d.ts'});
|
||||
archiver.finalize();
|
||||
archiver.finalize();
|
||||
|
||||
|
||||
archiver.directory('./path', './someOtherPath');
|
||||
archiver.directory('./path', { name: "testName"} );
|
||||
|
||||
archiver.directory('./', "", {});
|
||||
archiver.directory('./', {name: 'test'}, {});
|
||||
|
||||
archiver.bulk({ mappaing: {} });
|
||||
5
archiver/archiver.d.ts
vendored
5
archiver/archiver.d.ts
vendored
@@ -25,6 +25,11 @@ declare module "archiver" {
|
||||
interface Archiver extends STREAM.Transform {
|
||||
pipe(writeStream: FS.WriteStream): void;
|
||||
append(source: FS.ReadStream | Buffer | string, name: nameInterface): void;
|
||||
|
||||
directory(dirpath: string, destpath: nameInterface | string): void;
|
||||
directory(dirpath: string, destpath: nameInterface | string, data: any | Function): void;
|
||||
|
||||
bulk(mappings: any): void;
|
||||
finalize(): void;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user