index.js.flow 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. | "extensive";
  16. export type EncodeOptions = {
  17. mode?: EncodeMode,
  18. numeric?: "decimal" | "hexadecimal",
  19. ...
  20. } & CommonOptions;
  21. export type DecodeScope = "strict" | "body" | "attribute";
  22. export type DecodeOptions = {
  23. scope?: DecodeScope,
  24. ...
  25. } & CommonOptions;
  26. /**
  27. * Encodes all the necessary (specified by `level`) characters in the text
  28. */
  29. declare export function encode(
  30. text: string | void | null,
  31. x?: EncodeOptions
  32. ): string;
  33. /**
  34. * Decodes a single entity
  35. */
  36. declare export function decodeEntity(
  37. entity: string | void | null,
  38. x?: CommonOptions
  39. ): string;
  40. /**
  41. * Decodes all entities in the text
  42. */
  43. declare export function decode(
  44. text: string | void | null,
  45. x?: DecodeOptions
  46. ): string;
  47. declare export {};