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 | |
parent | 9b8dc66c9f95baa9400a4d925ed0ea609154b7d1 (diff) |
Move text-encoding types into repo so i can hack it.
It is unchanged in this commit.
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | text-encoding.d.ts | 60 | ||||
-rw-r--r-- | yarn.lock | 4 |
3 files changed, 60 insertions, 5 deletions
diff --git a/package.json b/package.json index 2a6288c40..991b7ef92 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 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; +} @@ -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" |