forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap-switch.d.ts
102 lines (90 loc) · 3.9 KB
/
bootstrap-switch.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Type definitions for Bootstrap Switch
// Project: http://www.bootstrap-switch.org/
// Definitions by: John M. Baughman <https://github.com/johnmbaughman>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* bootstrap-switch - v3.3.2 Copyright (c) 2012-2013 Mattia Larentis
* Available via the Apache license.
* see: http://www.bootstrap-switch.org/ or https://github.com/nostalgiaz/bootstrap-switch for details.
*/
/// <reference path="../jquery/jquery.d.ts"/>
declare namespace BootstrapSwitch {
interface BootstrapSwitchChangeEventObject extends JQueryEventObject {
state: boolean
}
interface BootstrapSwitchEventObject extends JQueryEventObject { }
interface BootstrapSwitchOptions {
state?: boolean;
size?: string;
animate?: boolean;
disabled?: boolean;
readonly?: boolean;
indeterminate?: boolean;
invers?: boolean;
radioAllOff?: boolean;
onColor?: string;
offColor?: string;
onText?: string;
offText?: string;
labelText?: string;
handleWidth?: string;
labelWidth?: string;
baseClass?: string;
wrapperClass?: string;
onInit?: any;
onSwitchChange?: any;
}
interface Switch {
toggleAnimate(): JQuery;
toggleDisabled(): JQuery;
toggleReadonly(): JQuery;
toggleIndeterminate(): JQuery;
toggleInverse(): JQuery;
destroy(): JQuery;
state(): boolean;
state(value: any): JQuery;
state(value: any, skip: boolean): JQuery;
toggleState(skip?: boolean): JQuery;
radioAllOff(): boolean;
radioAllOff(state: boolean): JQuery;
size(): string;
size(size: string): JQuery;
animate(): boolean;
animate(state: boolean): JQuery;
disabled(): boolean;
disabled(state: boolean): JQuery;
toggleDisabled(): JQuery;
readonly(): boolean;
readonly(state: boolean): JQuery;
toggleReadOnly(): JQuery;
onColor(): string;
onColor(color: string): JQuery;
offColor(): string;
offColor(color: string): JQuery;
onText(): string;
onText(text: string): JQuery;
offText(): string;
offText(text: string): JQuery;
labelText(): string;
labelText(text: string): JQuery;
baseClass(): string;
baseClass(text: string): JQuery;
wrapperClass(): string;
wrapperClass(text: string): JQuery;
}
}
interface JQuery {
bootstrapSwitch(): JQuery;
bootstrapSwitch(options: BootstrapSwitch.BootstrapSwitchOptions): JQuery;
bootstrapSwitch(method: string): JQuery;
bootstrapSwitch(method: string, param: any): JQuery;
bootstrapSwitch(method: string, param1: any, param2: any): JQuery;
off(events: "init.bootstrapSwitch", selector?: string, handler?: (eventobject: BootstrapSwitch.BootstrapSwitchEventObject) => any): JQuery;
off(events: "init.bootstrapSwitch", handler?: (eventobject: BootstrapSwitch.BootstrapSwitchEventObject) => any): JQuery;
off(events: "switchChange.bootstrapSwitch", selector?: string, handler?: (eventobject: BootstrapSwitch.BootstrapSwitchChangeEventObject) => any): JQuery;
off(events: "switchChange.bootstrapSwitch", handler?: (eventobject: BootstrapSwitch.BootstrapSwitchChangeEventObject) => any): JQuery;
on(events: "init.bootstrapSwitch", selector?: string, handler?: (eventobject: BootstrapSwitch.BootstrapSwitchEventObject) => any): JQuery;
on(events: "init.bootstrapSwitch", handler?: (eventobject: BootstrapSwitch.BootstrapSwitchEventObject) => any): JQuery;
on(events: "switchChange.bootstrapSwitch", selector?: string, handler?: (eventobject: BootstrapSwitch.BootstrapSwitchChangeEventObject) => any): JQuery;
on(events: "switchChange.bootstrapSwitch", handler?: (eventobject: BootstrapSwitch.BootstrapSwitchChangeEventObject) => any): JQuery;
}