@@ -72,6 +72,16 @@ export function createInflate(options?: any): Inflate {
72
72
return intrinsic ( ) . createInflate ( options ) ;
73
73
}
74
74
75
+ /**
76
+ * Creates a readable stream which decompresses data using the zip algorithm.
77
+ *
78
+ * @param options Zlib options to apply to this stream. Optional.
79
+ * @returns Inflation stream
80
+ */
81
+ export function createUnzip ( options ?: any ) : Inflate {
82
+ return intrinsic ( ) . createUnzip ( options ) ;
83
+ }
84
+
75
85
/**
76
86
* Creates a writable stream which compresses data using the Brotli algorithm.
77
87
*
@@ -97,7 +107,7 @@ export function createBrotliDecompress(options?: any): Inflate {
97
107
*
98
108
* @param data The data to compress
99
109
* @param options Zlib options to apply to this compression. Optional.
100
- * @returns The compressed data
110
+ * @param cbk Callback to invoke when the operation completes, and which receives the resulting data.
101
111
*/
102
112
export function deflate (
103
113
data : string | Buffer | DataView | any ,
@@ -125,7 +135,7 @@ export function deflateSync(data: string | Buffer | DataView | any, options?: an
125
135
*
126
136
* @param data The data to decompress
127
137
* @param options Zlib options to apply to this compression. Optional.
128
- * @returns The decompressed data
138
+ * @param cbk Callback to invoke when the operation completes, and which receives the resulting data.
129
139
*/
130
140
export function inflate (
131
141
data : string | Buffer | DataView | any ,
@@ -148,6 +158,23 @@ export function inflateSync(data: string | Buffer | DataView | any, options?: an
148
158
return intrinsic ( ) . inflateSync ( data , options ) ;
149
159
}
150
160
161
+ /**
162
+ * Asynchronously compresses the given data using the gzip algorithm.
163
+ *
164
+ * @param data The data to compress
165
+ * @param options Zlib options to apply to this compression. Optional.
166
+ * @param cbk Callback to invoke when the operation completes, and which receives the resulting data.
167
+ */
168
+ export function gzip (
169
+ data : string | Buffer | DataView | any ,
170
+ optionsOrCbk ?: any ,
171
+ cbk ?: ( errOrResult : Error | BufferLike ) => void ,
172
+ ) : Buffer {
173
+ const callback = cbk || optionsOrCbk ;
174
+ const opts = cbk ? optionsOrCbk : undefined ;
175
+ return intrinsic ( ) . gzip ( data , opts , callback ) ;
176
+ }
177
+
151
178
/**
152
179
* Synchronously compresses the given data using the gzip algorithm.
153
180
*
@@ -159,6 +186,23 @@ export function gzipSync(data: string | Buffer | DataView | any, options?: any):
159
186
return intrinsic ( ) . gzipSync ( data , options ) ;
160
187
}
161
188
189
+ /**
190
+ * Asynchronously decompresses the given data using the gzip algorithm.
191
+ *
192
+ * @param data The data to decompress
193
+ * @param options Zlib options to apply to this compression. Optional.
194
+ * @param cbk Callback to invoke when the operation completes, and which receives the resulting data.
195
+ */
196
+ export function gunzip (
197
+ data : string | Buffer | DataView | any ,
198
+ optionsOrCbk ?: any ,
199
+ cbk ?: ( errOrResult : Error | BufferLike ) => void ,
200
+ ) : Buffer {
201
+ const callback = cbk || optionsOrCbk ;
202
+ const opts = cbk ? optionsOrCbk : undefined ;
203
+ return intrinsic ( ) . gunzip ( data , opts , callback ) ;
204
+ }
205
+
162
206
/**
163
207
* Synchronously decompresses the given data using the gzip algorithm.
164
208
*
@@ -170,6 +214,23 @@ export function gunzipSync(data: string | Buffer | DataView | any, options?: any
170
214
return intrinsic ( ) . gunzipSync ( data , options ) ;
171
215
}
172
216
217
+ /**
218
+ * Asynchronously decompresses the given data using the zip algorithm.
219
+ *
220
+ * @param data The data to decompress
221
+ * @param options Zlib options to apply to this compression. Optional.
222
+ * @param cbk Callback to invoke when the operation completes, and which receives the resulting data.
223
+ */
224
+ export function unzip (
225
+ data : string | Buffer | DataView | any ,
226
+ optionsOrCbk ?: any ,
227
+ cbk ?: ( errOrResult : Error | BufferLike ) => void ,
228
+ ) : Buffer {
229
+ const callback = cbk || optionsOrCbk ;
230
+ const opts = cbk ? optionsOrCbk : undefined ;
231
+ return intrinsic ( ) . unzip ( data , opts , callback ) ;
232
+ }
233
+
173
234
/**
174
235
* Synchronously decompresses the given data using the zip algorithm.
175
236
*
@@ -186,7 +247,7 @@ export function unzipSync(data: string | Buffer | DataView | any, options?: any)
186
247
*
187
248
* @param data The data to compress
188
249
* @param options Brotli options to apply to this compression. Optional.
189
- * @returns The compressed data
250
+ * @param cbk Callback to invoke when the operation completes, and which receives the resulting data.
190
251
*/
191
252
export function brotliCompress (
192
253
data : string | Buffer | DataView | any ,
@@ -214,7 +275,7 @@ export function brotliCompressSync(data: string | Buffer | DataView | any, optio
214
275
*
215
276
* @param data The data to decompress
216
277
* @param options Brotli options to apply to this compression. Optional.
217
- * @returns The decompressed data
278
+ * @param cbk Callback to invoke when the operation completes, and which receives the resulting data.
218
279
*/
219
280
export function brotliDecompress (
220
281
data : string | Buffer | DataView | any ,
0 commit comments