index.js.flow 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /**
  2. * Flowtype definitions for index
  3. * Generated by Flowgen from a Typescript Definition
  4. * Flowgen v1.13.0
  5. * @flow
  6. */
  7. export type Level = "xml" | "html4" | "html5" | "all";
  8. declare interface CommonOptions {
  9. level?: Level;
  10. }
  11. export type EncodeMode =
  12. | "specialChars"
  13. | "nonAscii"
  14. | "nonAsciiPrintable"
  15. | "nonAsciiPrintableOnly"
  16. | "extensive";
  17. export type EncodeOptions = {
  18. mode?: EncodeMode,
  19. numeric?: "decimal" | "hexadecimal",
  20. ...
  21. } & CommonOptions;
  22. export type DecodeScope = "strict" | "body" | "attribute";
  23. export type DecodeOptions = {
  24. scope?: DecodeScope,
  25. ...
  26. } & CommonOptions;
  27. /**
  28. * Encodes all the necessary (specified by `level`) characters in the text
  29. */
  30. declare export function encode(
  31. text: string | void | null,
  32. x?: EncodeOptions
  33. ): string;
  34. /**
  35. * Decodes a single entity
  36. */
  37. declare export function decodeEntity(
  38. entity: string | void | null,
  39. x?: CommonOptions
  40. ): string;
  41. /**
  42. * Decodes all entities in the text
  43. */
  44. declare export function decode(
  45. text: string | void | null,
  46. x?: DecodeOptions
  47. ): string;
  48. declare export {};