0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-29 08:58:01 -04:00
denoland-deno/text-encoding.d.ts
Ryan Dahl bbcdc9b488 Move text-encoding types into repo so i can hack it.
It is unchanged in this commit.
2018-05-27 14:13:36 -04:00

60 lines
1.6 KiB
TypeScript

// Type definitions for text-encoding
// Project: https://github.com/inexorabletash/text-encoding
// Definitions by: MIZUNE Pine <https://github.com/pine613>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace 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?: ArrayBuffer | ArrayBufferView, options?: TextDecodeOptions): string;
}
interface TextEncoder {
encoding: string;
encode(input?: string, options?: TextEncodeOptions): Uint8Array;
}
interface TextEncodeOptions {
stream?: boolean;
}
interface TextEncoderStatic {
(utfLabel?: string, options?: TextEncoderOptions): TextEncoder;
new (utfLabel?: string, options?: TextEncoderOptions): TextEncoder;
}
interface TextDecoderStatic {
(label?: string, options?: TextDecoderOptions): TextDecoder;
new (label?: string, options?: TextDecoderOptions): TextDecoder;
}
interface TextEncodingStatic {
TextEncoder: TextEncoderStatic;
TextDecoder: TextDecoderStatic;
}
}
declare var TextDecoder: TextEncoding.TextDecoderStatic;
declare var TextEncoder: TextEncoding.TextEncoderStatic;
declare var TextEncoding: TextEncoding.TextEncodingStatic;
declare module "text-encoding" {
export = TextEncoding;
}