CoolFace
Apppublic

Pinsave/counterstrike

sourceHugging Faceupdated 3mo agoView on Hugging Face
1likes
zlib.d.ts669 linesDownload Raw Back to node
1/**2 * The `node:zlib` module provides compression functionality implemented using3 * Gzip, Deflate/Inflate, and Brotli.4 *5 * To access it:6 *7 * ```js8 * import zlib from 'node:zlib';9 * ```10 *11 * Compression and decompression are built around the Node.js12 * [Streams API](https://nodejs.org/docs/latest-v24.x/api/stream.html).13 *14 * Compressing or decompressing a stream (such as a file) can be accomplished by15 * piping the source stream through a `zlib` `Transform` stream into a destination16 * stream:17 *18 * ```js19 * import { createGzip } from 'node:zlib';20 * import { pipeline } from 'node:stream';21 * import {22 *   createReadStream,23 *   createWriteStream,24 * } from 'node:fs';25 *26 * const gzip = createGzip();27 * const source = createReadStream('input.txt');28 * const destination = createWriteStream('input.txt.gz');29 *30 * pipeline(source, gzip, destination, (err) => {31 *   if (err) {32 *     console.error('An error occurred:', err);33 *     process.exitCode = 1;34 *   }35 * });36 *37 * // Or, Promisified38 *39 * import { promisify } from 'node:util';40 * const pipe = promisify(pipeline);41 *42 * async function do_gzip(input, output) {43 *   const gzip = createGzip();44 *   const source = createReadStream(input);45 *   const destination = createWriteStream(output);46 *   await pipe(source, gzip, destination);47 * }48 *49 * do_gzip('input.txt', 'input.txt.gz')50 *   .catch((err) => {51 *     console.error('An error occurred:', err);52 *     process.exitCode = 1;53 *   });54 * ```55 *56 * It is also possible to compress or decompress data in a single step:57 *58 * ```js59 * import { deflate, unzip } from 'node:zlib';60 *61 * const input = '.................................';62 * deflate(input, (err, buffer) => {63 *   if (err) {64 *     console.error('An error occurred:', err);65 *     process.exitCode = 1;66 *   }67 *   console.log(buffer.toString('base64'));68 * });69 *70 * const buffer = Buffer.from('eJzT0yMAAGTvBe8=', 'base64');71 * unzip(buffer, (err, buffer) => {72 *   if (err) {73 *     console.error('An error occurred:', err);74 *     process.exitCode = 1;75 *   }76 *   console.log(buffer.toString());77 * });78 *79 * // Or, Promisified80 *81 * import { promisify } from 'node:util';82 * const do_unzip = promisify(unzip);83 *84 * do_unzip(buffer)85 *   .then((buf) => console.log(buf.toString()))86 *   .catch((err) => {87 *     console.error('An error occurred:', err);88 *     process.exitCode = 1;89 *   });90 * ```91 * @since v0.5.892 * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/zlib.js)93 */94declare module "zlib" {95    import * as stream from "node:stream";96    interface ZlibOptions {97        /**98         * @default constants.Z_NO_FLUSH99         */100        flush?: number | undefined;101        /**102         * @default constants.Z_FINISH103         */104        finishFlush?: number | undefined;105        /**106         * @default 16*1024107         */108        chunkSize?: number | undefined;109        windowBits?: number | undefined;110        level?: number | undefined; // compression only111        memLevel?: number | undefined; // compression only112        strategy?: number | undefined; // compression only113        dictionary?: NodeJS.ArrayBufferView | ArrayBuffer | undefined; // deflate/inflate only, empty dictionary by default114        /**115         * If `true`, returns an object with `buffer` and `engine`.116         */117        info?: boolean | undefined;118        /**119         * Limits output size when using convenience methods.120         * @default buffer.kMaxLength121         */122        maxOutputLength?: number | undefined;123    }124    interface BrotliOptions {125        /**126         * @default constants.BROTLI_OPERATION_PROCESS127         */128        flush?: number | undefined;129        /**130         * @default constants.BROTLI_OPERATION_FINISH131         */132        finishFlush?: number | undefined;133        /**134         * @default 16*1024135         */136        chunkSize?: number | undefined;137        params?:138            | {139                /**140                 * Each key is a `constants.BROTLI_*` constant.141                 */142                [key: number]: boolean | number;143            }144            | undefined;145        /**146         * Limits output size when using [convenience methods](https://nodejs.org/docs/latest-v24.x/api/zlib.html#convenience-methods).147         * @default buffer.kMaxLength148         */149        maxOutputLength?: number | undefined;150    }151    interface ZstdOptions {152        /**153         * @default constants.ZSTD_e_continue154         */155        flush?: number | undefined;156        /**157         * @default constants.ZSTD_e_end158         */159        finishFlush?: number | undefined;160        /**161         * @default 16 * 1024162         */163        chunkSize?: number | undefined;164        /**165         * Key-value object containing indexed166         * [Zstd parameters](https://nodejs.org/docs/latest-v24.x/api/zlib.html#zstd-constants).167         */168        params?: { [key: number]: number | boolean } | undefined;169        /**170         * Limits output size when using171         * [convenience methods](https://nodejs.org/docs/latest-v24.x/api/zlib.html#convenience-methods).172         * @default buffer.kMaxLength173         */174        maxOutputLength?: number | undefined;175    }176    interface Zlib {177        readonly bytesWritten: number;178        shell?: boolean | string | undefined;179        close(callback?: () => void): void;180        flush(kind?: number, callback?: () => void): void;181        flush(callback?: () => void): void;182    }183    interface ZlibParams {184        params(level: number, strategy: number, callback: () => void): void;185    }186    interface ZlibReset {187        reset(): void;188    }189    interface BrotliCompress extends stream.Transform, Zlib {}190    interface BrotliDecompress extends stream.Transform, Zlib {}191    interface Gzip extends stream.Transform, Zlib {}192    interface Gunzip extends stream.Transform, Zlib {}193    interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams {}194    interface Inflate extends stream.Transform, Zlib, ZlibReset {}195    interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}196    interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}197    interface Unzip extends stream.Transform, Zlib {}198    /**199     * @since v22.15.0200     * @experimental201     */202    interface ZstdCompress extends stream.Transform, Zlib {}203    /**204     * @since v22.15.0205     * @experimental206     */207    interface ZstdDecompress extends stream.Transform, Zlib {}208    /**209     * Computes a 32-bit [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum of `data`.210     * If `value` is specified, it is used as the starting value of the checksum, otherwise, 0 is used as the starting value.211     * @param data When `data` is a string, it will be encoded as UTF-8 before being used for computation.212     * @param value An optional starting value. It must be a 32-bit unsigned integer. @default 0213     * @returns A 32-bit unsigned integer containing the checksum.214     * @since v22.2.0215     */216    function crc32(data: string | Buffer | NodeJS.ArrayBufferView, value?: number): number;217    /**218     * Creates and returns a new `BrotliCompress` object.219     * @since v11.7.0, v10.16.0220     */221    function createBrotliCompress(options?: BrotliOptions): BrotliCompress;222    /**223     * Creates and returns a new `BrotliDecompress` object.224     * @since v11.7.0, v10.16.0225     */226    function createBrotliDecompress(options?: BrotliOptions): BrotliDecompress;227    /**228     * Creates and returns a new `Gzip` object.229     * See `example`.230     * @since v0.5.8231     */232    function createGzip(options?: ZlibOptions): Gzip;233    /**234     * Creates and returns a new `Gunzip` object.235     * @since v0.5.8236     */237    function createGunzip(options?: ZlibOptions): Gunzip;238    /**239     * Creates and returns a new `Deflate` object.240     * @since v0.5.8241     */242    function createDeflate(options?: ZlibOptions): Deflate;243    /**244     * Creates and returns a new `Inflate` object.245     * @since v0.5.8246     */247    function createInflate(options?: ZlibOptions): Inflate;248    /**249     * Creates and returns a new `DeflateRaw` object.250     *251     * An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when `windowBits` is set to 8 for raw deflate streams. zlib would automatically set `windowBits` to 9 if was initially set to 8. Newer252     * versions of zlib will throw an exception,253     * so Node.js restored the original behavior of upgrading a value of 8 to 9,254     * since passing `windowBits = 9` to zlib actually results in a compressed stream255     * that effectively uses an 8-bit window only.256     * @since v0.5.8257     */258    function createDeflateRaw(options?: ZlibOptions): DeflateRaw;259    /**260     * Creates and returns a new `InflateRaw` object.261     * @since v0.5.8262     */263    function createInflateRaw(options?: ZlibOptions): InflateRaw;264    /**265     * Creates and returns a new `Unzip` object.266     * @since v0.5.8267     */268    function createUnzip(options?: ZlibOptions): Unzip;269    /**270     * Creates and returns a new `ZstdCompress` object.271     * @since v22.15.0272     */273    function createZstdCompress(options?: ZstdOptions): ZstdCompress;274    /**275     * Creates and returns a new `ZstdDecompress` object.276     * @since v22.15.0277     */278    function createZstdDecompress(options?: ZstdOptions): ZstdDecompress;279    type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;280    type CompressCallback = (error: Error | null, result: Buffer) => void;281    /**282     * @since v11.7.0, v10.16.0283     */284    function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;285    function brotliCompress(buf: InputType, callback: CompressCallback): void;286    namespace brotliCompress {287        function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;288    }289    /**290     * Compress a chunk of data with `BrotliCompress`.291     * @since v11.7.0, v10.16.0292     */293    function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;294    /**295     * @since v11.7.0, v10.16.0296     */297    function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;298    function brotliDecompress(buf: InputType, callback: CompressCallback): void;299    namespace brotliDecompress {300        function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;301    }302    /**303     * Decompress a chunk of data with `BrotliDecompress`.304     * @since v11.7.0, v10.16.0305     */306    function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;307    /**308     * @since v0.6.0309     */310    function deflate(buf: InputType, callback: CompressCallback): void;311    function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;312    namespace deflate {313        function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;314    }315    /**316     * Compress a chunk of data with `Deflate`.317     * @since v0.11.12318     */319    function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;320    /**321     * @since v0.6.0322     */323    function deflateRaw(buf: InputType, callback: CompressCallback): void;324    function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;325    namespace deflateRaw {326        function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;327    }328    /**329     * Compress a chunk of data with `DeflateRaw`.330     * @since v0.11.12331     */332    function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;333    /**334     * @since v0.6.0335     */336    function gzip(buf: InputType, callback: CompressCallback): void;337    function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;338    namespace gzip {339        function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;340    }341    /**342     * Compress a chunk of data with `Gzip`.343     * @since v0.11.12344     */345    function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;346    /**347     * @since v0.6.0348     */349    function gunzip(buf: InputType, callback: CompressCallback): void;350    function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;351    namespace gunzip {352        function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;353    }354    /**355     * Decompress a chunk of data with `Gunzip`.356     * @since v0.11.12357     */358    function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;359    /**360     * @since v0.6.0361     */362    function inflate(buf: InputType, callback: CompressCallback): void;363    function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;364    namespace inflate {365        function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;366    }367    /**368     * Decompress a chunk of data with `Inflate`.369     * @since v0.11.12370     */371    function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;372    /**373     * @since v0.6.0374     */375    function inflateRaw(buf: InputType, callback: CompressCallback): void;376    function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;377    namespace inflateRaw {378        function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;379    }380    /**381     * Decompress a chunk of data with `InflateRaw`.382     * @since v0.11.12383     */384    function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;385    /**386     * @since v0.6.0387     */388    function unzip(buf: InputType, callback: CompressCallback): void;389    function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;390    namespace unzip {391        function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;392    }393    /**394     * Decompress a chunk of data with `Unzip`.395     * @since v0.11.12396     */397    function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;398    /**399     * @since v22.15.0400     * @experimental401     */402    function zstdCompress(buf: InputType, callback: CompressCallback): void;403    function zstdCompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;404    namespace zstdCompress {405        function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<Buffer>;406    }407    /**408     * Compress a chunk of data with `ZstdCompress`.409     * @since v22.15.0410     * @experimental411     */412    function zstdCompressSync(buf: InputType, options?: ZstdOptions): Buffer;413    /**414     * @since v22.15.0415     * @experimental416     */417    function zstdDecompress(buf: InputType, callback: CompressCallback): void;418    function zstdDecompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;419    namespace zstdDecompress {420        function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<Buffer>;421    }422    /**423     * Decompress a chunk of data with `ZstdDecompress`.424     * @since v22.15.0425     * @experimental426     */427    function zstdDecompressSync(buf: InputType, options?: ZstdOptions): Buffer;428    namespace constants {429        const BROTLI_DECODE: number;430        const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;431        const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: number;432        const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: number;433        const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: number;434        const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: number;435        const BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: number;436        const BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: number;437        const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: number;438        const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: number;439        const BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: number;440        const BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: number;441        const BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: number;442        const BROTLI_DECODER_ERROR_FORMAT_DISTANCE: number;443        const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: number;444        const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: number;445        const BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: number;446        const BROTLI_DECODER_ERROR_FORMAT_PADDING_1: number;447        const BROTLI_DECODER_ERROR_FORMAT_PADDING_2: number;448        const BROTLI_DECODER_ERROR_FORMAT_RESERVED: number;449        const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: number;450        const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: number;451        const BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: number;452        const BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: number;453        const BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: number;454        const BROTLI_DECODER_ERROR_UNREACHABLE: number;455        const BROTLI_DECODER_NEEDS_MORE_INPUT: number;456        const BROTLI_DECODER_NEEDS_MORE_OUTPUT: number;457        const BROTLI_DECODER_NO_ERROR: number;458        const BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: number;459        const BROTLI_DECODER_PARAM_LARGE_WINDOW: number;460        const BROTLI_DECODER_RESULT_ERROR: number;461        const BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: number;462        const BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: number;463        const BROTLI_DECODER_RESULT_SUCCESS: number;464        const BROTLI_DECODER_SUCCESS: number;465        const BROTLI_DEFAULT_MODE: number;466        const BROTLI_DEFAULT_QUALITY: number;467        const BROTLI_DEFAULT_WINDOW: number;468        const BROTLI_ENCODE: number;469        const BROTLI_LARGE_MAX_WINDOW_BITS: number;470        const BROTLI_MAX_INPUT_BLOCK_BITS: number;471        const BROTLI_MAX_QUALITY: number;472        const BROTLI_MAX_WINDOW_BITS: number;473        const BROTLI_MIN_INPUT_BLOCK_BITS: number;474        const BROTLI_MIN_QUALITY: number;475        const BROTLI_MIN_WINDOW_BITS: number;476        const BROTLI_MODE_FONT: number;477        const BROTLI_MODE_GENERIC: number;478        const BROTLI_MODE_TEXT: number;479        const BROTLI_OPERATION_EMIT_METADATA: number;480        const BROTLI_OPERATION_FINISH: number;481        const BROTLI_OPERATION_FLUSH: number;482        const BROTLI_OPERATION_PROCESS: number;483        const BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: number;484        const BROTLI_PARAM_LARGE_WINDOW: number;485        const BROTLI_PARAM_LGBLOCK: number;486        const BROTLI_PARAM_LGWIN: number;487        const BROTLI_PARAM_MODE: number;488        const BROTLI_PARAM_NDIRECT: number;489        const BROTLI_PARAM_NPOSTFIX: number;490        const BROTLI_PARAM_QUALITY: number;491        const BROTLI_PARAM_SIZE_HINT: number;492        const DEFLATE: number;493        const DEFLATERAW: number;494        const GUNZIP: number;495        const GZIP: number;496        const INFLATE: number;497        const INFLATERAW: number;498        const UNZIP: number;499        const ZLIB_VERNUM: number;500        const ZSTD_CLEVEL_DEFAULT: number;501        const ZSTD_COMPRESS: number;502        const ZSTD_DECOMPRESS: number;503        const ZSTD_btlazy2: number;504        const ZSTD_btopt: number;505        const ZSTD_btultra: number;506        const ZSTD_btultra2: number;507        const ZSTD_c_chainLog: number;508        const ZSTD_c_checksumFlag: number;509        const ZSTD_c_compressionLevel: number;510        const ZSTD_c_contentSizeFlag: number;511        const ZSTD_c_dictIDFlag: number;512        const ZSTD_c_enableLongDistanceMatching: number;513        const ZSTD_c_hashLog: number;514        const ZSTD_c_jobSize: number;515        const ZSTD_c_ldmBucketSizeLog: number;516        const ZSTD_c_ldmHashLog: number;517        const ZSTD_c_ldmHashRateLog: number;518        const ZSTD_c_ldmMinMatch: number;519        const ZSTD_c_minMatch: number;520        const ZSTD_c_nbWorkers: number;521        const ZSTD_c_overlapLog: number;522        const ZSTD_c_searchLog: number;523        const ZSTD_c_strategy: number;524        const ZSTD_c_targetLength: number;525        const ZSTD_c_windowLog: number;526        const ZSTD_d_windowLogMax: number;527        const ZSTD_dfast: number;528        const ZSTD_e_continue: number;529        const ZSTD_e_end: number;530        const ZSTD_e_flush: number;531        const ZSTD_error_GENERIC: number;532        const ZSTD_error_checksum_wrong: number;533        const ZSTD_error_corruption_detected: number;534        const ZSTD_error_dictionaryCreation_failed: number;535        const ZSTD_error_dictionary_corrupted: number;536        const ZSTD_error_dictionary_wrong: number;537        const ZSTD_error_dstBuffer_null: number;538        const ZSTD_error_dstSize_tooSmall: number;539        const ZSTD_error_frameParameter_unsupported: number;540        const ZSTD_error_frameParameter_windowTooLarge: number;541        const ZSTD_error_init_missing: number;542        const ZSTD_error_literals_headerWrong: number;543        const ZSTD_error_maxSymbolValue_tooLarge: number;544        const ZSTD_error_maxSymbolValue_tooSmall: number;545        const ZSTD_error_memory_allocation: number;546        const ZSTD_error_noForwardProgress_destFull: number;547        const ZSTD_error_noForwardProgress_inputEmpty: number;548        const ZSTD_error_no_error: number;549        const ZSTD_error_parameter_combination_unsupported: number;550        const ZSTD_error_parameter_outOfBound: number;551        const ZSTD_error_parameter_unsupported: number;552        const ZSTD_error_prefix_unknown: number;553        const ZSTD_error_srcSize_wrong: number;554        const ZSTD_error_stabilityCondition_notRespected: number;555        const ZSTD_error_stage_wrong: number;556        const ZSTD_error_tableLog_tooLarge: number;557        const ZSTD_error_version_unsupported: number;558        const ZSTD_error_workSpace_tooSmall: number;559        const ZSTD_fast: number;560        const ZSTD_greedy: number;561        const ZSTD_lazy: number;562        const ZSTD_lazy2: number;563        const Z_BEST_COMPRESSION: number;564        const Z_BEST_SPEED: number;565        const Z_BLOCK: number;566        const Z_BUF_ERROR: number;567        const Z_DATA_ERROR: number;568        const Z_DEFAULT_CHUNK: number;569        const Z_DEFAULT_COMPRESSION: number;570        const Z_DEFAULT_LEVEL: number;571        const Z_DEFAULT_MEMLEVEL: number;572        const Z_DEFAULT_STRATEGY: number;573        const Z_DEFAULT_WINDOWBITS: number;574        const Z_ERRNO: number;575        const Z_FILTERED: number;576        const Z_FINISH: number;577        const Z_FIXED: number;578        const Z_FULL_FLUSH: number;579        const Z_HUFFMAN_ONLY: number;580        const Z_MAX_CHUNK: number;581        const Z_MAX_LEVEL: number;582        const Z_MAX_MEMLEVEL: number;583        const Z_MAX_WINDOWBITS: number;584        const Z_MEM_ERROR: number;585        const Z_MIN_CHUNK: number;586        const Z_MIN_LEVEL: number;587        const Z_MIN_MEMLEVEL: number;588        const Z_MIN_WINDOWBITS: number;589        const Z_NEED_DICT: number;590        const Z_NO_COMPRESSION: number;591        const Z_NO_FLUSH: number;592        const Z_OK: number;593        const Z_PARTIAL_FLUSH: number;594        const Z_RLE: number;595        const Z_STREAM_END: number;596        const Z_STREAM_ERROR: number;597        const Z_SYNC_FLUSH: number;598        const Z_VERSION_ERROR: number;599    }600    // Allowed flush values.601    /** @deprecated Use `constants.Z_NO_FLUSH` */602    const Z_NO_FLUSH: number;603    /** @deprecated Use `constants.Z_PARTIAL_FLUSH` */604    const Z_PARTIAL_FLUSH: number;605    /** @deprecated Use `constants.Z_SYNC_FLUSH` */606    const Z_SYNC_FLUSH: number;607    /** @deprecated Use `constants.Z_FULL_FLUSH` */608    const Z_FULL_FLUSH: number;609    /** @deprecated Use `constants.Z_FINISH` */610    const Z_FINISH: number;611    /** @deprecated Use `constants.Z_BLOCK` */612    const Z_BLOCK: number;613    /** @deprecated Use `constants.Z_TREES` */614    const Z_TREES: number;615    // Return codes for the compression/decompression functions.616    // Negative values are errors, positive values are used for special but normal events.617    /** @deprecated Use `constants.Z_OK` */618    const Z_OK: number;619    /** @deprecated Use `constants.Z_STREAM_END` */620    const Z_STREAM_END: number;621    /** @deprecated Use `constants.Z_NEED_DICT` */622    const Z_NEED_DICT: number;623    /** @deprecated Use `constants.Z_ERRNO` */624    const Z_ERRNO: number;625    /** @deprecated Use `constants.Z_STREAM_ERROR` */626    const Z_STREAM_ERROR: number;627    /** @deprecated Use `constants.Z_DATA_ERROR` */628    const Z_DATA_ERROR: number;629    /** @deprecated Use `constants.Z_MEM_ERROR` */630    const Z_MEM_ERROR: number;631    /** @deprecated Use `constants.Z_BUF_ERROR` */632    const Z_BUF_ERROR: number;633    /** @deprecated Use `constants.Z_VERSION_ERROR` */634    const Z_VERSION_ERROR: number;635    // Compression levels.636    /** @deprecated Use `constants.Z_NO_COMPRESSION` */637    const Z_NO_COMPRESSION: number;638    /** @deprecated Use `constants.Z_BEST_SPEED` */639    const Z_BEST_SPEED: number;640    /** @deprecated Use `constants.Z_BEST_COMPRESSION` */641    const Z_BEST_COMPRESSION: number;642    /** @deprecated Use `constants.Z_DEFAULT_COMPRESSION` */643    const Z_DEFAULT_COMPRESSION: number;644    // Compression strategy.645    /** @deprecated Use `constants.Z_FILTERED` */646    const Z_FILTERED: number;647    /** @deprecated Use `constants.Z_HUFFMAN_ONLY` */648    const Z_HUFFMAN_ONLY: number;649    /** @deprecated Use `constants.Z_RLE` */650    const Z_RLE: number;651    /** @deprecated Use `constants.Z_FIXED` */652    const Z_FIXED: number;653    /** @deprecated Use `constants.Z_DEFAULT_STRATEGY` */654    const Z_DEFAULT_STRATEGY: number;655    /** @deprecated */656    const Z_BINARY: number;657    /** @deprecated */658    const Z_TEXT: number;659    /** @deprecated */660    const Z_ASCII: number;661    /** @deprecated  */662    const Z_UNKNOWN: number;663    /** @deprecated */664    const Z_DEFLATED: number;665}666declare module "node:zlib" {667    export * from "zlib";668}669