import { Handle } from 'dojo-interfaces/core'; /** * Provides a normalized mechanism for using a single event handler to listen * to delegated events from DOM nodes. * * @param target The Element to which to attach a single event handler * @param selector A CSS selector used to determine whether the event handler is called * @param type Event type(s) to listen for; may be strings or extension events * @param listener Callback to handle the event when it fires * @return A handle which will remove the listener when destroy is called * * @example * dom.delegate(document.body, 'li', 'click', function () { * // ... * }); * * @example * dom.delegate(document.body, 'li', ['click', 'mouseover'], function () { * // ... * }); */ export default function delegate(target: HTMLElement, selector: string, type: string, listener: (event: UIEvent) => void): Handle; export default function delegate(target: HTMLElement, selector: string, type: string[], listener: (event: UIEvent) => void): Handle;