1 | import * as React from 'react';
|
2 | export type SwitchSize = 'small' | 'default';
|
3 | export type SwitchChangeEventHandler = (checked: boolean, event: React.MouseEvent<HTMLButtonElement>) => void;
|
4 | export type SwitchClickEventHandler = SwitchChangeEventHandler;
|
5 | export interface SwitchProps {
|
6 | prefixCls?: string;
|
7 | size?: SwitchSize;
|
8 | className?: string;
|
9 | rootClassName?: string;
|
10 | checked?: boolean;
|
11 | defaultChecked?: boolean;
|
12 | |
13 |
|
14 |
|
15 |
|
16 | value?: boolean;
|
17 | |
18 |
|
19 |
|
20 |
|
21 | defaultValue?: boolean;
|
22 | onChange?: SwitchChangeEventHandler;
|
23 | onClick?: SwitchClickEventHandler;
|
24 | checkedChildren?: React.ReactNode;
|
25 | unCheckedChildren?: React.ReactNode;
|
26 | disabled?: boolean;
|
27 | loading?: boolean;
|
28 | autoFocus?: boolean;
|
29 | style?: React.CSSProperties;
|
30 | title?: string;
|
31 | tabIndex?: number;
|
32 | id?: string;
|
33 | }
|
34 | type CompoundedComponent = React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLElement>> & {};
|
35 | declare const Switch: CompoundedComponent;
|
36 | export default Switch;
|