@maskito/phone
Version:
The optional framework-agnostic Maskito's package with phone masks
17 lines (16 loc) • 799 B
TypeScript
import type { MaskitoOptions } from '@maskito/core';
import type { CountryCode, MetadataJson, NumberFormat } from 'libphonenumber-js/core';
export interface MaskitoPhoneParams {
countryIsoCode?: CountryCode;
metadata: MetadataJson;
strict?: boolean;
separator?: string;
/**
* Phone number format.
* - 'INTERNATIONAL' (default): Includes country code prefix (e.g., +1 212 343-3355)
* - 'NATIONAL': Country-specific format without country code (e.g., (212) 343-3355).
* Only works with strict mode (requires countryIsoCode).
*/
format?: Extract<NumberFormat, 'INTERNATIONAL' | 'NATIONAL'>;
}
export declare function maskitoPhoneOptionsGenerator({ countryIsoCode, metadata, strict, separator, format, }: MaskitoPhoneParams): Required<MaskitoOptions>;