UNPKG

1.53 kBTypeScriptView Raw
1import { EventEmitter, InjectionToken } from '@angular/core';
2export type InputTransformFn = (value: unknown) => string | number;
3export type OutputTransformFn = (value: string | number | undefined | null) => unknown;
4export type NgxMaskConfig = {
5 suffix: string;
6 prefix: string;
7 thousandSeparator: string;
8 decimalMarker: '.' | ',' | ['.', ','];
9 clearIfNotMatch: boolean;
10 showMaskTyped: boolean;
11 placeHolderCharacter: string;
12 shownMaskExpression: string;
13 specialCharacters: string[] | readonly string[];
14 dropSpecialCharacters: boolean | string[] | readonly string[];
15 hiddenInput: boolean;
16 validation: boolean;
17 instantPrefix: boolean;
18 separatorLimit: string;
19 apm: boolean;
20 allowNegativeNumbers: boolean;
21 leadZeroDateTime: boolean;
22 leadZero: boolean;
23 triggerOnMaskChange: boolean;
24 keepCharacterPositions: boolean;
25 inputTransformFn: InputTransformFn;
26 outputTransformFn: OutputTransformFn;
27 maskFilled: EventEmitter<void>;
28 patterns: Record<string, {
29 pattern: RegExp;
30 optional?: boolean;
31 symbol?: string;
32 }>;
33};
34export type NgxMaskOptions = Partial<NgxMaskConfig>;
35export declare const NGX_MASK_CONFIG: InjectionToken<NgxMaskConfig>;
36export declare const NEW_CONFIG: InjectionToken<NgxMaskConfig>;
37export declare const INITIAL_CONFIG: InjectionToken<NgxMaskConfig>;
38export declare const initialConfig: NgxMaskConfig;
39export declare const timeMasks: string[];
40export declare const withoutValidation: string[];