forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
text-encoding.d.ts
45 lines (37 loc) · 1.31 KB
/
text-encoding.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
// Type definitions for text-encoding
// Project: https://github.com/inexorabletash/text-encoding
// Definitions by: MIZUNE Pine <https://github.com/pine613/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module TextEncoding {
interface TextDecoderOptions {
fatal?: boolean;
ignoreBOM?: boolean;
}
interface TextDecodeOptions {
stream?: boolean;
}
interface TextEncoderOptions {
NONSTANDARD_allowLegacyEncoding?: boolean;
}
interface TextDecoder {
encoding: string;
fatal: boolean;
ignoreBOM: boolean;
decode(input?: ArrayBufferView, options?: TextDecodeOptions): string;
}
interface TextEncoder {
encoding: string;
encode(input?: string, options?: TextEncodeOptions): Uint8Array;
}
interface TextEncodeOptions {
stream?: boolean;
}
}
declare var TextDecoder: {
(label?: string, options?: TextEncoding.TextDecoderOptions): TextEncoding.TextDecoder;
new (label?: string, options?: TextEncoding.TextDecoderOptions): TextEncoding.TextDecoder;
};
declare var TextEncoder: {
(utfLabel?: string, options?: TextEncoding.TextEncoderOptions): TextEncoding.TextEncoder;
new (utfLabel?: string, options?: TextEncoding.TextEncoderOptions): TextEncoding.TextEncoder;
};