forked from votingworks/vxsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compress-commons.d.ts
58 lines (48 loc) · 1.62 KB
/
compress-commons.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
49
50
51
52
53
54
55
56
57
58
import { Stream } from 'node:stream'
import { Transform, TransformOptions } from 'readable-stream'
export abstract class ArchiveEntry {
abstract getName(): string
abstract getSize(): number
abstract getLastModifiedDate(): Date
abstract isDirectory(): boolean
}
export class ZipArchiveEntry extends ArchiveEntry {
getName(): string
getSize(): number
getLastModifiedDate(): Date
isDirectory(): boolean
}
export type ArchiveOutputStreamOptions = TransformOptions
export abstract class ArchiveOutputStream extends Transform {
constructor(options?: ArchiveOutputStreamOptions)
entry(
ae: ArchiveEntry,
source: Buffer | Stream,
callback?: (err: Error | null, entry?: ArchiveEntry) => void
): this
finish(): void
getBytesWritten(): number
on(event: 'close', listener: () => void): this
on(event: 'data', listener: (chunk: Buffer | string) => void): this
on(event: 'end', listener: () => void): this
on(event: 'error', listener: (err: Error) => void): this
on(event: 'pause', listener: () => void): this
on(event: 'readable', listener: () => void): this
on(event: 'resume', listener: () => void): this
}
export interface ZipArchiveOutputStreamOptions
extends ArchiveOutputStreamOptions {
/**
* Forces the archive to contain local file times instead of UTC.
*/
forceLocalTime?: boolean
/**
* Forces the archive to contain ZIP64 headers.
*/
forceZip64?: boolean
/**
* Passed to [zlib]{@link https://nodejs.org/api/zlib.html#zlib_class_options} to control compression.
*/
zlib?: import('zlib').ZlibOptions
}
export class ZipArchiveOutputStream extends ArchiveOutputStream { }