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

email-utils.d.ts 1.5KB

1234567891011121314151617181920212223242526272829303132
  1. import { isAlphaNumericOrMarkChar } from '../char-utils';
  2. /**
  3. * A regular expression to match a 'mailto:' prefix on an email address.
  4. */
  5. export declare const mailtoSchemePrefixRe: RegExp;
  6. /**
  7. * Determines if the given character may start the "local part" of an email
  8. * address. The local part is the part to the left of the '@' sign.
  9. *
  10. * Technically according to the email spec, any of the characters in the
  11. * {@link emailLocalPartCharRegex} can start an email address (including any of
  12. * the special characters), but this is so rare in the wild and the
  13. * implementation is much simpler by only starting an email address with a word
  14. * character. This is especially important when matching the '{' character which
  15. * generally starts a brace that isn't part of the email address.
  16. */
  17. export declare const isEmailLocalPartStartChar: typeof isAlphaNumericOrMarkChar;
  18. /**
  19. * Determines if the given character can be part of the "local part" of an email
  20. * address. The local part is the part to the left of the '@' sign.
  21. *
  22. * Checking for an email address's start char is handled with {@link #isEmailLocalPartStartChar}
  23. */
  24. export declare function isEmailLocalPartChar(charCode: number): boolean;
  25. /**
  26. * Determines if the given email address is valid. We consider it valid if it
  27. * has a valid TLD in its host.
  28. *
  29. * @param emailAddress email address
  30. * @return true is email have valid TLD, false otherwise
  31. */
  32. export declare function isValidEmail(emailAddress: string): boolean;