encode.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * Encodes all non-ASCII characters, as well as characters not valid in XML
  3. * documents using XML entities.
  4. *
  5. * If a character has no equivalent entity, a
  6. * numeric hexadecimal reference (eg. `ü`) will be used.
  7. */
  8. export declare const encodeXML: (data: string) => string;
  9. /**
  10. * Encodes all entities and non-ASCII characters in the input.
  11. *
  12. * This includes characters that are valid ASCII characters in HTML documents.
  13. * For example `#` will be encoded as `#`. To get a more compact output,
  14. * consider using the `encodeNonAsciiHTML` function.
  15. *
  16. * If a character has no equivalent entity, a
  17. * numeric hexadecimal reference (eg. `ü`) will be used.
  18. */
  19. export declare const encodeHTML: (data: string) => string;
  20. /**
  21. * Encodes all non-ASCII characters, as well as characters not valid in HTML
  22. * documents using HTML entities.
  23. *
  24. * If a character has no equivalent entity, a
  25. * numeric hexadecimal reference (eg. `ü`) will be used.
  26. */
  27. export declare const encodeNonAsciiHTML: (data: string) => string;
  28. /**
  29. * Encodes all non-ASCII characters, as well as characters not valid in XML
  30. * documents using numeric hexadecimal reference (eg. `ü`).
  31. *
  32. * Have a look at `escapeUTF8` if you want a more concise output at the expense
  33. * of reduced transportability.
  34. *
  35. * @param data String to escape.
  36. */
  37. export declare function escape(data: string): string;
  38. /**
  39. * Encodes all characters not valid in XML documents using numeric hexadecimal
  40. * reference (eg. `ü`).
  41. *
  42. * Note that the output will be character-set dependent.
  43. *
  44. * @param data String to escape.
  45. */
  46. export declare function escapeUTF8(data: string): string;
  47. //# sourceMappingURL=encode.d.ts.map