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 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 | declare module 'zlib' {
|
94 | import * as stream from 'node:stream';
|
95 | interface ZlibOptions {
|
96 | |
97 |
|
98 |
|
99 | flush?: number | undefined;
|
100 | |
101 |
|
102 |
|
103 | finishFlush?: number | undefined;
|
104 | |
105 |
|
106 |
|
107 | chunkSize?: number | undefined;
|
108 | windowBits?: number | undefined;
|
109 | level?: number | undefined;
|
110 | memLevel?: number | undefined;
|
111 | strategy?: number | undefined;
|
112 | dictionary?: NodeJS.ArrayBufferView | ArrayBuffer | undefined;
|
113 | info?: boolean | undefined;
|
114 | maxOutputLength?: number | undefined;
|
115 | }
|
116 | interface BrotliOptions {
|
117 | |
118 |
|
119 |
|
120 | flush?: number | undefined;
|
121 | |
122 |
|
123 |
|
124 | finishFlush?: number | undefined;
|
125 | |
126 |
|
127 |
|
128 | chunkSize?: number | undefined;
|
129 | params?:
|
130 | | {
|
131 | |
132 |
|
133 |
|
134 | [key: number]: boolean | number;
|
135 | }
|
136 | | undefined;
|
137 | maxOutputLength?: number | undefined;
|
138 | }
|
139 | interface Zlib {
|
140 |
|
141 | readonly bytesRead: number;
|
142 | readonly bytesWritten: number;
|
143 | shell?: boolean | string | undefined;
|
144 | close(callback?: () => void): void;
|
145 | flush(kind?: number, callback?: () => void): void;
|
146 | flush(callback?: () => void): void;
|
147 | }
|
148 | interface ZlibParams {
|
149 | params(level: number, strategy: number, callback: () => void): void;
|
150 | }
|
151 | interface ZlibReset {
|
152 | reset(): void;
|
153 | }
|
154 | interface BrotliCompress extends stream.Transform, Zlib {}
|
155 | interface BrotliDecompress extends stream.Transform, Zlib {}
|
156 | interface Gzip extends stream.Transform, Zlib {}
|
157 | interface Gunzip extends stream.Transform, Zlib {}
|
158 | interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
|
159 | interface Inflate extends stream.Transform, Zlib, ZlibReset {}
|
160 | interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
|
161 | interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}
|
162 | interface Unzip extends stream.Transform, Zlib {}
|
163 | |
164 |
|
165 |
|
166 |
|
167 | function createBrotliCompress(options?: BrotliOptions): BrotliCompress;
|
168 | |
169 |
|
170 |
|
171 |
|
172 | function createBrotliDecompress(options?: BrotliOptions): BrotliDecompress;
|
173 | |
174 |
|
175 |
|
176 |
|
177 |
|
178 | function createGzip(options?: ZlibOptions): Gzip;
|
179 | |
180 |
|
181 |
|
182 |
|
183 | function createGunzip(options?: ZlibOptions): Gunzip;
|
184 | |
185 |
|
186 |
|
187 |
|
188 | function createDeflate(options?: ZlibOptions): Deflate;
|
189 | |
190 |
|
191 |
|
192 |
|
193 | function createInflate(options?: ZlibOptions): Inflate;
|
194 | |
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 | function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
|
205 | |
206 |
|
207 |
|
208 |
|
209 | function createInflateRaw(options?: ZlibOptions): InflateRaw;
|
210 | |
211 |
|
212 |
|
213 |
|
214 | function createUnzip(options?: ZlibOptions): Unzip;
|
215 | type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
|
216 | type CompressCallback = (error: Error | null, result: Buffer) => void;
|
217 | |
218 |
|
219 |
|
220 | function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
|
221 | function brotliCompress(buf: InputType, callback: CompressCallback): void;
|
222 | namespace brotliCompress {
|
223 | function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
|
224 | }
|
225 | |
226 |
|
227 |
|
228 |
|
229 | function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;
|
230 | |
231 |
|
232 |
|
233 | function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
|
234 | function brotliDecompress(buf: InputType, callback: CompressCallback): void;
|
235 | namespace brotliDecompress {
|
236 | function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
|
237 | }
|
238 | |
239 |
|
240 |
|
241 |
|
242 | function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;
|
243 | |
244 |
|
245 |
|
246 | function deflate(buf: InputType, callback: CompressCallback): void;
|
247 | function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
248 | namespace deflate {
|
249 | function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
250 | }
|
251 | |
252 |
|
253 |
|
254 |
|
255 | function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
256 | |
257 |
|
258 |
|
259 | function deflateRaw(buf: InputType, callback: CompressCallback): void;
|
260 | function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
261 | namespace deflateRaw {
|
262 | function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
263 | }
|
264 | |
265 |
|
266 |
|
267 |
|
268 | function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
269 | |
270 |
|
271 |
|
272 | function gzip(buf: InputType, callback: CompressCallback): void;
|
273 | function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
274 | namespace gzip {
|
275 | function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
276 | }
|
277 | |
278 |
|
279 |
|
280 |
|
281 | function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
282 | |
283 |
|
284 |
|
285 | function gunzip(buf: InputType, callback: CompressCallback): void;
|
286 | function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
287 | namespace gunzip {
|
288 | function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
289 | }
|
290 | |
291 |
|
292 |
|
293 |
|
294 | function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
295 | |
296 |
|
297 |
|
298 | function inflate(buf: InputType, callback: CompressCallback): void;
|
299 | function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
300 | namespace inflate {
|
301 | function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
302 | }
|
303 | |
304 |
|
305 |
|
306 |
|
307 | function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
308 | |
309 |
|
310 |
|
311 | function inflateRaw(buf: InputType, callback: CompressCallback): void;
|
312 | function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
313 | namespace inflateRaw {
|
314 | function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
315 | }
|
316 | |
317 |
|
318 |
|
319 |
|
320 | function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
321 | |
322 |
|
323 |
|
324 | function unzip(buf: InputType, callback: CompressCallback): void;
|
325 | function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
326 | namespace unzip {
|
327 | function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
328 | }
|
329 | |
330 |
|
331 |
|
332 |
|
333 | function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
334 | namespace constants {
|
335 | const BROTLI_DECODE: number;
|
336 | const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;
|
337 | const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: number;
|
338 | const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: number;
|
339 | const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: number;
|
340 | const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: number;
|
341 | const BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: number;
|
342 | const BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: number;
|
343 | const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: number;
|
344 | const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: number;
|
345 | const BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: number;
|
346 | const BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: number;
|
347 | const BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: number;
|
348 | const BROTLI_DECODER_ERROR_FORMAT_DISTANCE: number;
|
349 | const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: number;
|
350 | const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: number;
|
351 | const BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: number;
|
352 | const BROTLI_DECODER_ERROR_FORMAT_PADDING_1: number;
|
353 | const BROTLI_DECODER_ERROR_FORMAT_PADDING_2: number;
|
354 | const BROTLI_DECODER_ERROR_FORMAT_RESERVED: number;
|
355 | const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: number;
|
356 | const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: number;
|
357 | const BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: number;
|
358 | const BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: number;
|
359 | const BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: number;
|
360 | const BROTLI_DECODER_ERROR_UNREACHABLE: number;
|
361 | const BROTLI_DECODER_NEEDS_MORE_INPUT: number;
|
362 | const BROTLI_DECODER_NEEDS_MORE_OUTPUT: number;
|
363 | const BROTLI_DECODER_NO_ERROR: number;
|
364 | const BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: number;
|
365 | const BROTLI_DECODER_PARAM_LARGE_WINDOW: number;
|
366 | const BROTLI_DECODER_RESULT_ERROR: number;
|
367 | const BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: number;
|
368 | const BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: number;
|
369 | const BROTLI_DECODER_RESULT_SUCCESS: number;
|
370 | const BROTLI_DECODER_SUCCESS: number;
|
371 | const BROTLI_DEFAULT_MODE: number;
|
372 | const BROTLI_DEFAULT_QUALITY: number;
|
373 | const BROTLI_DEFAULT_WINDOW: number;
|
374 | const BROTLI_ENCODE: number;
|
375 | const BROTLI_LARGE_MAX_WINDOW_BITS: number;
|
376 | const BROTLI_MAX_INPUT_BLOCK_BITS: number;
|
377 | const BROTLI_MAX_QUALITY: number;
|
378 | const BROTLI_MAX_WINDOW_BITS: number;
|
379 | const BROTLI_MIN_INPUT_BLOCK_BITS: number;
|
380 | const BROTLI_MIN_QUALITY: number;
|
381 | const BROTLI_MIN_WINDOW_BITS: number;
|
382 | const BROTLI_MODE_FONT: number;
|
383 | const BROTLI_MODE_GENERIC: number;
|
384 | const BROTLI_MODE_TEXT: number;
|
385 | const BROTLI_OPERATION_EMIT_METADATA: number;
|
386 | const BROTLI_OPERATION_FINISH: number;
|
387 | const BROTLI_OPERATION_FLUSH: number;
|
388 | const BROTLI_OPERATION_PROCESS: number;
|
389 | const BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: number;
|
390 | const BROTLI_PARAM_LARGE_WINDOW: number;
|
391 | const BROTLI_PARAM_LGBLOCK: number;
|
392 | const BROTLI_PARAM_LGWIN: number;
|
393 | const BROTLI_PARAM_MODE: number;
|
394 | const BROTLI_PARAM_NDIRECT: number;
|
395 | const BROTLI_PARAM_NPOSTFIX: number;
|
396 | const BROTLI_PARAM_QUALITY: number;
|
397 | const BROTLI_PARAM_SIZE_HINT: number;
|
398 | const DEFLATE: number;
|
399 | const DEFLATERAW: number;
|
400 | const GUNZIP: number;
|
401 | const GZIP: number;
|
402 | const INFLATE: number;
|
403 | const INFLATERAW: number;
|
404 | const UNZIP: number;
|
405 |
|
406 | const Z_NO_FLUSH: number;
|
407 | const Z_PARTIAL_FLUSH: number;
|
408 | const Z_SYNC_FLUSH: number;
|
409 | const Z_FULL_FLUSH: number;
|
410 | const Z_FINISH: number;
|
411 | const Z_BLOCK: number;
|
412 | const Z_TREES: number;
|
413 |
|
414 |
|
415 | const Z_OK: number;
|
416 | const Z_STREAM_END: number;
|
417 | const Z_NEED_DICT: number;
|
418 | const Z_ERRNO: number;
|
419 | const Z_STREAM_ERROR: number;
|
420 | const Z_DATA_ERROR: number;
|
421 | const Z_MEM_ERROR: number;
|
422 | const Z_BUF_ERROR: number;
|
423 | const Z_VERSION_ERROR: number;
|
424 |
|
425 | const Z_NO_COMPRESSION: number;
|
426 | const Z_BEST_SPEED: number;
|
427 | const Z_BEST_COMPRESSION: number;
|
428 | const Z_DEFAULT_COMPRESSION: number;
|
429 |
|
430 | const Z_FILTERED: number;
|
431 | const Z_HUFFMAN_ONLY: number;
|
432 | const Z_RLE: number;
|
433 | const Z_FIXED: number;
|
434 | const Z_DEFAULT_STRATEGY: number;
|
435 | const Z_DEFAULT_WINDOWBITS: number;
|
436 | const Z_MIN_WINDOWBITS: number;
|
437 | const Z_MAX_WINDOWBITS: number;
|
438 | const Z_MIN_CHUNK: number;
|
439 | const Z_MAX_CHUNK: number;
|
440 | const Z_DEFAULT_CHUNK: number;
|
441 | const Z_MIN_MEMLEVEL: number;
|
442 | const Z_MAX_MEMLEVEL: number;
|
443 | const Z_DEFAULT_MEMLEVEL: number;
|
444 | const Z_MIN_LEVEL: number;
|
445 | const Z_MAX_LEVEL: number;
|
446 | const Z_DEFAULT_LEVEL: number;
|
447 | const ZLIB_VERNUM: number;
|
448 | }
|
449 |
|
450 |
|
451 | const Z_NO_FLUSH: number;
|
452 |
|
453 | const Z_PARTIAL_FLUSH: number;
|
454 |
|
455 | const Z_SYNC_FLUSH: number;
|
456 |
|
457 | const Z_FULL_FLUSH: number;
|
458 |
|
459 | const Z_FINISH: number;
|
460 |
|
461 | const Z_BLOCK: number;
|
462 |
|
463 | const Z_TREES: number;
|
464 |
|
465 |
|
466 |
|
467 | const Z_OK: number;
|
468 |
|
469 | const Z_STREAM_END: number;
|
470 |
|
471 | const Z_NEED_DICT: number;
|
472 |
|
473 | const Z_ERRNO: number;
|
474 |
|
475 | const Z_STREAM_ERROR: number;
|
476 |
|
477 | const Z_DATA_ERROR: number;
|
478 |
|
479 | const Z_MEM_ERROR: number;
|
480 |
|
481 | const Z_BUF_ERROR: number;
|
482 |
|
483 | const Z_VERSION_ERROR: number;
|
484 |
|
485 |
|
486 | const Z_NO_COMPRESSION: number;
|
487 |
|
488 | const Z_BEST_SPEED: number;
|
489 |
|
490 | const Z_BEST_COMPRESSION: number;
|
491 |
|
492 | const Z_DEFAULT_COMPRESSION: number;
|
493 |
|
494 |
|
495 | const Z_FILTERED: number;
|
496 |
|
497 | const Z_HUFFMAN_ONLY: number;
|
498 |
|
499 | const Z_RLE: number;
|
500 |
|
501 | const Z_FIXED: number;
|
502 |
|
503 | const Z_DEFAULT_STRATEGY: number;
|
504 |
|
505 | const Z_BINARY: number;
|
506 |
|
507 | const Z_TEXT: number;
|
508 |
|
509 | const Z_ASCII: number;
|
510 |
|
511 | const Z_UNKNOWN: number;
|
512 |
|
513 | const Z_DEFLATED: number;
|
514 | }
|
515 | declare module 'node:zlib' {
|
516 | export * from 'zlib';
|
517 | }
|