import { ReactStore } from '../../store/ReactStore'; import { PopupTriggerMap } from '../../utils/popups/PopupTriggerMap'; import type { PopoverRoot } from '../root/PopoverRoot'; export type State = { /** * The uncontrolled open state. Consumers must read through the `open` * selector, which resolves the controlled prop first. */ open: boolean; /** * The controlled `open` prop, when provided. Takes precedence over the * internal `open` state (mirrors Base UI's popup store). */ openProp: boolean | undefined; titleElementId: string | undefined; descriptionElementId: string | undefined; disablePointerDismissal: boolean; /** * The anchor's native node. The Positioner lives inside the portal, in a * different subtree from the Trigger, so the store is what carries it across. */ triggerNode: unknown; /** * The trigger's measured width, the React Native counterpart of the web's * `--anchor-width` CSS variable. */ triggerWidth: number | undefined; /** * The trigger's measured height. */ triggerHeight: number | undefined; /** * Set by the Positioner so the Trigger can request a reposition when it is * laid out. React Native has no `autoUpdate`. */ update: (() => void) | undefined; /** * The payload of the trigger the popup was opened by, handed to the root's * children when they are a function. */ payload: unknown; /** * The id of the trigger the popup is associated with, or `null` for none. */ triggerId: string | null; /** * The controlled `triggerId` prop, when provided. */ triggerIdProp: string | null | undefined; }; type Context = { onOpenChange: ((open: boolean, eventDetails: PopoverRoot.ChangeEventDetails) => void) | undefined; /** * Called once an enter or exit animation has settled, reported by the consumer * through `settled(open)`. zest does not animate anything, so it cannot know * when an animation ends — the consumer drives it and owns the signal. */ onOpenChangeComplete: ((open: boolean, eventDetails: PopoverRoot.ChangeEventDetails) => void) | undefined; /** * Every trigger bound to this popup, by id. A handle resolves `open(id)` * through this, which is what lets a trigger rendered outside the root open it. */ triggerNodes: PopupTriggerMap; }; declare const selectors: { open: (state: State) => boolean; titleElementId: (state: State) => string | undefined; descriptionElementId: (state: State) => string | undefined; disablePointerDismissal: (state: State) => boolean; triggerNode: (state: State) => unknown; triggerWidth: (state: State) => number | undefined; triggerHeight: (state: State) => number | undefined; update: (state: State) => (() => void) | undefined; payload: (state: State) => unknown; triggerId: (state: State) => string | null; }; /** * React Native adaptation of Base UI's PopoverStore. */ export declare class PopoverStore extends ReactStore, Context, typeof selectors> { constructor(initialState?: Partial); setOpen: (nextOpen: boolean, eventDetails: PopoverRoot.ChangeEventDetails) => void; /** * Reports that the enter or exit animation for `open` has settled. zest never * animates, so only the consumer knows when their animation finished; calling * this fires `onOpenChangeComplete` with the reason of the last committed * change. Fire-once per settle: a repeated call with the same value is ignored. */ settled: (open: boolean) => void; /** * The event details of the last committed open/close, for `onOpenChangeComplete`. */ private lastChangeEventDetails; /** * The last value `settled` fired for, so the same settle is not reported twice. */ private lastSettledOpen; } export {}; //# sourceMappingURL=PopoverStore.d.ts.map