/** * Popover and Menu declare different `instantType` unions, so only the members * this hook touches are typed. */ interface TriggerSwitchStore { /** * Read raw, because the `instantType` selector deliberately hides * `trigger-change` while closed — which is exactly when it has to be cleared. */ readonly state: { readonly instantType: string | undefined; }; set(key: 'instantType', value: 'trigger-change' | undefined): void; select(key: 'open'): boolean; } export interface UseTriggerSwitchTransitionParameters { store: TriggerSwitchStore; /** * The trigger element that currently owns the popup. */ domReference: Element | null; positionerElement: HTMLElement | null; open: boolean; } /** * Lets the positioner animate while a popup moves between detached triggers. * * The positioner is normally marked instant, so a hand-off from one trigger to * another would teleport. Clearing `instantType` for the duration of the move * lets it transition, and `trigger-change` is restored once the move finishes. * * The restoration is deferred until the move's animations finish, so it can * outlive the move that scheduled it. The trigger element is retained through * the exit transition, so a close alone does not change `domReference` and * nothing would otherwise re-run this effect to abort it — a popup that closes * and reopens on the same trigger mid-exit would inherit the stale callback and * lose its own transition. Closing therefore cancels the pending restoration * explicitly. * * Applying `trigger-change` to a closed popup is prevented separately, by the * stores' `instantType` selector, since a controlled `open={false}` commit * reaches the popup without passing through `setOpen`. */ export declare function useTriggerSwitchTransition(parameters: UseTriggerSwitchTransitionParameters): void; export {};