fn

maskPhoneOptions

v0.0.14

Mask options for a phone number, built from a single template string. For a mask that adapts to the typed country code, see maskPhoneCountryOptions.

Example

ts
maskPhoneOptions({ template: '+1 (###) ###-####' });

Signature

ts
export function maskPhoneOptions(params: MaskPhoneParams): MaskOptions{ ... }

Parameters

ParameterTypeDescription
paramsMaskPhoneParamsThe template (and optional tokens)

Returns

MaskOptionsReady-to-use mask options
PropertyTypeDescription
maskMaskThe mask pattern (or a function of state).
preprocessors?readonly MaskPreprocessor[]Normalizers run before conforming.
postprocessors?readonly MaskPostprocessor[]Finishers run after conforming.
overwriteMode?OverwriteModeInsert vs overwrite behavior.