UTF16Decoder.d.ts 834 B

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