UNPKG

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