Skip to content

Commit 7769d72

Browse files
🤖 Merge PR DefinitelyTyped#72838 [yazl] Bring up to date with 3.3.x by @Patrick-Clausen
1 parent 1f84945 commit 7769d72

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

types/yazl/index.d.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,28 @@ export interface Options {
88
mode: number;
99
compress: boolean;
1010
forceZip64Format: boolean;
11+
forceDosTimestamp: boolean;
12+
compressionLevel: number;
1113
}
1214

13-
export interface ReadStreamOptions extends Options {
15+
16+
export interface FileOptions extends Options {
17+
fileComment: string;
18+
}
19+
20+
export interface ReadStreamOptions extends FileOptions {
1421
size: number;
1522
}
1623

1724
export interface DirectoryOptions {
1825
mtime: Date;
1926
mode: number;
27+
forceDosTimestamp: boolean;
2028
}
2129

2230
export interface EndOptions {
2331
forceZip64Format: boolean;
32+
comment: string;
2433
}
2534

2635
export interface DosDateTime {
@@ -29,12 +38,18 @@ export interface DosDateTime {
2938
}
3039

3140
export class ZipFile extends EventEmitter {
32-
addFile(realPath: string, metadataPath: string, options?: Partial<Options>): void;
41+
addFile(realPath: string, metadataPath: string, options?: Partial<FileOptions>): void;
3342
outputStream: NodeJS.ReadableStream;
3443
addReadStream(input: NodeJS.ReadableStream, metadataPath: string, options?: Partial<ReadStreamOptions>): void;
44+
addReadStreamLazy(metadataPath: string, getReadStreamFunction: (cb: (err: any, readStream: NodeJS.ReadableStream) => void) => void): void;
45+
addReadStreamLazy(metadataPath: string, options: Partial<ReadStreamOptions>, getReadStreamFunction: (cb: (err: any, readStream: NodeJS.ReadableStream) => void) => void): void;
3546
addBuffer(buffer: Buffer, metadataPath: string, options?: Partial<Options>): void;
36-
end(options?: EndOptions, finalSizeCallback?: () => void): void;
47+
end(options?: EndOptions, calculatedTotalSizeCallback?: () => void): void;
3748

3849
addEmptyDirectory(metadataPath: string, options?: Partial<DirectoryOptions>): void;
50+
51+
/**
52+
* @deprecated since yazl 3.3.0
53+
*/
3954
dateToDosDateTime(jsDate: Date): DosDateTime;
4055
}

types/yazl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/yazl",
4-
"version": "2.4.9999",
4+
"version": "3.3.9999",
55
"projects": [
66
"https://github.com/thejoshwolfe/yazl"
77
],

types/yazl/yazl-tests.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ zipfile.addReadStream(process.stdin, "stdin.txt", {
2222
mtime: new Date(),
2323
mode: parseInt("0100664", 8), // -rw-rw-r--
2424
});
25+
zipfile.addReadStreamLazy("stdin.txt", cb => cb(null, process.stdin));
26+
zipfile.addReadStreamLazy("stdin.txt", {
27+
mtime: new Date(),
28+
mode: parseInt("0100664", 8), // -rw-rw-r--
29+
}, cb => cb({}, process.stdin));
30+
2531
zipfile.addBuffer(new Buffer("hello"), "hello.txt", {
2632
mtime: new Date(),
2733
mode: parseInt("0100664", 8), // -rw-rw-r--

0 commit comments

Comments
 (0)