UNPKG

@equinor/fusion-react-utils

Version:
10 lines 656 B
import type { EventHandler, RefObject, SyntheticEvent } from 'react'; /** * Add event listeners to a native element * @param ref React ref object of native element * @param eventHandlers handler to attach to element, must match map (normally props of component) * @param eventMap Map of events where key is prop name and value is event name */ export declare const useElementEvents: <E extends HTMLElement, K extends string, P extends Partial<Record<K, EventHandler<SyntheticEvent<E, Event>>>>>(ref: RefObject<E>, eventHandlers?: P, eventMap?: Record<K, string>) => void; export default useElementEvents; //# sourceMappingURL=useElementEvents.d.ts.map