import { CSSResultGroup, CSSResultOrNative, LitElement, PropertyDeclaration, PropertyValues, ReactiveController } from 'lit'; export interface SbbStateController { add(value: string): this; delete(value: string): boolean; has(value: string): boolean; toggle(value: string, force?: boolean): void; } /** * Creates a state controller for the given element. * NOT INTENDED TO BE USED BY CONSUMERS! * @internal */ export declare function ɵstateController(element: Element): SbbStateController; export declare function ɵstateController(element: Element | undefined | null): SbbStateController | null; export declare class SbbSlottedChangeEvent extends Event { readonly slot: HTMLSlotElement; constructor(slot: HTMLSlotElement); } export interface SbbPropertyValues { oldValue?: unknown; value?: unknown; } export interface SbbReactiveController extends ReactiveController { hostPropertyUpdate?(name: PropertyKey, values?: SbbPropertyValues, options?: PropertyDeclaration): void; } /** * Appends the given elements to the given aria value and returns the * combined value as a new array or null, if both values were empty. */ export declare const appendAriaElements: (ariaValue: readonly Element[] | null, ...newElements: (Element | null)[]) => Element[] | null; /** * Removes the given elements from the given aria value and returns * the remaining elements as a new array or null, if the result is empty. */ export declare const removeAriaElements: (ariaValue: readonly Element[] | null, ...removableElements: (Element | null)[]) => Element[] | null; export type SbbElementType = typeof SbbElement; export interface SbbElementConstructor { elementDependencies?: SbbElementType[]; role?: ElementInternals['role']; } /** * A base class for all SBB elements. * Includes attaching ElementInternals, handling hydration, and managing state. */ export declare class SbbElement extends LitElement { static ['_$sbbElement$']: boolean; static readonly elementName: string; static elementDependencies?: SbbElementType[]; static role?: ElementInternals['role']; static styles: CSSResultGroup; /** @internal */ protected readonly internals: ElementInternals; private _controllers?; private _hydrationRequired; private _hydrationComplete; private _resolveHydration; private _textObserver?; /** * Returns a Promise that resolves when the element has completed hydration. * The Promise value is a boolean that is `true` if the element required hydration * and `false` if not. * * @return A promise of a boolean that resolves to true once the hydration completed. * @internal */ get hydrationComplete(): Promise; /** Returns whether hydration is required and not completed. */ protected get hydrationRequired(): boolean; constructor(); /** Register the custom element in the global CustomElementRegistry. */ static define(): void; /** * Collects `styles` from every class in the prototype chain (using `Object.hasOwn`) * and merges them in top-down order. This means each class/mixin only needs to declare * its **own** styles — there is no need to reference `super.styles`. * * Lit's default behaviour already walks the chain, but fails for mixins where * `super.styles` resolves to the wrong class. This override fixes that. */ protected static finalizeStyles(_styles: CSSResultGroup): CSSResultOrNative[]; protected createRenderRoot(): HTMLElement | DocumentFragment; /** * Registers a `ReactiveController` to participate in the element's reactive * update cycle. The element automatically calls into any registered * controllers during its lifecycle callbacks. * * If the element is connected when `addController()` is called, the * controller's `hostConnected()` callback will be immediately called. */ addController(controller: SbbReactiveController): void; /** * Removes a `ReactiveController` from the element. */ removeController(controller: SbbReactiveController): void; /** * Requests an update which is processed asynchronously. This should be called * when an element should update based on some state not triggered by setting * a reactive property. In this case, pass no arguments. It should also be * called when manually implementing a property setter. In this case, pass the * property `name` and `oldValue` to ensure that any configured property * options are honored. * * @param name name of requesting property * @param oldValue old value of requesting property * @param options property options to use instead of the previously * configured options * @param useNewValue if true, the newValue argument is used instead of * reading the property value. This is important to use if the reactive * property is a standard private accessor, as opposed to a plain * property, since private members can't be dynamically read by name. * @param newValue the new value of the property. This is only used if * `useNewValue` is true. */ requestUpdate(name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration, useNewValue?: boolean, newValue?: unknown): void; protected update(changedProperties: PropertyValues): void; protected toggleState(value: string, force?: boolean): void; private _slotchangeHandler; private _handleSlotChangeForSlottedState; private _updateSlottedState; private _observeTextNodesInSlot; private _hasSlottedContent; } declare global { interface HTMLElementEventMap { slottedchange: SbbSlottedChangeEvent; } interface ShadowRootEventMap { slottedchange: SbbSlottedChangeEvent; } } //# sourceMappingURL=element.d.ts.map