mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
use native DOM types for text-encoding module
This commit is contained in:
59
types/text-encoding/index.d.ts
vendored
59
types/text-encoding/index.d.ts
vendored
@@ -1,60 +1,9 @@
|
||||
// Type definitions for text-encoding
|
||||
// Project: https://github.com/inexorabletash/text-encoding
|
||||
// Definitions by: MIZUNE Pine <https://github.com/pine613>
|
||||
// Mohsen Azimi <https://github.com/mohsen1>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
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;
|
||||
}
|
||||
export const TextEncoder: TextEncoder;
|
||||
export const TextDecoder: TextDecoder;
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"lib": ["dom", "es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"text-encoding-tests.ts"
|
||||
]
|
||||
}
|
||||
"files": ["index.d.ts", "text-encoding-tests.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user