import { type HookErrorHandler } from '../utils/errors.js'; /** A ref-like object whose current value is an event target. @public */ export type EventListenerRefTarget = { readonly current: EventTarget | null; }; /** A direct event target, a ref-like target, or an empty target. @public */ export type EventListenerTarget = EventTarget | null | undefined | EventListenerRefTarget; /** The callback accepted by the untyped event-listener overloads. @public */ export type EventListenerCallback = (event: Event) => void; /** Native listener options plus an optional error observer. @public */ export interface UseEventListenerOptions extends AddEventListenerOptions { /** Observes callback failures before they are rethrown. */ readonly onError?: HookErrorHandler; } type EventListenerOptions = boolean | UseEventListenerOptions; /** * Subscribes to a Window event while always invoking the latest committed * callback. The target overload also accepts ref-like targets. * @public */ export declare function useEventListener(type: K, listener: (event: WindowEventMap[K]) => void, options?: EventListenerOptions): void; /** @public */ export declare function useEventListener(target: EventListenerTarget, type: K, listener: (event: GlobalEventHandlersEventMap[K]) => void, options?: EventListenerOptions): void; /** @public */ export declare function useEventListener(type: string, listener: EventListenerCallback, options?: EventListenerOptions): void; /** @public */ export declare function useEventListener(target: EventListenerTarget, type: string, listener: EventListenerCallback, options?: EventListenerOptions): void; export {};