@temboplus/frontend-core
Version:
A JavaScript/TypeScript package providing common utilities and logic shared across front-end TemboPlus projects.
41 lines (40 loc) • 1.52 kB
TypeScript
import { CountryCode, ISO2CountryCode } from "@models/country/country.types.js";
import { CountryMNOImplementation, MNOInfo } from "./mno.types.js";
/**
* Utility functions for working with MNO data across countries.
*/
export declare class MNOUtils {
private static implementations;
/**
* Get MNO implementation for a specific country
*/
private static getImplementation;
/**
* Get all MNOs for a specific country
*/
static getCountryMNOs(countryCode: CountryCode): MNOInfo[];
/**
* Validate if an MNO ID is valid for a specific country
*/
static isValidMNOForCountry(mnoId: string, countryCode: CountryCode): boolean;
/**
* Get MNO info by ID for a specific country
*/
static getMNOById(mnoId: string, countryCode: CountryCode): MNOInfo | undefined;
/**
* Check if a country requires explicit MNO (has MNP)
*/
static requiresExplicitMNO(countryCode: CountryCode): boolean;
/**
* Validate MNO for a phone number (country-specific logic)
*/
static validateMNOForPhoneNumber(phoneNumber: string, mnoId: string, countryCode: CountryCode): boolean;
/**
* Get MNO by phone number (for countries without MNP)
*/
static getMNOByPhoneNumber(phoneNumber: string, countryCode: CountryCode): MNOInfo | undefined;
/**
* Register a new country implementation
*/
static registerCountryImplementation(countryCode: ISO2CountryCode, implementation: CountryMNOImplementation): void;
}