UNPKG

operator-checker

Version:

Iranian mobile operator detection package for Vue 3 and TypeScript

47 lines 1.79 kB
/** * Iranian Mobile Operator Checker * Detects mobile operators based on the first 3 digits of phone numbers */ export declare enum Operator { IRANCELL = 0,// ایرانسل HAMRAH_E_AVAL = 1,// همراه اول RIGHTEL = 2 } export interface OperatorInfo { code: Operator; name: string; nameFa: string; prefixes: string[]; } export declare const OPERATORS: Record<Operator, OperatorInfo>; /** * Detects the mobile operator based on the first 3 digits of the phone number * @param phoneNumber - The phone number string (can include country code, spaces, dashes, etc.) * @returns Operator enum value (0: Irancell, 1: Hamrah-e-Aval, 2: RighTel) or null if not found */ export declare function detectOperator(phoneNumber: string): Operator | null; /** * Gets detailed operator information based on the phone number * @param phoneNumber - The phone number string * @returns OperatorInfo object or null if not found */ export declare function getOperatorInfo(phoneNumber: string): OperatorInfo | null; /** * Gets operator name in Persian * @param phoneNumber - The phone number string * @returns Persian operator name or null if not found */ export declare function getOperatorNameFa(phoneNumber: string): string | null; /** * Gets operator name in English * @param phoneNumber - The phone number string * @returns English operator name or null if not found */ export declare function getOperatorName(phoneNumber: string): string | null; /** * Validates if the phone number is a valid Iranian mobile number * @param phoneNumber - The phone number string * @returns boolean indicating if the number is valid */ export declare function isValidIranianMobileNumber(phoneNumber: string): boolean; //# sourceMappingURL=operator-checker.d.ts.map