import { ReactiveController, ReactiveElement } from 'lit';
export interface SlotTextConfig {
/**
* The slot name to observe. Use `''` (empty string) for the default slot.
*
* @default '' (default slot)
*/
slotName?: string;
/**
* CSS selectors for elements to exclude when checking for content.
* Matched elements are ignored — only non-excluded elements and
* non-empty text nodes count as "content."
*/
excludeSelectors?: string[];
}
/**
* A reactive controller that observes whether a slot contains meaningful
* text or element content.
*
* Replaces the `ObserveSlotText` mixin with a composition-based approach.
*
* Monitors for `characterData` mutations (text changes) and re-evaluates
* on slot change events. The host is requested to update whenever the
* content state changes.
*
* @example
* ```typescript
* class MyButton extends SpectrumElement {
* private slotText = new SlotTextController(this);
*
* get hasLabel(): boolean {
* return this.slotText.hasContent;
* }
*
* override render() {
* return html``;
* }
* }
* ```
*
* @example
* ```typescript
* // Named slot with exclusions
* class MyComponent extends SpectrumElement {
* private slotText = new SlotTextController(this, {
* slotName: 'description',
* excludeSelectors: ['.visually-hidden'],
* });
* }
* ```
*/
export declare class SlotTextController implements ReactiveController {
private host;
private slotName;
private excludeSelectors;
private observer;
private _hasContent;
constructor(host: ReactiveElement, config?: SlotTextConfig);
/**
* Whether the observed slot has meaningful content (text nodes or
* non-excluded elements).
*/
get hasContent(): boolean;
/**
* Bind this to the slot's `@slotchange` event in the template.
*
* @example
* ```html
*
* ```
*/
handleSlotChange: (event: Event) => void;
private evaluateNodes;
/**
* Checks initial content from light DOM children before the first render,
* before slots are assigned.
*
* This runs from `hostConnected`, which Lit invokes during the host's
* `connectedCallback` — before the first `update()`. It sets `_hasContent`
* directly and intentionally does not call `requestUpdate()`: the first
* render has not happened yet, so it will read the correct value when it
* runs. This differs from the `ObserveSlotText` mixin, where `slotHasContent`
* was a reactive `@property` assigned in `update()`. After the first render,
* `handleSlotChange` (bound via `@slotchange`) and the `characterData`
* observer take over and do call `requestUpdate()` on change. The
* controller stories cover initial content being reflected on first paint.
*/
private checkInitialContent;
private checkContent;
hostConnected(): void;
hostDisconnected(): void;
}