encodings.d.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @param {boolean} fatal If true, decoding errors raise an exception.
  3. * @param {number=} opt_code_point Override the standard fallback code point.
  4. * @return {number} The code point to insert on a decoding error.
  5. */
  6. export declare function decoderError(fatal: boolean, opt_code_point?: number | undefined): number;
  7. /**
  8. * @param {number} code_point The code point that could not be encoded.
  9. * @return {number} Always throws, no value is actually returned.
  10. */
  11. export declare function encoderError(code_point: number): number;
  12. /**
  13. * @param {string} label The encoding label.
  14. * @return {?{name:string,labels:Array.<string>}}
  15. */
  16. export declare function getEncoding(label: string): {
  17. name: string;
  18. labels: Array<string>;
  19. } | null;
  20. /**
  21. * Encodings table: https://encoding.spec.whatwg.org/encodings.json
  22. * @const
  23. * @type {!Array.<{
  24. * heading: string,
  25. * encodings: Array.<{name:string,labels:Array.<string>}>
  26. * }>}
  27. */
  28. declare const encodings: {
  29. heading: string;
  30. encodings: {
  31. name: string;
  32. labels: string[];
  33. }[];
  34. }[];
  35. export { encodings };