react-creditcard-validator
Version:
A fully typed React custom hook for formatting and validating payment card input fields
13 lines (12 loc) • 536 B
TypeScript
/**
* This function extracts the card type from the cardNumber argument, then proceeds to format it according to the format associated with that card, or by the default card format, finally the formatted card number is then returned.
* @param cardNumber string
* @returns string
*/
export declare const formatCardNumber: (cardNumber: string) => string;
/**
* Formats the expiry date input, using the input event.
* @param date string
* @returns string
*/
export declare const formatExpiry: (date: string) => string;