/** * Stage 4.4 port of Base UI React's `useHoverInteractionSharedState`. * * React source: * `base-ui/packages/react/src/floating-ui-react/hooks/useHoverInteractionSharedState.ts` * * Exposes the `HoverInteraction` class — a plain mutable bag of state * shared between `useHoverReferenceInteraction` (reference-side) and * `useHoverFloatingInteraction` (floating-side) so both can cooperate on * cursor-type tracking, timers, and safe-polygon bookkeeping. * * The instance is attached to `rootStore.context.dataRef.current` under a * `hoverInteractionState` key so independent hook instances on the same * floating root share the same mutable bag (matches React). * * ### React → Solid deviations * * 1. `useRefWithInit(HoverInteraction.create)` → plain variable access. * Solid component bodies run once per mount, so `new HoverInteraction()` * at setup time matches React's one-shot initialization. * 2. `useOnMount(dispose)` → `onCleanup(dispose)` registered during setup. * Same effect: timers get cleared when the owning scope disposes. * 3. No reactivity is involved — all fields are plain mutables. The class * shape, `dispose()` semantics, and `Timeout` usage are copied 1:1. */ import { Timeout } from "../../use-timeout.js"; import type { FloatingRootStore } from "../components/floating-root-store.js"; import { isInteractiveElement } from "../utils/element.js"; import type { SafePolygonOptions } from "./use-hover-shared.js"; export { isInteractiveElement }; /** * Shared mutable state bag for a single floating root's hover cluster. */ export declare class HoverInteraction { pointerType: string | undefined; interactedInside: boolean; handler: ((event: MouseEvent) => void) | undefined; blockMouseMove: boolean; performedPointerEventsMutation: boolean; pointerEventsScopeElement: HTMLElement | SVGSVGElement | null; pointerEventsReferenceElement: HTMLElement | SVGSVGElement | null; pointerEventsFloatingElement: HTMLElement | null; restTimeoutPending: boolean; openChangeTimeout: Timeout; restTimeout: Timeout; handleCloseOptions: SafePolygonOptions | undefined; constructor(); static create(): HoverInteraction; dispose: () => void; } type PointerEventsMutationState = Pick; export declare function clearSafePolygonPointerEventsMutation(instance: PointerEventsMutationState): void; export declare function applySafePolygonPointerEventsMutation(instance: PointerEventsMutationState, options: { scopeElement: HTMLElement | SVGSVGElement; referenceElement: HTMLElement | SVGSVGElement; floatingElement: HTMLElement; }): void; /** * Returns the `HoverInteraction` bag for the given root store, creating * and caching it on the shared `dataRef` if needed. All hover hooks that * cooperate on the same root share a single instance. */ export declare function useHoverInteractionSharedState(store: FloatingRootStore): HoverInteraction; //# sourceMappingURL=use-hover-interaction-shared-state.d.ts.map