-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
/
Copy pathSwitchBase.d.ts
33 lines (28 loc) · 1.02 KB
/
SwitchBase.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
import * as React from 'react';
import { StandardProps } from '..';
import { IconButtonProps } from '../IconButton';
export interface SwitchBaseProps
extends StandardProps<IconButtonProps, SwitchBaseClassKey, 'onChange'> {
checked?: boolean | string;
checkedIcon: React.ReactNode;
defaultChecked?: boolean;
disabled?: boolean;
disableRipple?: boolean;
icon: React.ReactNode;
indeterminate?: boolean;
indeterminateIcon?: React.ReactNode;
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
inputRef?: React.Ref<any>;
name?: string;
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
tabIndex?: number;
value?: string;
}
export type SwitchBaseClassKey = 'root' | 'checked' | 'disabled' | 'input';
export type SwitchBase = React.Component<SwitchBaseProps>;
export interface CreateSwitchBaseOptions {
defaultIcon?: React.ReactNode;
defaultCheckedIcon?: React.ReactNode;
type?: string;
}
export default function createSwitch(options: CreateSwitchBaseOptions): SwitchBase;