vscode-iconv-lite-umd/iconv-lite-umd.d.ts

57 строки
1.5 KiB
TypeScript
Исходник Постоянная ссылка Обычный вид История

2020-06-02 02:50:42 +03:00
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
* REQUIREMENT: This definition is dependent on the @types/node definition.
* Install with `npm install @types/node --save-dev`
*--------------------------------------------------------------------------------------------*/
2022-01-13 18:38:54 +03:00
declare module "@vscode/iconv-lite-umd" {
2020-06-02 02:50:42 +03:00
// Basic API
export function decode(
buffer: Uint8Array,
2020-06-02 02:50:42 +03:00
encoding: string,
options?: Options
): string;
export function encode(
content: string,
encoding: string,
options?: Options
): Uint8Array;
2020-06-02 02:50:42 +03:00
export function encodingExists(encoding: string): boolean;
2020-06-09 02:30:44 +03:00
// Stream API
2020-06-02 02:50:42 +03:00
// WARNING: Excluded because it is specific to node.
2020-06-09 02:30:44 +03:00
// export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
2020-06-02 02:50:42 +03:00
2020-06-09 02:30:44 +03:00
// export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
2020-06-02 02:50:42 +03:00
// Low-level stream APIs
export function getEncoder(
encoding: string,
options?: Options
): EncoderStream;
export function getDecoder(
encoding: string,
options?: Options
): DecoderStream;
}
export interface Options {
stripBOM?: boolean;
addBOM?: boolean;
defaultEncoding?: string;
}
export interface EncoderStream {
write(str: string): Uint8Array;
end(): Uint8Array | undefined;
2020-06-02 02:50:42 +03:00
}
export interface DecoderStream {
write(buf: Uint8Array): string;
2020-06-02 02:50:42 +03:00
end(): string | undefined;
}