import { BasicTarget } from './useFullscreen'; /** * 来源于 ahooks * https://ahooks.js.org/zh-CN/hooks/dom/use-event-listener * 这里额外加入了参数 open * 默认是开启, 如果传入 false 则会使他失效 */ export declare type Target = BasicTarget; declare type Options = { target?: T; capture?: boolean; once?: boolean; passive?: boolean; open?: boolean; }; declare function useEventListener(eventName: K, handler: (ev: HTMLElementEventMap[K]) => void, options?: Options): void; declare function useEventListener(eventName: K, handler: (ev: ElementEventMap[K]) => void, options?: Options): void; declare function useEventListener(eventName: K, handler: (ev: DocumentEventMap[K]) => void, options?: Options): void; declare function useEventListener(eventName: K, handler: (ev: WindowEventMap[K]) => void, options?: Options): void; declare function useEventListener(eventName: string, handler: Function, options: Options): void; export default useEventListener;