/** * All 24 Tunisian Governorates with French and Arabic names. * IDs 1-24 match the governorate_id used in DELEGATIONS. */ interface Governorate { id: number; name_fr: string; name_ar: string; } declare const GOVERNORATES: Governorate[]; /** * Tunisian bank codes mapping (first 2 digits of RIB). */ interface Bank { code: string; name: string; abbrev: string; } declare const BANKS: Bank[]; /** * Get bank information from a RIB number. * @param rib - The 20-digit RIB number * @returns Bank name or `null` if the code is not found */ declare function getBankFromRIB(rib: string): string | null; /** * Get bank information from a Tunisian IBAN. * * An IBAN has the shape `TN` + 2 check digits + a 20-digit RIB. The bank code * is therefore the first two digits of that RIB, i.e. IBAN characters 4–5. * * @param iban - The 24-character IBAN (optionally spaced) * @returns Bank name or `null` if the IBAN is invalid or the code is unknown */ declare function getBankFromIBAN(iban: string): string | null; /** * Tunisian administrative delegations (Délégations). * Each governorate is divided into multiple delegations. */ interface Delegation { governorate_id: number; name_fr: string; name_ar: string; } declare const DELEGATIONS: Delegation[]; /** * Gets delegations for a specific governorate. * * @param governorateId - The governorate ID (1-24) * @returns Array of delegations in the governorate */ declare function getDelegationsByGovernorate(governorateId: number): Delegation[]; /** * Resolve the governorate a delegation belongs to, by delegation name. * * Matches either the French or Arabic name (case-insensitive trim). * * @param name - The delegation name (e.g. `"Tunis Ville"` or `"مدينة تونس"`) * @returns The matching `Governorate`, or `null` if not found */ declare function getGovernorateFromDelegation(name: string): Governorate | null; /** * Find a delegation by its name (French or Arabic, case-insensitive). * * @param name - The delegation name * @returns The matching `Delegation`, or `undefined` if not found */ declare function getDelegationByName(name: string): Delegation | undefined; /** * Landline region prefixes for Tunisia. * Each prefix (71-78) corresponds to a specific geographic region. */ interface LandlineRegion { prefix: string; name_fr: string; name_ar: string; governorates: string[]; } declare const LANDLINE_REGIONS: LandlineRegion[]; /** * Gets the region information from a landline phone number. * * @param phone - The landline phone number (8 digits or with country code) * @returns The region information, or null if not found * * @example * getRegionFromLandline('71234567') * // Returns: { prefix: '71', name_fr: 'Grand Tunis', name_ar: 'تونس الكبرى', governorates: [...] } */ declare function getRegionFromLandline(phone: string): LandlineRegion | null; /** * Compact, bundle-conscious Tunisian postal-code → governorate mapping. * * Tunisian postal codes are four digits. The first two digits denote the * governorate (see https://en.wikipedia.org/wiki/Postal_codes_in_Tunisia). * Because a few prefixes are shared by several governorates (notably `11xx` * and `20xx`), this lightweight table maps each 100-block to a * *representative* governorate and is intended for approximate grouping, not * authoritative address resolution. * * Tuple shape: `[minCode, maxCode, governorateId]` */ declare const POSTAL_CODE_RANGES: ReadonlyArray; /** * Resolve the governorate for a Tunisian postal code. * * @param code - A 4-digit postal code (string or number) * @returns The matching `Governorate`, or `null` if the code is invalid or * falls outside any known range. */ declare function getGovernorateFromPostalCode(code: string | number): Governorate | null; export { BANKS, type Bank, DELEGATIONS, type Delegation, GOVERNORATES, type Governorate, LANDLINE_REGIONS, type LandlineRegion, POSTAL_CODE_RANGES, getBankFromIBAN, getBankFromRIB, getDelegationByName, getDelegationsByGovernorate, getGovernorateFromDelegation, getGovernorateFromPostalCode, getRegionFromLandline };