diff --git a/components/switch/index.tsx b/components/switch/index.tsx index 6d9ef32538..abae39b801 100755 --- a/components/switch/index.tsx +++ b/components/switch/index.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import classNames from 'classnames'; import RcSwitch from 'rc-switch'; +import type { SwitchChangeEventHandler, SwitchClickEventHandler } from 'rc-switch'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; import Wave from '../_util/wave'; @@ -11,11 +12,7 @@ import useSize from '../config-provider/hooks/useSize'; import useStyle from './style'; export type SwitchSize = 'small' | 'default'; -export type SwitchChangeEventHandler = ( - checked: boolean, - event: React.MouseEvent, -) => void; -export type SwitchClickEventHandler = SwitchChangeEventHandler; +export type { SwitchChangeEventHandler, SwitchClickEventHandler }; export interface SwitchProps { prefixCls?: string; @@ -110,11 +107,10 @@ const InternalSwitch = React.forwardRef((props, return wrapCSSVar( - {/* @ts-ignore */}