Files
DefinitelyTyped/archiver/index.d.ts
Aleksander 9450ba6603 Include interface Archiver in namespace
I've included the interface Archiver in the namespace. Basically this makes it easier to pass around an archive as a function parameter when using the typedefinition files
2016-11-11 13:27:13 +01:00

50 lines
1.4 KiB
TypeScript

// Type definitions for archiver v0.15.0
// Project: https://github.com/archiverjs/node-archiver
// Definitions by: Esri <https://github.com/archiverjs/node-archiver>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/* =================== USAGE ===================
import Archiver = require('archiver);
var archiver = Archiver.create('zip');
archiver.pipe(FS.createWriteStream('xxx'));
archiver.append(FS.createReadStream('xxx'));
archiver.finalize();
=============================================== */
/// <reference types="node" />
import * as FS from 'fs';
import * as STREAM from 'stream';
declare function archiver(format: string, options?: archiver.Options): archiver.Archiver;
declare namespace archiver {
export function create(format: string, options?: Options): Archiver;
export interface nameInterface {
name?: string;
}
export 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;
}
export interface Options {
}
}
export = archiver;