You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.8 KiB

  1. /**
  2. * Character classes and associated utilities for the 5th edition of XML 1.0.
  3. *
  4. * @author Louis-Dominique Dubeau
  5. * @license MIT
  6. * @copyright Louis-Dominique Dubeau
  7. */
  8. export declare const CHAR = "\t\n\r -\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF";
  9. export declare const S = " \t\r\n";
  10. export declare const NAME_START_CHAR = ":A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\uD800\uDC00-\uDB7F\uDFFF";
  11. export declare const NAME_CHAR: string;
  12. export declare const CHAR_RE: RegExp;
  13. export declare const S_RE: RegExp;
  14. export declare const NAME_START_CHAR_RE: RegExp;
  15. export declare const NAME_CHAR_RE: RegExp;
  16. export declare const NAME_RE: RegExp;
  17. export declare const NMTOKEN_RE: RegExp;
  18. /** All characters in the ``S`` production. */
  19. export declare const S_LIST: number[];
  20. /**
  21. * Determines whether a codepoint matches the ``CHAR`` production.
  22. *
  23. * @param c The code point.
  24. *
  25. * @returns ``true`` if the codepoint matches ``CHAR``.
  26. */
  27. export declare function isChar(c: number): boolean;
  28. /**
  29. * Determines whether a codepoint matches the ``S`` (space) production.
  30. *
  31. * @param c The code point.
  32. *
  33. * @returns ``true`` if the codepoint matches ``S``.
  34. */
  35. export declare function isS(c: number): boolean;
  36. /**
  37. * Determines whether a codepoint matches the ``NAME_START_CHAR`` production.
  38. *
  39. * @param c The code point.
  40. *
  41. * @returns ``true`` if the codepoint matches ``NAME_START_CHAR``.
  42. */
  43. export declare function isNameStartChar(c: number): boolean;
  44. /**
  45. * Determines whether a codepoint matches the ``NAME_CHAR`` production.
  46. *
  47. * @param c The code point.
  48. *
  49. * @returns ``true`` if the codepoint matches ``NAME_CHAR``.
  50. */
  51. export declare function isNameChar(c: number): boolean;