1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | declare module 'iconv-lite' {
|
9 |
|
10 | export function decode(buffer: Buffer, encoding: string, options?: Options): string;
|
11 |
|
12 | export function encode(content: string, encoding: string, options?: Options): Buffer;
|
13 |
|
14 | export function encodingExists(encoding: string): boolean;
|
15 |
|
16 |
|
17 | export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
|
18 |
|
19 | export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
|
20 |
|
21 |
|
22 | export function getEncoder(encoding: string, options?: Options): EncoderStream;
|
23 |
|
24 | export function getDecoder(encoding: string, options?: Options): DecoderStream;
|
25 | }
|
26 |
|
27 | export interface Options {
|
28 | stripBOM?: boolean;
|
29 | addBOM?: boolean;
|
30 | defaultEncoding?: string;
|
31 | }
|
32 |
|
33 | export interface EncoderStream {
|
34 | write(str: string): Buffer;
|
35 | end(): Buffer | undefined;
|
36 | }
|
37 |
|
38 | export interface DecoderStream {
|
39 | write(buf: Buffer): string;
|
40 | end(): string | undefined;
|
41 | }
|