智慧水务管理系统 - 精河县供水工程综合管理平台

uri-utils.d.ts 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. * Regular expression to match an http:// or https:// scheme.
  3. */
  4. export declare const httpSchemeRe: RegExp;
  5. /**
  6. * Regular expression to match an http:// or https:// scheme as the prefix of
  7. * a string.
  8. */
  9. export declare const httpSchemePrefixRe: RegExp;
  10. /**
  11. * A regular expression used to determine the schemes we should not autolink
  12. */
  13. export declare const invalidSchemeRe: RegExp;
  14. export declare const schemeUrlRe: RegExp;
  15. export declare const tldUrlHostRe: RegExp;
  16. /**
  17. * Determines if the given character code represents a character that may start
  18. * a scheme (ex: the 'h' in 'http')
  19. */
  20. export declare const isSchemeStartChar: (code: number) => boolean;
  21. /**
  22. * Determines if the given character is a valid character in a scheme (such as
  23. * 'http' or 'ssh+git'), but only after the start char (which is handled by
  24. * {@link isSchemeStartChar}.
  25. */
  26. export declare function isSchemeChar(charCode: number): boolean;
  27. /**
  28. * Determines if the character can begin a domain label, which must be an
  29. * alphanumeric character and not an underscore or dash.
  30. *
  31. * A domain label is a segment of a hostname such as subdomain.google.com.
  32. */
  33. export declare const isDomainLabelStartChar: (charCode: number) => boolean;
  34. /**
  35. * Determines if the character is part of a domain label (but not a domain label
  36. * start character).
  37. *
  38. * A domain label is a segment of a hostname such as subdomain.google.com.
  39. */
  40. export declare function isDomainLabelChar(charCode: number): boolean;
  41. /**
  42. * Determines if the character is a path character ("pchar") as defined by
  43. * https://tools.ietf.org/html/rfc3986#appendix-A
  44. *
  45. * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
  46. *
  47. * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
  48. * pct-encoded = "%" HEXDIG HEXDIG
  49. * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
  50. * / "*" / "+" / "," / ";" / "="
  51. *
  52. * Note that this implementation doesn't follow the spec exactly, but rather
  53. * follows URL path characters found out in the wild (spec might be out of date?)
  54. */
  55. export declare function isPathChar(charCode: number): boolean;
  56. /**
  57. * Determines if the character given may begin the "URL Suffix" section of a
  58. * URI (i.e. the path, query, or hash section). These are the '/', '?' and '#'
  59. * characters.
  60. *
  61. * See https://tools.ietf.org/html/rfc3986#appendix-A
  62. */
  63. export declare function isUrlSuffixStartChar(charCode: number): boolean;
  64. /**
  65. * Determines if the top-level domain (TLD) read in the host is a known TLD.
  66. *
  67. * Example: 'com' would be a known TLD (for a host of 'google.com'), but
  68. * 'local' would not (for a domain name of 'my-computer.local').
  69. */
  70. export declare function isKnownTld(tld: string): boolean;
  71. /**
  72. * Determines if the given `url` is a valid scheme-prefixed URL.
  73. */
  74. export declare function isValidSchemeUrl(url: string): boolean;
  75. /**
  76. * Determines if the given `url` is a match with a valid TLD.
  77. */
  78. export declare function isValidTldMatch(url: string): boolean;
  79. /**
  80. * Determines if the given URL is a valid IPv4-prefixed URL.
  81. */
  82. export declare function isValidIpV4Address(url: string): boolean;