import type { ReactStore } from '@base-ui/utils/store'; import { BaseUIChangeEventDetails } from "../../types/index.mjs"; import { PopupStoreContext, PopupStoreSelectors, PopupStoreState } from "../../utils/popups/index.mjs"; import { FloatingRootStore } from "../components/FloatingRootStore.mjs"; /** * Narrowed to the store members this hook uses so consumers do not need to provide * unrelated store capabilities. */ export type SyncedFloatingRootContextStore> = Pick, PopupStoreContext, PopupStoreSelectors>, 'context' | 'state' | 'useState' | 'useSyncedValue'>; export interface UseSyncedFloatingRootContextOptions, OpenChangeEventDetails extends BaseUIChangeEventDetails> { popupStore: SyncedFloatingRootContextStore; /** * Whether the Popup element is passed to Floating UI as the floating element instead of the default Positioner. */ treatPopupAsFloatingElement?: boolean | undefined; floatingRootContext?: FloatingRootStore | undefined; floatingId: string | undefined; nested: boolean; onOpenChange(open: boolean, eventDetails: OpenChangeEventDetails): void; } /** * Keeps a FloatingRootStore in sync with the provided PopupStore. * Uses the provided FloatingRootStore when one exists, otherwise creates one once and updates it on every render. */ export declare function useSyncedFloatingRootContext, OpenChangeEventDetails extends BaseUIChangeEventDetails>(options: UseSyncedFloatingRootContextOptions): FloatingRootStore;