Decoder.d.ts 488 B

123456789101112
  1. import { Stream } from "./Stream";
  2. /** @interface */
  3. export interface Decoder {
  4. /**
  5. * @param {Stream} stream The stream of bytes being decoded.
  6. * @param {number} bite The next byte read from the stream.
  7. * @return {?(number|!Array.<number>)} The next code point(s)
  8. * decoded, or null if not enough data exists in the input
  9. * stream to decode a complete code point, or |finished|.
  10. */
  11. handler(stream: Stream, bite: number): number | number[];
  12. }