SingleByteEncoder.d.ts 622 B

123456789101112131415161718192021
  1. import { Stream } from "../../common";
  2. /**
  3. * @constructor
  4. * @implements {Encoder}
  5. * @param {!Array.<?number>} index The encoding index.
  6. * @param {{fatal: boolean}} options
  7. */
  8. export declare class SingleByteEncoder {
  9. private index;
  10. readonly fatal: boolean;
  11. constructor(index: (number | null)[], options: {
  12. fatal: boolean;
  13. });
  14. /**
  15. * @param {Stream} stream Input stream.
  16. * @param {number} code_point Next code point read from the stream.
  17. * @return {(number|!Array.<number>)} Byte(s) to emit.
  18. */
  19. handler(stream: Stream, code_point: number): (number | Array<number>);
  20. }