Path: blob/main/third_party/closure-compiler/node-externs/zlib.js
6174 views
/*1* Copyright 2012 The Closure Compiler Authors.2*3* Licensed under the Apache License, Version 2.0 (the "License");4* you may not use this file except in compliance with the License.5* You may obtain a copy of the License at6*7* http://www.apache.org/licenses/LICENSE-2.08*9* Unless required by applicable law or agreed to in writing, software10* distributed under the License is distributed on an "AS IS" BASIS,11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12* See the License for the specific language governing permissions and13* limitations under the License.14*/1516/**17* @fileoverview Definitions for node's zlib module. Depends on the events and buffer modules.18* @see http://nodejs.org/api/zlib.html19* @see https://github.com/joyent/node/blob/master/lib/zlib.js20* @externs21* @author Daniel Wirtz <[email protected]>22*/2324/**25BEGIN_NODE_INCLUDE26var zlib = require('zlib');27END_NODE_INCLUDE28*/2930/**31* @type {Object.<string,*>}32*/33var zlib = {};3435/**36* @typedef {{chunkSize: ?number, windowBits: ?number, level: ?number, memLevel: ?number, strategy: ?number, dictionary: ?Object}}37*/38zlib.Options;39404142/**43* @constructor44* @extends stream.Transform45*/46zlib.Zlib = function() {};4748/**49* @param {zlib.Options} options50* @constructor51* @extends zlib.Zlib52*/53zlib.Gzip = function(options) {};5455/**56* @param {zlib.Options} options57* @constructor58* @extends zlib.Zlib59*/60zlib.Gunzip = function(options) {};6162/**63* @param {zlib.Options} options64* @constructor65* @extends zlib.Zlib66*/67zlib.Deflate = function(options) {};6869/**70* @param {zlib.Options} options71* @constructor72* @extends zlib.Zlib73*/74zlib.Inflate = function(options) {};7576/**77* @param {zlib.Options} options78* @constructor79* @extends zlib.Zlib80*/81zlib.DeflateRaw = function(options) {};8283/**84* @param {zlib.Options} options85* @constructor86* @extends zlib.Zlib87*/88zlib.InflateRaw = function(options) {};8990/**91* @param {zlib.Options} options92* @constructor93* @extends zlib.Zlib94*/95zlib.Unzip = function(options) {};96979899/**100* @param {zlib.Options} options101* @return {zlib.Gzip}102*/103zlib.createGzip = function(options) {};104105/**106* @param {zlib.Options} options107* @return {zlib.Gunzip}108*/109zlib.createGunzip = function(options) {};110111/**112* @param {zlib.Options} options113* @return {zlib.Deflate}114*/115zlib.createDeflate = function(options) {};116/**117* @param {zlib.Options} options118* @return {zlib.Inflate}119*/120zlib.createInflate = function(options) {};121122/**123* @param {zlib.Options} options124* @return {zlib.DeflateRaw}125*/126zlib.createDeflateRaw = function(options) {};127128/**129* @param {zlib.Options} options130* @return {zlib.InflateRaw}131*/132zlib.createInflateRaw = function(options) {};133134/**135* @param {zlib.Options} options136* @return {zlib.Unzip}137*/138zlib.createUnzip = function(options) {};139140141142/**143* @param {string|nodeBuffer.Buffer} buf144* @param {function(...)} callback145*/146zlib.deflate = function(buf, callback) {};147148/**149* @param {string|nodeBuffer.Buffer} buf150* @param {function(...)} callback151*/152zlib.deflateRaw = function(buf, callback) {};153154/**155* @param {string|nodeBuffer.Buffer} buf156* @param {function(...)} callback157*/158zlib.gzip = function(buf, callback) {};159160/**161* @param {string|nodeBuffer.Buffer} buf162* @param {function(...)} callback163*/164zlib.gunzip = function(buf, callback) {};165166/**167* @param {string|nodeBuffer.Buffer} buf168* @param {function(...)} callback169*/170zlib.inflate = function(buf, callback) {};171172/**173* @param {string|nodeBuffer.Buffer} buf174* @param {function(...)} callback175*/176zlib.inflateRaw = function(buf, callback) {};177178/**179* @param {string|nodeBuffer.Buffer} buf180* @param {function(...)} callback181*/182zlib.unzip = function(buf, callback) {};183184185186/**187* @type {number}188* @const189*/190zlib.Z_NO_FLUSH = 0;191192/**193* @type {number}194* @const195*/196zlib.Z_PARTIAL_FLUSH = 1;197198/**199* @type {number}200* @const201*/202zlib.Z_SYNC_FLUSH = 2;203204/**205* @type {number}206* @const207*/208zlib.Z_FULL_FLUSH = 3;209210/**211* @type {number}212* @const213*/214zlib.Z_FINISH = 4;215216/**217* @type {number}218* @const219*/220zlib.Z_BLOCK = 5;221222/**223* @type {number}224* @const225*/226zlib.Z_TREES = 6;227228229230/**231* @type {number}232* @const233*/234zlib.Z_OK = 0;235236/**237* @type {number}238* @const239*/240zlib.Z_STREAM_END = 1;241242/**243* @type {number}244* @const245*/246zlib.Z_NEED_DICT = 2;247248/**249* @type {number}250* @const251*/252zlib.Z_ERRNO = -1;253254/**255* @type {number}256* @const257*/258zlib.Z_STREAM_ERROR = -2;259260/**261* @type {number}262* @const263*/264zlib.Z_DATA_ERROR = -3;265266/**267* @type {number}268* @const269*/270zlib.Z_MEM_ERROR = -4;271272/**273* @type {number}274* @const275*/276zlib.Z_BUF_ERROR = -5;277278/**279* @type {number}280* @const281*/282zlib.Z_VERSION_ERROR = -6;283284285286/**287* @type {number}288* @const289*/290zlib.Z_NO_COMPRESSION = 0;291292/**293* @type {number}294* @const295*/296zlib.Z_BEST_SPEED = 1;297298/**299* @type {number}300* @const301*/302zlib.Z_BEST_COMPRESSION = 9;303304/**305* @type {number}306* @const307*/308zlib.Z_DEFAULT_COMPRESSION = -1;309310311312/**313* @type {number}314* @const315*/316zlib.Z_FILTERED = 1;317318/**319* @type {number}320* @const321*/322zlib.Z_HUFFMAN_ONLY = 2;323324/**325* @type {number}326* @const327*/328zlib.Z_RLE = 3;329330/**331* @type {number}332* @const333*/334zlib.Z_FIXED = 4;335336/**337* @type {number}338* @const339*/340zlib.Z_DEFAULT_STRATEGY = 0;341342343344/**345* @type {number}346* @const347*/348zlib.Z_BINARY = 0;349350/**351* @type {number}352* @const353*/354zlib.Z_TEXT = 1;355356/**357* @type {number}358* @const359*/360zlib.Z_ASCII = 1;361362/**363* @type {number}364* @const365*/366zlib.Z_UNKNOWN = 2;367368369370/**371* @type {number}372* @const373*/374zlib.Z_DEFLATED = 8;375376377378/**379* @type {number}380* @const381*/382zlib.Z_NULL = 0;383384385