import { ReactiveController, ReactiveElement } from 'lit'; export interface SlotAttributePropagationControllerOptions { /** The attribute name to propagate to assigned elements. */ attribute: string; /** * Returns the current value to propagate. Return `null` to remove the * attribute from assigned elements, for attributes that are only * sometimes present on the host. */ getValue: () => string | null; /** Named slot to target. Omit for the default (unnamed) slot. */ slotName?: string; /** * CSS selector used to filter assigned elements before propagating. * Omit to propagate to all assigned elements. */ selector?: string; } /** * A Lit {@link ReactiveController} that propagates an attribute from the host * element to elements assigned to one of its slots. * * The controller automatically re-propagates in `hostUpdated()` whenever the * value returned by `getValue` changes. Call `propagate()` from the host's * `slotchange` handler to cover elements inserted after the first render. * * `getValue` may return `null` for attributes that are only sometimes present * on the host; the controller removes the attribute from assigned elements * rather than setting it to an empty string. * * @example * ```ts * class MyBase extends SpectrumElement { * @property({ type: String, reflect: true }) * public size: MySize = 'm'; * * private readonly _sizePropagation = new SlotAttributePropagationController(this, { * attribute: 'size', * getValue: () => this.size, * slotName: 'actions', * }); * * protected handleActionsSlotChange(): void { * this._sizePropagation.propagate(); * } * } * ``` */ export declare class SlotAttributePropagationController implements ReactiveController { private readonly _host; private readonly _options; private _previousValue?; constructor(host: ReactiveElement, options: SlotAttributePropagationControllerOptions); hostDisconnected(): void; hostUpdated(): void; /** * Propagates the current value to all matching assigned elements * immediately, updating the value tracked for the `hostUpdated()` no-op * guard so it isn't repeated once the pending update runs. Call this from * the host's `slotchange` event handler. */ propagate(): void; private _propagateToSlot; private _resolveSlot; }