-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.d.ts
78 lines (67 loc) · 2.15 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
export type Bytes = Uint8Array | Buffer;
import {Transform} from 'stream';
/**
* Compress a byte stream to a RFC 1950 zlib data format byte stream.
*
* @param input
* @param [compressionLevel=6]
* @param [chunkSize=0x8000]
*/
export function deflate<T extends Bytes>(input: T, compressionLevel?: number, chunkSize?: number): T;
/**
* Compress a byte stream to a RFC 1951 deflate byte stream.
*
* @param input
* @param [compressionLevel=6]
* @param [chunkSize=0x8000]
*/
export function rawDeflate<T extends Bytes>(input: T, compressionLevel?: number, chunkSize?: number): T;
/**
* Decompress a RFC 1950 zlib data format byte stream.
*
* @export
* @template T
* @param {T} input
* @param {number} [chunkSize]
* @returns {T}
*/
export function inflate<T extends Bytes>(input: T, chunkSize?: number): T;
/**
* Decompress a RFC 1951 deflate byte stream.
*
* @param input
* @param [compressionLevel=6]
* @param [chunkSize=0x8000]
*/
export function rawInflate<T extends Bytes>(input: T, chunkSize?: number): T;
export interface BrowserDeflateStreamParams {
input: Uint8Array
streamFn: (chunk: Uint8Array) => any
compressionLevel?: number
shareMemory?: boolean
chunkSize?: number
}
export interface BrowserInflateStreamParams {
input: Uint8Array
streamFn: (chunk: Uint8Array) => any
shareMemory?: boolean
chunkSize?: number
}
interface BrowserStreamFuncs {
deflate: (params: BrowserDeflateStreamParams) => void
rawDeflate: (params: BrowserDeflateStreamParams) => void
inflate: (params: BrowserInflateStreamParams) => void
rawInflate: (params: BrowserInflateStreamParams) => void
}
export var stream: BrowserStreamFuncs;
export interface NodeDeflateStreamParams {
compressionLevel?: number
chunkSize?: number
}
export interface NodeInflateStreamParams {
chunkSize?: number
}
export function createDeflateStream(params: NodeDeflateStreamParams): Transform;
export function createRawDeflateStream(params: NodeDeflateStreamParams): Transform;
export function createInflateStream(params: NodeInflateStreamParams): Transform;
export function createRawInflateStream(params: NodeInflateStreamParams): Transform;