forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iconv.d.ts
39 lines (29 loc) · 1.27 KB
/
iconv.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
// Type definitions for iconv 2.1.11
// Project: https://github.com/bnoordhuis/node-iconv
// Definitions by: delphinus <https://github.com/delphinus35/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../node/node.d.ts" />
declare namespace Iconv {
interface Static {
new(fromEncoding: string, toEncoding: string): Iconv;
(fromEncoding: string, toEncoding: string): Iconv;
}
interface Iconv extends NodeJS.WritableStream {
writable: boolean;
convert(input: string | Buffer, encoding?: string): Buffer;
write(input: string | Buffer, encoding?: string): boolean;
end(input?: string | Buffer, encoding?: string): void;
// copy from NodeJS.WritableStream for compatibility
write(buffer: Buffer|string, cb?: Function): boolean;
write(str: string, encoding?: string, cb?: Function): boolean;
end(): void;
end(buffer: Buffer, cb?: Function): void;
end(str: string, cb?: Function): void;
end(str: string, encoding?: string, cb?: Function): void;
// copy from stream.Stream
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
}
}
declare module "iconv" {
var Iconv: Iconv.Static;
}