From bbcdc9b488b0674bb424b3eb58a8586c4d73f9bd Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 27 May 2018 14:13:33 -0400 Subject: [PATCH] Move text-encoding types into repo so i can hack it. It is unchanged in this commit. --- package.json | 1 - text-encoding.d.ts | 60 ++++++++++++++++++++++++++++++++++++++++++++++ yarn.lock | 4 ---- 3 files changed, 60 insertions(+), 5 deletions(-) create mode 100644 text-encoding.d.ts diff --git a/package.json b/package.json index 2a6288c403..991b7ef922 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,6 @@ "devDependencies": { "@types/base64-js": "^1.2.5", "@types/source-map-support": "^0.4.0", - "@types/text-encoding": "^0.0.32", "babel-polyfill": "^6.26.0", "base64-js": "^1.3.0", "espree": "^3.5.3", diff --git a/text-encoding.d.ts b/text-encoding.d.ts new file mode 100644 index 0000000000..d86ee007fb --- /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 +// 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; +} diff --git a/yarn.lock b/yarn.lock index 708b5dd01d..34fd5eba42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -67,10 +67,6 @@ dependencies: "@types/node" "*" -"@types/text-encoding@^0.0.32": - version "0.0.32" - resolved "https://registry.yarnpkg.com/@types/text-encoding/-/text-encoding-0.0.32.tgz#52289b320a406850b14f08f48b475ca021218048" - abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"