import { ReactiveController, ReactiveControllerHost } from 'lit'; import { SbbElementInternalsMixinType } from '../mixins.ts'; /** * Controller for managing overlays positioning. Also acts as a polyfill when native * CSS Anchor Positioning is not supported (enough). * Applies unique anchor names when using native CSS Anchor Positioning * or calculates and applies correct positions in polyfill mode. * * Also, the controller sets the 'data-position' attribute on the overlay element. * This can be used to apply specific styles based on the current position of the overlay. * * ### Implementation * Define and apply the following CSS variables on the overlay element: * ```scss * --sbb-overlay-position-area: block-end; // Default * --sbb-overlay-position-try-fallbacks: block-start, inline-end, inline-start; // Fallbacks * * position-area: var(--sbb-overlay-position-area); * position-try-fallbacks: var(--sbb-overlay-position-try-fallbacks); * ``` */ export declare class SbbOverlayPositionController implements ReactiveController { private _usePolyfill; private readonly _resizeObserver; private readonly _overlay; private _abortController?; private _anchor?; private _overlayStyles?; private _frame?; private _anchorName; private _positions; private _lastPosition?; /** Get the current position. (e.g. block-end, block-start, etc.) */ get currentPosition(): string; constructor(host: ReactiveControllerHost & HTMLElement & SbbElementInternalsMixinType, _usePolyfill?: boolean); hostConnected(): void; hostUpdate(): void; /** * Connects the overlay to the given trigger element and determines the optimal position. * Usually, this is called when the overlay is opened. * @param anchor The anchor element. */ connect(anchor: HTMLElement): void; disconnect(): void; private _requestCalculatePosition; private _calculatePosition; /** * Calculates the optimal position that fits the overlay. * @param positions The list of positions to check. * @private */ private _getOptimalPosition; private _applyOverlayPosition; /** * Only used in polyfill mode. * Reads the list of the configured positions from the CSS variables. * @private */ private _readPositionsFromCss; } //# sourceMappingURL=overlay-position-controller.d.ts.map