UNPKG

@kayahr/text-encoding

Version:
33 lines (32 loc) 1.01 kB
import { AbstractDecoder } from "../AbstractDecoder.ts"; import { type ByteBuffer } from "../ByteBuffer.ts"; /** * Base class for UTF-16 decoders. */ export declare abstract class UTF16Decoder extends AbstractDecoder { private readonly bigEndian; private leadByte; private leadSurrogate; /** * @param bigEndian - True for utf-16be, false for utf-16le. * @param fatal - True to throw an exception when a character can't be decoded. False to decode to a * replacement character instead. */ constructor(bigEndian: boolean, fatal?: boolean); /** @inheritdoc */ decode(buffer: ByteBuffer): number | number[] | null; } /** * Decoder for utf-16le encoding. */ export declare class UTF16LEDecoder extends UTF16Decoder { /** @inheritdoc */ constructor(fatal?: boolean); } /** * Decoder for utf-16be encoding. */ export declare class UTF16BEDecoder extends UTF16Decoder { /** @inheritdoc */ constructor(fatal?: boolean); }