/** * Validates a Tunisian National ID (CIN). * - Must be exactly 8 digits * - Must contain only numbers * - Must not be the all-zero placeholder * * NOTE: This validator performs format-only validation (8 digits, not all * zeros). It does NOT validate the official CIN checksum algorithm. Full * checksum validation can be added once the canonical algorithm is confirmed * against an authoritative source (e.g., Ministry of Interior specifications). */ declare function isValidCIN(cin: string): boolean; /** * Validates a Tunisian mobile phone number. * Supports formats: * - 22555111 (8 digits) * - +21622555111 (with country code) * - 0021622555111 (with 00 prefix) */ declare function isValidPhone(phone: string): boolean; type PhoneProvider = 'Tunisie Telecom' | 'Ooredoo' | 'Orange' | 'Lycamobile'; /** * Returns the *original* operator assigned to a Tunisian mobile number, derived * from its first digit. * * **⚠️ MNP caveat:** Tunisia fully implements Mobile Number Portability, so a * number's *current* network operator can differ from the prefix it was * originally assigned. This helper reports only the prefix-derived operator * and MUST NOT be used to determine the number's active carrier. * * - Tunisie Telecom: `9x`, `4x` * - Ooredoo: `2x` * - Orange: `5x` * - Lycamobile: `6x` * * @param phone - The mobile number (with or without `+216` / `00216` prefix) * @returns The prefix-derived provider, or `null` if the number is invalid */ declare function getPhoneProvider(phone: string): PhoneProvider | null; /** * Validates a Tunisian RIB (Relevé d'Identité Bancaire). * - Must be exactly 20 digits * - Uses Modulo 97 algorithm for check digit validation * * RIB Format: BB BBB CCCCC CCCCCCC KK * - BB: Bank code (2 digits) * - BBB: Branch code (3 digits) * - CCCCC CCCCCCC: Account number (12 digits) * - KK: Check digits (2 digits) */ declare function isValidRIB(rib: string): boolean; /** * Validates a Tunisian Company Tax ID (Matricule Fiscale). * Format: 1234567/X/A/M/000 * - 7 digits * - 1 letter: control letter (any Latin letter except I, O, U, which are * excluded to avoid confusion with digits 1, 0) * - 1 letter: type (A, B, P, D, N) * - 1 letter: category (M, C, P, E, N) * - 3 digits (establishment number) * * Accepts formats with or without separators (/, spaces) */ declare function isValidMatricule(mat: string): boolean; /** * Validates a Tunisian passport number. * * Two formats are accepted: * - 1 letter followed by 7 digits (legacy / machine-readable format) * e.g. `A1234567` * - 2 letters followed by 6 digits (newer biometric format) * e.g. `AB123456` */ declare function isValidPassport(pass: string): boolean; /** * Validates a Tunisian IBAN (International Bank Account Number). * * Format: TN59 1234 5678 9012 3456 7890 (24 characters) * - TN: Country code * - 59: Check digits (calculated using ISO 7064 Modulo 97-10) * - Remaining 20 digits: RIB (bank account number) * * @param iban - The IBAN string to validate * @returns true if the IBAN is valid, false otherwise */ declare function isValidIBAN(iban: string): boolean; /** * Converts a Tunisian RIB (20 digits) to a full IBAN (24 characters). * * @param rib - The 20-digit RIB to convert * @returns The full IBAN string, or null if the RIB is invalid */ declare function ribToIBAN(rib: string): string | null; /** * Validates a Tunisian landline phone number. * * Landlines in Tunisia are 8 digits starting with 7. * The second digit indicates the region: * - 70: Grand Tunis (Tunis, Ariana, Ben Arous, Manouba) * - 71: Greater Tunis * - 72: Northeast (Cap Bon, Bizerte) * - 73: Sahel (Sousse, Monastir, Mahdia) * - 74: Sfax region * - 75: Gafsa, Tozeur, Kebili * - 76: Gabès, Médenine, Tataouine * - 77: Kasserine, Sidi Bouzid * - 78: Béja, Jendouba, Le Kef, Siliana * - 79: Grand Tunis (Tunis, Ariana, Ben Arous, Manouba) * * Supports formats: * - 71234567 (8 digits) * - +21671234567 (with country code) * - 0021671234567 (with 00 prefix) */ declare function isValidLandline(phone: string): boolean; /** * Validates a Tunisian license plate (Matricule). * * Standard formats: * - "123 تونس 4567" (Arabic, with or without spaces) * - "123 TU 4567" (Latin representation, case-insensitive) * * Special series (per ATT.TN documentation): * - Diplomatic corps: "12 CD 34" (CD = Corps Diplomatique) * - Résident Secondaire / rental: "RS 12345 AB" * - Motorcycle: "01 MN 1234" * - Tractor: "01 TRAC 1234" * - PAT — Personnel Administratif et Technique: "01 MF 01" * - CMD — Chef de Mission Diplomatique: "01 RB 01" * - MD — Mission Diplomatique: "01 SD 01" * - MC — Mission Consulaire: "01 TQ 01" * * @see https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Tunisia */ declare function isValidLicensePlate(plate: string): boolean; /** * Validates a Tunisian postal code. * * Postal codes are exactly 4 digits in the range `1000`–`9299`. * The all-zero code `0000` is rejected. * * @param code - The postal code as a string (or number) * @returns `true` if the code is a well-formed Tunisian postal code */ declare function isValidPostalCode(code: string | number): boolean; export { type PhoneProvider, getPhoneProvider, isValidCIN, isValidIBAN, isValidLandline, isValidLicensePlate, isValidMatricule, isValidPassport, isValidPhone, isValidPostalCode, isValidRIB, ribToIBAN };