Skip to content

Commit

Permalink
Move text-encoding types into repo so i can hack it.
Browse files Browse the repository at this point in the history
It is unchanged in this commit.
  • Loading branch information
ry committed May 27, 2018
1 parent 9b8dc66 commit bbcdc9b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
60 changes: 60 additions & 0 deletions text-encoding.d.ts
Original file line number Diff line number Diff line change
@@ -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;
}
4 changes: 0 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit bbcdc9b

Please sign in to comment.