@kayahr/text-encoding
Version:
Text encoder and decoder
27 lines (26 loc) • 1.02 kB
TypeScript
import { AbstractDecoder } from "../AbstractDecoder.js";
import { ByteBuffer } from "../ByteBuffer.js";
import { DecoderConstructor } from "../Decoder.js";
/**
* Decoder for single byte encodings.
*/
export declare class SingleByteDecoder extends AbstractDecoder {
private readonly index;
/**
* Constructs new decoder for the given code points.
*
* @param codePoints - The code points of the encoding.
* @param fatal - True to throw an exception when a character can't be decoded. False to decode to a
* replacement character instead.
*/
private constructor();
/**
* Creates and returns a single byte decoder class for the given code points.
*
* @param codePoints - The code points of the encoding to decode.
* @return The created single byte decoder class.
*/
static forCodePoints(codePoints: Array<number | null>): DecoderConstructor;
/** @inheritDoc */
decode(buffer: ByteBuffer): number | number[] | null;
}