File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 6
6
*--------------------------------------------------------------------------------------------*/
7
7
8
8
declare module 'iconv-lite' {
9
+ // Basic API
9
10
export function decode ( buffer : Buffer , encoding : string , options ?: Options ) : string ;
10
11
11
12
export function encode ( content : string , encoding : string , options ?: Options ) : Buffer ;
12
13
13
14
export function encodingExists ( encoding : string ) : boolean ;
14
15
16
+ // Stream API
15
17
export function decodeStream ( encoding : string , options ?: Options ) : NodeJS . ReadWriteStream ;
16
18
17
19
export function encodeStream ( encoding : string , options ?: Options ) : NodeJS . ReadWriteStream ;
20
+
21
+ // Low-level stream APIs
22
+ export function getEncoder ( encoding : string , options ?: Options ) : EncoderStream ;
23
+
24
+ export function getDecoder ( encoding : string , options ?: Options ) : DecoderStream ;
18
25
}
19
26
20
27
export interface Options {
21
28
stripBOM ?: boolean ;
22
29
addBOM ?: boolean ;
23
30
defaultEncoding ?: string ;
24
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
+ }
You can’t perform that action at this time.
0 commit comments