import React from 'react'; import PropTypes from 'prop-types'; import { SwitchAdapter } from '@douyinfe/semi-foundation/lib/es/switch/foundation'; import BaseComponent from '../_base/baseComponent'; import '@douyinfe/semi-foundation/lib/es/switch/switch.css'; export interface SwitchProps { 'aria-label'?: React.AriaAttributes['aria-label']; 'aria-describedby'?: React.AriaAttributes['aria-describedby']; 'aria-errormessage'?: React.AriaAttributes['aria-errormessage']; 'aria-invalid'?: React.AriaAttributes['aria-invalid']; 'aria-labelledby'?: React.AriaAttributes['aria-labelledby']; defaultChecked?: boolean; checked?: boolean; disabled?: boolean; onChange?: (checked: boolean, e: React.ChangeEvent) => void; loading?: boolean; className?: string; style?: React.CSSProperties; onMouseEnter?: (e: React.MouseEvent) => any; onMouseLeave?: (e: React.MouseEvent) => any; size?: 'large' | 'default' | 'small'; checkedText?: React.ReactNode; uncheckedText?: React.ReactNode; id?: string; } export interface SwitchState { nativeControlChecked: boolean; nativeControlDisabled: boolean; focusVisible: boolean; } declare class Switch extends BaseComponent { static propTypes: { 'aria-label': PropTypes.Requireable; 'aria-labelledby': PropTypes.Requireable; 'aria-invalid': PropTypes.Requireable; 'aria-errormessage': PropTypes.Requireable; 'aria-describedby': PropTypes.Requireable; className: PropTypes.Requireable; checked: PropTypes.Requireable; checkedText: PropTypes.Requireable; defaultChecked: PropTypes.Requireable; disabled: PropTypes.Requireable; loading: PropTypes.Requireable; onChange: PropTypes.Requireable<(...args: any[]) => any>; onMouseEnter: PropTypes.Requireable<(...args: any[]) => any>; onMouseLeave: PropTypes.Requireable<(...args: any[]) => any>; style: PropTypes.Requireable; size: PropTypes.Requireable<"default" | "small" | "large">; uncheckedText: PropTypes.Requireable; id: PropTypes.Requireable; }; static defaultProps: Partial; private switchRef; constructor(props: SwitchProps); componentDidMount(): void; componentDidUpdate(prevProps: SwitchProps): void; componentWillUnmount(): void; get adapter(): SwitchAdapter; handleFocusVisible: (event: React.FocusEvent) => void; handleBlur: (event: React.FocusEvent) => void; render(): React.JSX.Element; } export default Switch;