Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/third_party/closure-compiler/node-externs/zlib.js
6174 views
1
/*
2
* Copyright 2012 The Closure Compiler Authors.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
/**
18
* @fileoverview Definitions for node's zlib module. Depends on the events and buffer modules.
19
* @see http://nodejs.org/api/zlib.html
20
* @see https://github.com/joyent/node/blob/master/lib/zlib.js
21
* @externs
22
* @author Daniel Wirtz <[email protected]>
23
*/
24
25
/**
26
BEGIN_NODE_INCLUDE
27
var zlib = require('zlib');
28
END_NODE_INCLUDE
29
*/
30
31
/**
32
* @type {Object.<string,*>}
33
*/
34
var zlib = {};
35
36
/**
37
* @typedef {{chunkSize: ?number, windowBits: ?number, level: ?number, memLevel: ?number, strategy: ?number, dictionary: ?Object}}
38
*/
39
zlib.Options;
40
41
42
43
/**
44
* @constructor
45
* @extends stream.Transform
46
*/
47
zlib.Zlib = function() {};
48
49
/**
50
* @param {zlib.Options} options
51
* @constructor
52
* @extends zlib.Zlib
53
*/
54
zlib.Gzip = function(options) {};
55
56
/**
57
* @param {zlib.Options} options
58
* @constructor
59
* @extends zlib.Zlib
60
*/
61
zlib.Gunzip = function(options) {};
62
63
/**
64
* @param {zlib.Options} options
65
* @constructor
66
* @extends zlib.Zlib
67
*/
68
zlib.Deflate = function(options) {};
69
70
/**
71
* @param {zlib.Options} options
72
* @constructor
73
* @extends zlib.Zlib
74
*/
75
zlib.Inflate = function(options) {};
76
77
/**
78
* @param {zlib.Options} options
79
* @constructor
80
* @extends zlib.Zlib
81
*/
82
zlib.DeflateRaw = function(options) {};
83
84
/**
85
* @param {zlib.Options} options
86
* @constructor
87
* @extends zlib.Zlib
88
*/
89
zlib.InflateRaw = function(options) {};
90
91
/**
92
* @param {zlib.Options} options
93
* @constructor
94
* @extends zlib.Zlib
95
*/
96
zlib.Unzip = function(options) {};
97
98
99
100
/**
101
* @param {zlib.Options} options
102
* @return {zlib.Gzip}
103
*/
104
zlib.createGzip = function(options) {};
105
106
/**
107
* @param {zlib.Options} options
108
* @return {zlib.Gunzip}
109
*/
110
zlib.createGunzip = function(options) {};
111
112
/**
113
* @param {zlib.Options} options
114
* @return {zlib.Deflate}
115
*/
116
zlib.createDeflate = function(options) {};
117
/**
118
* @param {zlib.Options} options
119
* @return {zlib.Inflate}
120
*/
121
zlib.createInflate = function(options) {};
122
123
/**
124
* @param {zlib.Options} options
125
* @return {zlib.DeflateRaw}
126
*/
127
zlib.createDeflateRaw = function(options) {};
128
129
/**
130
* @param {zlib.Options} options
131
* @return {zlib.InflateRaw}
132
*/
133
zlib.createInflateRaw = function(options) {};
134
135
/**
136
* @param {zlib.Options} options
137
* @return {zlib.Unzip}
138
*/
139
zlib.createUnzip = function(options) {};
140
141
142
143
/**
144
* @param {string|nodeBuffer.Buffer} buf
145
* @param {function(...)} callback
146
*/
147
zlib.deflate = function(buf, callback) {};
148
149
/**
150
* @param {string|nodeBuffer.Buffer} buf
151
* @param {function(...)} callback
152
*/
153
zlib.deflateRaw = function(buf, callback) {};
154
155
/**
156
* @param {string|nodeBuffer.Buffer} buf
157
* @param {function(...)} callback
158
*/
159
zlib.gzip = function(buf, callback) {};
160
161
/**
162
* @param {string|nodeBuffer.Buffer} buf
163
* @param {function(...)} callback
164
*/
165
zlib.gunzip = function(buf, callback) {};
166
167
/**
168
* @param {string|nodeBuffer.Buffer} buf
169
* @param {function(...)} callback
170
*/
171
zlib.inflate = function(buf, callback) {};
172
173
/**
174
* @param {string|nodeBuffer.Buffer} buf
175
* @param {function(...)} callback
176
*/
177
zlib.inflateRaw = function(buf, callback) {};
178
179
/**
180
* @param {string|nodeBuffer.Buffer} buf
181
* @param {function(...)} callback
182
*/
183
zlib.unzip = function(buf, callback) {};
184
185
186
187
/**
188
* @type {number}
189
* @const
190
*/
191
zlib.Z_NO_FLUSH = 0;
192
193
/**
194
* @type {number}
195
* @const
196
*/
197
zlib.Z_PARTIAL_FLUSH = 1;
198
199
/**
200
* @type {number}
201
* @const
202
*/
203
zlib.Z_SYNC_FLUSH = 2;
204
205
/**
206
* @type {number}
207
* @const
208
*/
209
zlib.Z_FULL_FLUSH = 3;
210
211
/**
212
* @type {number}
213
* @const
214
*/
215
zlib.Z_FINISH = 4;
216
217
/**
218
* @type {number}
219
* @const
220
*/
221
zlib.Z_BLOCK = 5;
222
223
/**
224
* @type {number}
225
* @const
226
*/
227
zlib.Z_TREES = 6;
228
229
230
231
/**
232
* @type {number}
233
* @const
234
*/
235
zlib.Z_OK = 0;
236
237
/**
238
* @type {number}
239
* @const
240
*/
241
zlib.Z_STREAM_END = 1;
242
243
/**
244
* @type {number}
245
* @const
246
*/
247
zlib.Z_NEED_DICT = 2;
248
249
/**
250
* @type {number}
251
* @const
252
*/
253
zlib.Z_ERRNO = -1;
254
255
/**
256
* @type {number}
257
* @const
258
*/
259
zlib.Z_STREAM_ERROR = -2;
260
261
/**
262
* @type {number}
263
* @const
264
*/
265
zlib.Z_DATA_ERROR = -3;
266
267
/**
268
* @type {number}
269
* @const
270
*/
271
zlib.Z_MEM_ERROR = -4;
272
273
/**
274
* @type {number}
275
* @const
276
*/
277
zlib.Z_BUF_ERROR = -5;
278
279
/**
280
* @type {number}
281
* @const
282
*/
283
zlib.Z_VERSION_ERROR = -6;
284
285
286
287
/**
288
* @type {number}
289
* @const
290
*/
291
zlib.Z_NO_COMPRESSION = 0;
292
293
/**
294
* @type {number}
295
* @const
296
*/
297
zlib.Z_BEST_SPEED = 1;
298
299
/**
300
* @type {number}
301
* @const
302
*/
303
zlib.Z_BEST_COMPRESSION = 9;
304
305
/**
306
* @type {number}
307
* @const
308
*/
309
zlib.Z_DEFAULT_COMPRESSION = -1;
310
311
312
313
/**
314
* @type {number}
315
* @const
316
*/
317
zlib.Z_FILTERED = 1;
318
319
/**
320
* @type {number}
321
* @const
322
*/
323
zlib.Z_HUFFMAN_ONLY = 2;
324
325
/**
326
* @type {number}
327
* @const
328
*/
329
zlib.Z_RLE = 3;
330
331
/**
332
* @type {number}
333
* @const
334
*/
335
zlib.Z_FIXED = 4;
336
337
/**
338
* @type {number}
339
* @const
340
*/
341
zlib.Z_DEFAULT_STRATEGY = 0;
342
343
344
345
/**
346
* @type {number}
347
* @const
348
*/
349
zlib.Z_BINARY = 0;
350
351
/**
352
* @type {number}
353
* @const
354
*/
355
zlib.Z_TEXT = 1;
356
357
/**
358
* @type {number}
359
* @const
360
*/
361
zlib.Z_ASCII = 1;
362
363
/**
364
* @type {number}
365
* @const
366
*/
367
zlib.Z_UNKNOWN = 2;
368
369
370
371
/**
372
* @type {number}
373
* @const
374
*/
375
zlib.Z_DEFLATED = 8;
376
377
378
379
/**
380
* @type {number}
381
* @const
382
*/
383
zlib.Z_NULL = 0;
384
385