DefinitelyTyped/types/mz/zlib.d.ts
ExE Boss 6c73b9964e feat(mz): Update to v2.7 (#39277)
* feat(mz): Update to v2.7

* fix(mz): Keep support for TypeScript 2.0

* fix(mz): Add myself to the contributors list

* test(mz): Refactor tests to remove override in `.editorconfig`

* chore(mz): Remove `.editorconfig` 😡️

* fix(mz): Fix name of `dest` parameter in `fs.copyFile(…)`

* refactor(mz): Remove need for setting `"unified‑signatures": false`
2019-11-22 08:46:01 -08:00

96 lines
3.7 KiB
TypeScript

// Modified from the node.js definitions.
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/zlib.d.ts
import { InputType, CompressCallback, BrotliOptions, ZlibOptions } from "zlib";
export * from "zlib";
/**
* Compress the buffer using the **Brotli Compression** algorithm.
*
* @param buf The buffer.
* @param options The compression options.
*/
export function brotliCompress(buf: InputType, callback: CompressCallback): void;
export function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
export function brotliCompress(buf: InputType, options?: BrotliOptions): Promise<Buffer>;
/**
* Decompress the buffer using the **Brotli Compression** algorithm.
*
* @param buf The buffer.
* @param options The compression options.
*/
export function brotliDecompress(buf: InputType, callback: CompressCallback): void;
export function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
export function brotliDecompress(buf: InputType, options?: BrotliOptions): Promise<Buffer>;
/**
* Compress the buffer using the **DEFLATE** algorithm.
*
* @param buf The buffer.
* @param options The compression options.
*/
export function deflate(buf: InputType, callback: CompressCallback): void;
export function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
export function deflate(buf: InputType, options?: ZlibOptions): Promise<Buffer>;
/**
* Compress the buffer using the **DEFLATE** algorithm.
*
* @param buf The buffer.
* @param options The compression options.
*/
export function deflateRaw(buf: InputType, callback: CompressCallback): void;
export function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
export function deflateRaw(buf: InputType, options?: ZlibOptions): Promise<Buffer>;
/**
* Compress the buffer using the **GZIP** algorithm.
*
* @param buf The buffer.
* @param options The compression options.
*/
export function gzip(buf: InputType, callback: CompressCallback): void;
export function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
export function gzip(buf: InputType, options?: ZlibOptions): Promise<Buffer>;
/**
* Decompress the buffer using the **GZIP** algorithm.
*
* @param buf The buffer.
* @param options The compression options.
*/
export function gunzip(buf: InputType, callback: CompressCallback): void;
export function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
export function gunzip(buf: InputType, options?: ZlibOptions): Promise<Buffer>;
/**
* Decompress the buffer using the **DEFLATE** algorithm.
*
* @param buf The buffer.
* @param options The compression options.
*/
export function inflate(buf: InputType, callback: CompressCallback): void;
export function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
export function inflate(buf: InputType, options?: ZlibOptions): Promise<Buffer>;
/**
* Decompress the buffer using the **DEFLATE** algorithm.
*
* @param buf The buffer.
* @param options The compression options.
*/
export function inflateRaw(buf: InputType, callback: CompressCallback): void;
export function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
export function inflateRaw(buf: InputType, options?: ZlibOptions): Promise<Buffer>;
/**
* Decompress the buffer using the **ZIP** algorithm.
*
* @param buf The buffer.
* @param options The compression options.
*/
export function unzip(buf: InputType, callback: CompressCallback): void;
export function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
export function unzip(buf: InputType, options?: ZlibOptions): Promise<Buffer>;