@temboplus/frontend-core
Version:
A JavaScript/TypeScript package providing common utilities and logic shared across front-end TemboPlus projects.
49 lines (48 loc) • 1.96 kB
TypeScript
import { ISO2CountryCode } from "@models/country/country.types.js";
import { CountryMNOImplementation, MNOInfo, TZMNOId } from "@models/phone-number/mno/mno.types.js";
/**
* Configuration object for Tanzanian mobile network operators.
* Conforms to the generic NetworkOperatorInfo interface.
*/
export declare const TZ_MNO_CONFIG: Record<TZMNOId, MNOInfo>;
/**
* Tanzania MNO Implementation
* Handles all TZ-specific MNO logic including prefix validation
*/
export declare class TZMNOImplementation implements CountryMNOImplementation {
private static instance;
private constructor();
static getInstance(): TZMNOImplementation;
getAllMNOs(): MNOInfo[];
isValidMNOId(id: string): boolean;
getMNOById(id: string): MNOInfo | undefined;
requiresExplicitMNO(): boolean;
getCountryCode(): ISO2CountryCode;
/**
* Validate MNO against phone number prefix (TZ-specific logic)
*/
validateMNOForPhoneNumber(phoneNumber: string, mnoId: string): boolean;
/**
* Get MNO by phone number prefix (TZ-specific)
*/
getMNOByPhonePrefix(phoneNumber: string): MNOInfo | undefined;
/**
* Get prefixes for a specific MNO (TZ-specific utility)
*/
getPrefixesForMNO(mnoId: TZMNOId): string[];
}
/**
* @deprecated Use TZMNOImplementation.getInstance().getPrefixesForMNO() instead
* Helper function within the TZ context to get prefixes for an operator ID.
*/
export declare function getTZPrefixesForOperator(operatorId: TZMNOId): string[] | undefined;
/**
* @deprecated Use TZMNOImplementation.getInstance().getMNOByPhonePrefix() instead
* Helper function within the TZ context to find operator config by prefix.
*/
export declare function findTZOperatorByPrefix(prefix: string): MNOInfo | undefined;
/**
* @deprecated Use TZMNOImplementation.getInstance().getAllMNOs() instead
* Gets all available Tanzanian MNO configurations.
*/
export declare function getAllTZMNOs(): MNOInfo[];