import { Renderable } from '../types/domain'; import { DOMContext, HandlerOptions } from '../dom/dom-context'; /** * Provides type-safe delegated event handlers for all HTML events. * * The `delegate` object is a proxy that creates event handlers attached to the * **container element** rather than individual children. Events are matched * against a CSS selector using `Element.closest()`, making this ideal for lists * and other containers with many similar children. * * Unlike `on`, which attaches one listener per element, `delegate` attaches a * single listener on the container regardless of how many children match. * * @example * ```typescript * // Delegated click on list items — one listener on the