diff --git a/components/_util/EventInterface.ts b/components/_util/EventInterface.ts new file mode 100644 index 000000000..b9d0bd019 --- /dev/null +++ b/components/_util/EventInterface.ts @@ -0,0 +1,10 @@ +export type FocusEventHandler = (e: FocusEvent) => void; +export type MouseEventHandler = (e: MouseEvent) => void; +export type KeyboardEventHandler = (e: KeyboardEvent) => void; +export type ChangeEvent = Event & { + target: { + value?: string | undefined; + }; +}; + +export type EventHandler = (...args: any[]) => void; diff --git a/components/checkbox/Checkbox.tsx b/components/checkbox/Checkbox.tsx index 6adc99b22..6ae6f8de2 100644 --- a/components/checkbox/Checkbox.tsx +++ b/components/checkbox/Checkbox.tsx @@ -6,6 +6,7 @@ import hasProp, { getOptionProps, getSlot } from '../_util/props-util'; import { defaultConfigProvider } from '../config-provider'; import warning from '../_util/warning'; import type { RadioChangeEvent } from '../radio/interface'; +import type { EventHandler } from '../_util/EventInterface'; function noop() {} export default defineComponent({ @@ -127,8 +128,8 @@ export default defineComponent({