export interface ListenerType1 { addEventListener(name: string, handler: (event?: any) => void, ...args: any[]): any; removeEventListener(name: string, handler: (event?: any) => void, ...args: any[]): any; } export interface ListenerType2 { on(name: string, handler: (event?: any) => void, ...args: any[]): any; off(name: string, handler: (event?: any) => void, ...args: any[]): any; } export declare type UseEventTarget = ListenerType1 | ListenerType2; declare type AddEventListener = T extends ListenerType1 ? T['addEventListener'] : T extends ListenerType2 ? T['on'] : never; export declare type UseEventOptions = Parameters>[2]; declare const useEvent: (name: Parameters>[0], handler?: Parameters>[1] | null | undefined, target?: Window | T | null, options?: UseEventOptions | undefined) => void; export default useEvent;