forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyauzl.d.ts
48 lines (42 loc) · 1.48 KB
/
yauzl.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare module 'yauzl' {
import { EventEmitter } from 'events';
import { Readable } from 'stream';
export class Entry {
fileName: string;
extraFields: { id: number; data: Buffer; }[];
comment: string;
versionMadeBy: number;
versionNeededToExtract: number;
generalPurposeBitFlag: number;
compressionMethod: number;
lastModFileTime: number;
lastModFileDate: number;
crc32: number;
compressedSize: number;
uncompressedSize: number;
fileNameLength: number;
extraFieldLength: number;
fileCommentLength: number;
internalFileAttributes: number;
externalFileAttributes: number;
relativeOffsetOfLocalHeader: number;
getLastModDate(): Date;
}
export class ZipFile extends EventEmitter {
readEntry();
openReadStream(entry: Entry, callback: (err?: Error, stream?: Readable) => void);
close();
isOpen: boolean;
entryCount: number;
comment: string;
}
export interface IOptions {
autoClose: boolean;
}
export function open(path: string, callback: (err?: Error, zipfile?: ZipFile) => void): void;
export function open(path: string, options: IOptions, callback: (err?: Error, zipfile?: ZipFile) => void): void;
}