mozambique-utils
Version:
Easy to use parsers and validators for mozambican (🇲🇿) data-type formatted strings.
27 lines (26 loc) • 898 B
TypeScript
import ResultInterface from "./helper/interface/ResultInterface";
import { LineType, NetworkOperatorSpec } from "./helper/type/types";
/**
* Response type for this validation
*/
declare type LandlineNumberSpec = {
number: string;
localFormat: string;
internationalFormat: string;
includesCountryCode: boolean;
nationalDestinationCode: string;
operator: NetworkOperatorSpec;
region: string;
lineType: LineType;
};
/**
* Validates any mozambican landline number
* (in pt we call telefone fixo)
*
* @param num The landline number to check.
*
* @returns a result object containing if the requested `num` is valid or not and some extra information.
* @throws if the provided argument is not of type string.
*/
declare const parseLandlineNumber: (num: string) => ResultInterface<LandlineNumberSpec>;
export default parseLandlineNumber;