/**
* @file Switch
* @description
* @author fex
*/
///
import React from 'react';
import { ClassNamesFn } from '../theme';
interface SwitchProps {
id?: string;
size?: 'md' | 'lg' | 'middle' | 'large';
level?: 'info' | 'primary' | 'danger';
className?: string;
classPrefix: string;
classnames: ClassNamesFn;
onChange?: (checked: boolean) => void;
value?: any;
inline?: boolean;
trueValue?: any;
falseValue?: any;
disabled?: boolean;
readOnly?: boolean;
onText?: string;
offText?: string;
checked?: boolean;
}
export declare class Switch extends React.PureComponent {
static defaultProps: {
trueValue: boolean;
falseValue: boolean;
};
constructor(props: SwitchProps);
hanldeCheck(e: React.ChangeEvent): void;
render(): JSX.Element;
}
declare const _default: {
new (props: (Pick, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps) | Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>): {
render(): JSX.Element;
context: any;
setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps> & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
};
new (props: Pick, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps, context: any): {
render(): JSX.Element;
context: any;
setState(state: {} | ((prevState: Readonly<{}>, props: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
forceUpdate(callback?: (() => void) | undefined): void;
readonly props: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps> & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly, "value" | "level" | "id" | "size" | "inline" | "disabled" | "onChange" | "checked" | "readOnly" | "onText" | "offText"> & Partial, "trueValue" | "falseValue">> & Partial> & import("../theme").ThemeOutterProps>, nextState: Readonly<{}>, nextContext: any): void;
};
displayName: string;
contextType: React.Context;
ComposedComponent: typeof Switch;
} & import("hoist-non-react-statics").NonReactStatics & {
ComposedComponent: typeof Switch;
};
export default _default;