forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
x-editable.d.ts
79 lines (71 loc) · 1.82 KB
/
x-editable.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Type definitions for X-Editable v1.5.1
// Project: http://vitalets.github.io/x-editable/index.html
// Definitions by: Chris Kirby <https://github.com/sirkirby/>
// Definitions: https://github.com/sirkirby/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface XEditableOptions
{
ajaxOptions?: any;
anim?: string;
autotext?: string;
defaultValue?: any;
disabled?: boolean;
display?: any;
emptyclass?: string;
emptytext?: string;
error?: any;
highlight?: any;
mode?: string;
name?: string;
onblur?: string;
params?: any;
pk?: any;
placement?: string;
savenochange?: boolean;
selector?: string;
send?: string;
showbuttons?: any;
success?: any;
toggle?: string;
type?: string;
unsavedclass?: string;
url?: any;
validate?: any;
value?: any;
}
interface XEditableSubmitOptions {
url?: any;
data?: any;
ajaxOptions?: any;
error(obj: any) : void;
success(obj: any, config: any) : void;
}
interface XEditable {
options: XEditableOptions;
activate() : void;
destroy() : void;
disable() : void;
enable() : void;
getValue(isSingle: boolean) : any;
hide() : void;
option(key: any, value: any) : void;
setValue(value: any, convertStr: boolean) : void;
show(closeAll: boolean) : void;
submit(options: XEditableSubmitOptions) : void;
toggle(closeAll: boolean) : void;
toggleDisabled() : void;
validate() : void;
}
interface JQuery {
/**
* Initializes editable with the specified options
* @param options an object with options specific to the editable instance
*/
editable(options?: any): XEditable;
/**
* Initializes editable calling the specific method with is parameters
* @param method the method to call
* @param params the parameters expected by the method
*/
editable(method: string, params?: any): XEditable;
}