choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
32 lines (31 loc) • 1 kB
TypeScript
import React, { Component, ReactNode } from 'react';
import PropTypes from 'prop-types';
import { Size } from '../_util/enum';
import { ConfigContextValue } from '../config-provider/ConfigContext';
export interface SwitchProps {
prefixCls?: string;
size?: Size;
className?: string;
checked?: boolean;
defaultChecked?: boolean;
onChange?: (checked: boolean) => any;
checkedChildren?: ReactNode;
unCheckedChildren?: ReactNode;
disabled?: boolean;
loading?: boolean;
}
export default class Switch extends Component<SwitchProps, {}> {
static get contextType(): React.Context<ConfigContextValue>;
static displayName: string;
static propTypes: {
prefixCls: PropTypes.Requireable<string>;
size: PropTypes.Requireable<Size>;
className: PropTypes.Requireable<string>;
};
context: ConfigContextValue;
private rcSwitch;
focus(): void;
blur(): void;
saveSwitch: (node: any) => void;
render(): JSX.Element;
}