UNPKG

@kayahr/text-encoding

Version:
25 lines (24 loc) 858 B
import { AbstractEncoder } from "../AbstractEncoder.ts"; import { type ByteBuffer } from "../ByteBuffer.ts"; import type { EncoderConstructor } from "../Encoder.ts"; /** * Encoder for single byte encodings. */ export declare class SingleByteEncoder extends AbstractEncoder { private readonly index; /** * Constructs new encoder for the given code points. * * @param codePoints - The code points of the encoding. */ private constructor(); /** * Creates and returns a single byte encoder class for the given code points. * * @param codePoints - The code points of the encoding to encode. * @returns The created single byte encoder class. */ static forCodePoints(codePoints: Array<number | null>): EncoderConstructor; /** @inheritdoc */ encode(buffer: ByteBuffer): number | number[]; }