-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
61 lines (56 loc) · 1.8 KB
/
index.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
59
60
61
import {
ZlibOptions,
BrotliOptions,
Inflate as InflateClass,
Deflate as DeflateClass,
InflateRaw as InflateRawClass,
DeflateRaw as DeflateRawClass,
Gzip as GzipClass,
Gunzip as GunzipClass,
Unzip as UnzipClass,
BrotliCompress as BrotliCompressClass,
BrotliDecompress as BrotliDecompressClass
} from "zlib";
export { constants } from "zlib";
declare abstract class Base {
process(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, flag?: number): Buffer;
process(data: Uint8Array | ReadonlyArray<number>, flag?: number): Buffer;
process(data: WithImplicitCoercion<Uint8Array | ReadonlyArray<number> | string>, flag?: number): Buffer;
process(string: WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: 'string'): string }, flag?: number): Buffer;
close(): void;
}
declare abstract class ZlibBase extends Base {
constructor(options?: ZlibOptions);
}
declare abstract class BrotliBase extends Base {
constructor(options?: BrotliOptions);
}
declare module "fast-zlib" {
export class Inflate extends ZlibBase {
instance: InflateClass;
}
export class Deflate extends ZlibBase {
instance: DeflateClass;
}
export class InflateRaw extends ZlibBase {
instance: InflateRawClass;
}
export class DeflateRaw extends ZlibBase {
instance: DeflateRawClass;
}
export class Gzip extends ZlibBase {
instance: GzipClass;
}
export class Gunzip extends ZlibBase {
instance: GunzipClass;
}
export class Unzip extends ZlibBase {
instance: UnzipClass;
}
export class BrotliCompress extends BrotliBase {
instance: BrotliCompressClass;
}
export class BrotliDecompress extends BrotliBase {
instance: BrotliDecompressClass;
}
}