TextDecoder.d.ts 1005 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. declare type TextDecoderOptions = {
  2. fatal?: boolean;
  3. ignoreBOM?: boolean;
  4. };
  5. declare type DecodeOptions = {
  6. stream?: boolean;
  7. };
  8. /**
  9. * @constructor
  10. * @param {string=} label The label of the encoding;
  11. * defaults to 'utf-8'.
  12. * @param {Object=} options
  13. */
  14. export declare class TextDecoder {
  15. private _encoding;
  16. private _decoder;
  17. private _ignoreBOM;
  18. private _BOMseen;
  19. private _error_mode;
  20. private _do_not_flush;
  21. constructor(label?: string, options?: TextDecoderOptions);
  22. get encoding(): string;
  23. get fatal(): boolean;
  24. get ignoreBOM(): boolean;
  25. /**
  26. * @param {BufferSource=} input The buffer of bytes to decode.
  27. * @param {Object=} options
  28. * @return {string} The decoded string.
  29. */
  30. decode(input?: ArrayBuffer | ArrayLike<number> | Uint8Array, options?: DecodeOptions): string;
  31. /**
  32. * @param {!Array.<number>} stream
  33. * @return {string}
  34. * @this {TextDecoder}
  35. */
  36. private serializeStream;
  37. }
  38. export {};