diff options
author | Mohsen Azimi <me@azimi.me> | 2018-06-01 23:20:33 +0300 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-06-01 22:20:33 +0200 |
commit | 7b5fbc71970056515c41f6983fc8e1f8ee443d11 (patch) | |
tree | 55e81b9e705141de9096fc93351a811fc1067c8f /text-encoding.d.ts | |
parent | 6cef88a09a8e5ac80018c6e7aa5dd218d11d591d (diff) |
Remove text-encoding.d.ts - the declarations are included in TS (#6)
Diffstat (limited to 'text-encoding.d.ts')
-rw-r--r-- | text-encoding.d.ts | 71 |
1 files changed, 4 insertions, 67 deletions
diff --git a/text-encoding.d.ts b/text-encoding.d.ts index 014c95eff..6feadad9c 100644 --- a/text-encoding.d.ts +++ b/text-encoding.d.ts @@ -1,69 +1,6 @@ -// 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; - } -} - -/* Removed following lines to workaround this bug: - text-encoding.d.ts:52:13 - error TS2403: Subsequent variable declarations - must have the same type. Variable 'TextDecoder' must be of type '{ new - (label?: string, options?: TextDecoderOptions): TextDecoder; prototype: - TextDecoder; }', but here has type 'TextDecoderStatic'. - - 52 declare var TextDecoder: TextEncoding.TextDecoderStatic; - */ -// declare var TextDecoder: TextEncoding.TextDecoderStatic; -// declare var TextEncoder: TextEncoding.TextEncoderStatic; -declare var TextEncoding: TextEncoding.TextEncodingStatic; - +// Remove and depend on @types/text-encoding once this PR is merged +// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/26141 declare module "text-encoding" { - export = TextEncoding; + export const TextEncoder: TextEncoder; + export const TextDecoder: TextDecoder; } |