UTF8Decoder.d.ts 817 B

1234567891011121314151617181920212223242526
  1. import { Stream } from "../../common/Stream";
  2. /**
  3. * @constructor
  4. * @implements {Decoder}
  5. * @param {{fatal: boolean}} options
  6. */
  7. export declare class UTF8Decoder {
  8. readonly fatal: boolean;
  9. utf8_code_point: number;
  10. utf8_bytes_seen: number;
  11. utf8_bytes_needed: number;
  12. utf8_lower_boundary: number;
  13. utf8_upper_boundary: number;
  14. constructor(options: {
  15. fatal: boolean;
  16. });
  17. /**
  18. * @param {Stream} stream The stream of bytes being decoded.
  19. * @param {number} bite The next byte read from the stream.
  20. * @return {?(number|!Array.<number>)} The next code point(s)
  21. * decoded, or null if not enough data exists in the input
  22. * stream to decode a complete code point.
  23. */
  24. handler(stream: Stream, bite: number): (number | Array<number>) | null;
  25. }