diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-05-27 14:13:33 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-27 14:13:36 -0400 |
commit | bbcdc9b488b0674bb424b3eb58a8586c4d73f9bd (patch) | |
tree | 1bfa3458168108fc5a10f6a2f50692827e031a00 /text-encoding.d.ts | |
parent | 9b8dc66c9f95baa9400a4d925ed0ea609154b7d1 (diff) |
Move text-encoding types into repo so i can hack it.
It is unchanged in this commit.
Diffstat (limited to 'text-encoding.d.ts')
-rw-r--r-- | text-encoding.d.ts | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/text-encoding.d.ts b/text-encoding.d.ts new file mode 100644 index 000000000..d86ee007f --- /dev/null +++ b/text-encoding.d.ts @@ -0,0 +1,60 @@ +// 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; +} |