/** * Host element binding API — reactive attr, class, style, and event bindings * applied directly to the component's host element or any target element. */ import { type Readable } from '@vielzeug/ripple'; /** * Describes a reactive or static host binding value. */ export type HostBindingValue = (() => string | number | boolean | null | undefined) | Readable | string | number | boolean | null | undefined; /** * Configuration for host attribute bindings. */ export type ReflectConfig = Record; type HostClassBindingValue = Readable | (() => boolean) | boolean; type HostEventListener = { bivarianceHack(event: Event): void; }['bivarianceHack']; export type HostBindConfig = { /** * ARIA attributes, keyed by bare property name (`expanded`) or fully-qualified * (`aria-expanded`) — both normalize to the same attribute. A separate key from `attr` * only so bare names can be normalized; the underlying write path is identical. */ aria?: ReflectConfig; attr?: ReflectConfig; class?: (() => Record) | Record; on?: Record; style?: Record; }; export type BindOptions = AddEventListenerOptions & { /** * Target element to bind to. Defaults to the host element when called * via `bind()`. Pass an explicit element to bind to any other element * (e.g. a slotted trigger or an internally-referenced child element). * When a target is provided, cleanup is always auto-registered with the * component scope if one is active. */ target?: Element; }; export type HostBindFn = (config: HostBindConfig, options?: BindOptions) => () => void; /** * Apply reactive or static bindings to an element's attributes, classes, styles, * and events. Defaults to the current component's host element; pass * `options.target` to bind to any other element (e.g. a slotted trigger, an * internally-referenced child). */ export declare const bind: HostBindFn; export {}; //# sourceMappingURL=host-bind.d.ts.map