/** * Adds an event listener to a given element. * * @example * const button = document.createElement('button') * document.body.appendChild(button) * addEvent(button, 'click', () => console.log('Button clicked!')) * button.click() * * @param ele - The element to which the event listener should be added. * @param type - The type of event to listen for. * @param eventHandle - The function to be called when the event occurs. * @param options - Additional options to modify the behavior of the event listener. * @param options.useCapture - A boolean indicating whether events of this type should be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree. * @param options.useThrottle - A boolean indicating whether the event handler should be throttled. * @param options.useDebounce - A boolean indicating whether the event handler should be debounced. * @returns A function to remove the event listener. * @since 1.0.0 */ declare const addEvent: (ele: T, type: keyof HTMLElementEventMap, eventHandle: (ev: HTMLElementEventMap[keyof HTMLElementEventMap]) => void, { useCapture, useThrottle, useDebounce }?: { useCapture?: boolean | undefined; useThrottle?: boolean | undefined; useDebounce?: boolean | undefined; }) => (() => void) | undefined; export default addEvent;