-
Notifications
You must be signed in to change notification settings - Fork 30k
/
ToggleSwitchWidget.d.ts
58 lines (52 loc) · 2.19 KB
/
ToggleSwitchWidget.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
declare namespace OO.ui {
/**
* ToggleSwitches are switches that slide on and off. Their state is represented by a Boolean
* value (`true` for ‘on’, and `false` otherwise, the default). The ‘off’ state is represented
* visually by a slider in the leftmost position.
*
* // Toggle switches in the 'off' and 'on' position.
* var toggleSwitch1 = new OO.ui.ToggleSwitchWidget(),
* toggleSwitch2 = new OO.ui.ToggleSwitchWidget( {
* value: true
* } );
* // Create a FieldsetLayout to layout and label switches.
* fieldset = new OO.ui.FieldsetLayout( {
* label: 'Toggle switches'
* } );
* fieldset.addItems( [
* new OO.ui.FieldLayout( toggleSwitch1, {
* label: 'Off',
* align: 'top'
* } ),
* new OO.ui.FieldLayout( toggleSwitch2, {
* label: 'On',
* align: 'top'
* } )
* ] );
* $( document.body ).append( fieldset.$element );
*
* ResourceLoader module: `oojs-ui-widgets`
*
* @see https://doc.wikimedia.org/oojs-ui/master/js/#!/api/OO.ui.ToggleSwitchWidget
*/
interface ToggleSwitchWidget extends ToggleSwitchWidget.Props, ToggleSwitchWidget.Prototype {}
namespace ToggleSwitchWidget {
interface ConfigOptions extends ToggleWidget.ConfigOptions, mixin.TabIndexedElement.ConfigOptions {}
type Static = ToggleWidget.Static;
interface Props extends ToggleWidget.Props, mixin.TabIndexedElement.Props {
$glow: JQuery;
$grip: JQuery;
}
interface Prototype extends ToggleWidget.Prototype, mixin.TabIndexedElement.Prototype {}
interface Constructor {
/** @param config Configuration options */
new(config?: ConfigOptions): ToggleSwitchWidget;
prototype: Prototype;
static: Static;
super: ToggleWidget.Constructor;
/** @deprecated Use `super` instead */
parent: ToggleWidget.Constructor;
}
}
const ToggleSwitchWidget: ToggleSwitchWidget.Constructor;
}