forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move text-encoding types into repo so i can hack it.
It is unchanged in this commit.
- Loading branch information
Showing
3 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters