UNPKG

605 BTypeScriptView Raw
1import type { Verification } from "./types";
2type CreditCardType = {
3 niceType: string;
4 type: string;
5 patterns: Array<number[] | number>;
6 gaps: number[];
7 lengths: number[];
8 code: {
9 name: string;
10 size: number;
11 };
12};
13export interface CardNumberVerification extends Verification {
14 card: CreditCardType | null;
15}
16type CardNumberOptions = {
17 maxLength?: number;
18 luhnValidateUnionPay?: boolean;
19 skipLuhnValidation?: boolean;
20};
21export declare function cardNumber(value: string | unknown, options?: CardNumberOptions): CardNumberVerification;
22export {};