UNPKG

@kayahr/text-encoding

Version:
33 lines (32 loc) 1 kB
import { AbstractDecoder } from "../AbstractDecoder.js"; import { ByteBuffer } from "../ByteBuffer.js"; /** * 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); }