import { ReactStore } from '../../store/ReactStore'; import { PopupTriggerMap } from '../../utils/popups/PopupTriggerMap'; import type { TooltipRoot } from '../root/TooltipRoot'; export type State = { /** * The uncontrolled open state. Read through the `open` selector, which * resolves the controlled prop first. */ open: boolean; /** * The controlled `open` prop, when provided. */ openProp: boolean | undefined; /** * Whether the tooltip should ignore user interaction entirely. */ disabled: boolean; /** * Whether to prevent the tooltip from closing on presses outside the popup. */ disablePointerDismissal: boolean; /** * The anchor's native node, carried across the portal boundary. */ 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; update: (() => void) | undefined; /** * The payload of the trigger the tooltip was opened by, handed to the root's * children when they are a function. */ payload: unknown; /** * The id of the trigger the tooltip 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: TooltipRoot.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: TooltipRoot.ChangeEventDetails) => void) | undefined; /** * Every trigger bound to this tooltip, 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; disabled: (state: State) => boolean; 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; }; export declare class TooltipStore extends ReactStore, Context, typeof selectors> { constructor(initialState?: Partial); setOpen: (nextOpen: boolean, eventDetails: TooltipRoot.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=TooltipStore.d.ts.map