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(
|
2020-06-19 15:27:49 +03:00
|
|
|
buffer: Uint8Array,
|
2020-06-02 02:50:42 +03:00
|
|
|
encoding: string,
|
|
|
|
options?: Options
|
|
|
|
): string;
|
|
|
|
|
|
|
|
export function encode(
|
|
|
|
content: string,
|
|
|
|
encoding: string,
|
|
|
|
options?: Options
|
2020-06-19 15:27:49 +03:00
|
|
|
): 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 {
|
2020-06-19 15:02:30 +03:00
|
|
|
write(str: string): Uint8Array;
|
|
|
|
end(): Uint8Array | undefined;
|
2020-06-02 02:50:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface DecoderStream {
|
2020-06-19 15:02:30 +03:00
|
|
|
write(buf: Uint8Array): string;
|
2020-06-02 02:50:42 +03:00
|
|
|
end(): string | undefined;
|
|
|
|
}
|