forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
maskedinput.d.ts
55 lines (48 loc) · 1.57 KB
/
maskedinput.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// Type definitions for Masked Input plugin for jQuery
// Project: http://digitalbush.com/projects/masked-input-plugin
// Definitions by: Lokesh Peta <https://github.com/lokeshpeta/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../jquery/jquery.d.ts" />
interface JQueryMaskedInputOptions {
mask?: string;
alias?: string;
placeholder?: string;
repeat?: number;
greedy?: boolean;
skipOptionalPartCharacter?: string;
clearIncomplete?: boolean;
clearMaskOnLostFocus?: boolean;
autoUnmask?: boolean;
showMaskOnFocus?: boolean;
showMaskOnHover?: boolean;
showToolTip?: boolean;
isComplete?: (buffer: any, options: any) => {};
numeric?: boolean;
radixPoint?: string;
rightAlignNumerics?: boolean;
oncomplete?: (value?: any) => void;
onincomplete?: () => void;
oncleared?: () => void;
onUnMask?: (maskedValue: any, unmaskedValue: any) => void;
onBeforeMask?: (initialValue: any) => void;
onKeyValidation?: (result: any) => void;
onBeforePaste?: (pastedValue: any) => void;
}
interface MaskedInputStatic {
defaults: MaskedInputDefaults;
isValid: (value: string, options: MaskedInputStaticDefaults) => boolean;
format: (value: string, options: MaskedInputStaticDefaults) => boolean;
}
interface MaskedInputStaticDefaults {
alias: string;
}
interface MaskedInputDefaults {
aliases: any;
definitions: any;
}
interface JQueryStatic {
mask: MaskedInputStatic;
}
interface JQuery {
mask(mask: string, options?: JQueryMaskedInputOptions): JQuery;
}