phone-number-utils.d.ts 901 B

123456789101112131415161718192021
  1. /**
  2. * Determines if the character is a phone number separator character (i.e.
  3. * '-', '.', or ' ' (space))
  4. */
  5. export declare function isPhoneNumberSeparatorChar(char: string): boolean;
  6. /**
  7. * Determines if the character is a control character in a phone number. Control
  8. * characters are as follows:
  9. *
  10. * - ',': A 1 second pause. Useful for dialing extensions once the main phone number has been reached
  11. * - ';': A "wait" that waits for the user to take action (tap something, for instance on a smart phone)
  12. */
  13. export declare function isPhoneNumberControlChar(char: string): boolean;
  14. /**
  15. * Determines if the given phone number text found in a string is a valid phone
  16. * number.
  17. *
  18. * Our state machine parser is simplified to grab anything that looks like a
  19. * phone number, and this function confirms the match.
  20. */
  21. export declare function isValidPhoneNumber(phoneNumberText: string): boolean;