import { TemplateResult } from 'lit'; type AlignTo = HTMLElement | string | (() => HTMLElement | null); type BoundsStrategy = 'element' | 'offsetParent' | 'closest' | 'union'; export interface DropdownPortalOptions { alignTo?: AlignTo; boundsStrategy?: BoundsStrategy; closestSelector?: string; unionSelector?: string; offset?: { x?: number; y?: number; }; /** If true, clamp portal to viewport horizontally */ clampToViewport?: boolean; /** * The DOM element to append the portal to. * - `document.body` (default): portal uses `position: fixed` — escapes overflow containers. * - Any other element: portal uses `position: absolute` — respects the container's overflow * and disappears naturally when the trigger scrolls out of view. * * Use `overflow-strategy="clip"` on `ctt-dropdown-input` to enable auto-detection, * or set `portalContainer` directly for deterministic control. */ portalTarget?: HTMLElement; } /** * Walk up the composed tree (crossing shadow root boundaries via assignedSlot and getRootNode). * Required to find overflow ancestors when the component is inside a shadow DOM. */ export declare function getComposedParent(node: Node): Node | null; export interface DropdownPortalRef { container: HTMLElement; updateContent(newContent: HTMLElement | string | TemplateResult): void; updatePosition(): void; remove(): void; } export declare function createDropdownPortal(id: string, content: HTMLElement | string | TemplateResult, sourceElement: HTMLElement, options?: DropdownPortalOptions): DropdownPortalRef; /** * Position the portal below (or above) the anchor element. * * Two modes: * - **Fixed** (default, `portalTarget` is `document.body`): * Uses viewport coordinates. Flips above if overflowing the viewport bottom. * Clamps horizontally within the viewport. * * - **Absolute** (`portalTarget` is a specific container): * Uses coordinates relative to the container, accounting for its scroll offset. * No viewport flip — the container's overflow clips the portal naturally, * so the portal disappears when the trigger scrolls out of view. */ export declare function updatePortalPosition(id: string, sourceElement: HTMLElement, options?: DropdownPortalOptions): void; export declare function removeDropdownPortal(id: string): void; export declare function hasDropdownPortal(id: string): boolean; export declare function getDropdownPortal(id: string): HTMLElement | null; export declare function cleanupAllPortals(): void; export {};