-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
33 lines (31 loc) · 987 Bytes
/
index.d.ts
File metadata and controls
33 lines (31 loc) · 987 Bytes
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
import React from 'react';
export = Switch;
declare namespace Switch {
type CheckBoxType = 'box' | 'switch';
type Direction = 'left' | 'right';
type CheckBoxProps = React.InputHTMLAttributes<HTMLInputElement> & {
/** Set the state of the checkbox */
setChecked?: (checked: boolean) => void;
/** Label of the checkbox */
label?: string;
/** Visual type of the checkbox. Default 'box' */
type?: CheckBoxType;
/** Whether the switch is to the left or the right of the label */
direction?: Direction;
};
type CheckBoxState = {
checked: boolean;
};
/**
* Stylised checkbox, with various styles available, abiding by WAI-ARIA requirements
*/
export class CheckBox extends React.Component<CheckBoxProps, CheckBoxState> {
state: {
checked: boolean;
};
componentDidMount(): void;
componentDidUpdate(): void;
setChecked(checked: boolean): void;
render(): JSX.Element;
}
}