/** * Leaf module shared by `` and ``. * * The two are deliberately unrelated classes -- `LyraTooltip` extends `LyraElement` directly rather * than `LyraPopover`, because a tooltip is a description attached to someone else's trigger while a * popover is a click-owned surface, and forcing one to inherit the other's open/close ownership * model would be worse than the duplication. What they genuinely do share is *anchor resolution*: * both accept the same `showAt()` rectangle and the same virtual-anchor / `anchor` / `for` / * slotted-trigger precedence, and both had a byte-identical private copy of each. Those two copies * live here instead, on this library's `x-shared.ts` convention. */ import type{VirtualAnchor}from'../../../internal/positioner.js'; /** * Coalesces a lifecycle request made again from inside its own synchronous preflight event. * * The state owner still decides whether an opposite request is meaningful. This gate only keeps * a same-target `show()`/`hide()` call from recursively dispatching the same event before the * outer call has had a chance to commit, and gives both callers the exact same completion promise. */ export declare class OverlayTransitionGate{private target?;private completion?;request(target:boolean,transition:()=>void|Promise):Promise;} /** The rectangle `showAt()` accepts on both components: a point, optional dimensions, and an * optional `contextElement` so Floating UI can resolve the right containing block. */ export type OverlayVirtualRect={x:number;y:number;width?:number;height?:number;contextElement?:Element;}; /** * Validates and normalizes a `showAt()` rectangle. * * Returns `undefined` for any non-finite coordinate or dimension, which both callers treat as * "ignore this call and leave the current open/anchor state unchanged" -- a `NaN` reaching Floating * UI would otherwise place the surface at an unrecoverable position rather than failing loudly. * Missing dimensions collapse to a zero-size point, and negative ones clamp to zero. */ export declare function normalizeVirtualRect(rect:OverlayVirtualRect):OverlayVirtualRect|undefined; /** * Resolves what a floating surface is positioned against, in the precedence both components * document: an explicit `showAt()` virtual anchor first, then the direct `anchor` element, then the * `for` idref (looked up in the host's own root, so it resolves inside a shadow tree as well as in * the document), then the slotted trigger. * * The trigger is passed in rather than read off the host because the two components track it under * different private names, and it is the only part of the chain that differs between them. */ export declare function resolveOverlayAnchor(host:Node&{getRootNode(options?:GetRootNodeOptions):Node;},sources:{virtualAnchor?:VirtualAnchor;anchor?:Element|null;for?:string;trigger?:Element|null;}):Element|VirtualAnchor|null; /** Watches structural and `id`-identity changes in the host's current root. Callers compare their * resolved anchor before doing any work, so unrelated mutations remain a cheap no-op. */ export declare function observeOverlayAnchorIdentity(host:Node,callback:()=>void):()=>void;