Skip to Content

Types

Common TypeScript definitions used in ViraStack Mask.

MaskPreset

Union of all available preset names.

type MaskPreset = | 'card' | 'expiry' | 'cvv' | 'tckn' | 'phone' | 'email' | 'url' | 'alpha' | 'password' | 'text' | 'currency' | 'iban' | 'numeric' | 'date' | 'taxNumber' | 'zipCode';

MaskOptions

Configuration object for a field mask.

interface MaskOptions { mask?: string; transform?: 'uppercase' | 'lowercase'; allowedChars?: RegExp; forbiddenChars?: RegExp; currency?: CurrencyOptions; placeholderChar?: string; inputMode?: 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'; type?: HTMLInputTypeAttribute; validate?: boolean; validator?: ((value: string) => boolean) | 'luhn' | 'tckn'; }

CurrencyOptions

interface CurrencyOptions { precision?: number; decimalSeparator?: string; thousandSeparator?: string; symbol?: string; symbolPosition?: 'prefix' | 'suffix'; }

MaskSchema

type MaskSchema<TFieldValues extends FieldValues> = { [K in keyof TFieldValues]?: MaskPreset | MaskOptions; };

© 2026 ViraStack. MIT License.