import { type Accessor } from "solid-js"; import type { PropsLike } from "../merge-props-n.js"; import { type InteractionType } from "../use-enhanced-click-handler.js"; export type { InteractionType }; export interface UseOpenInteractionTypeReturn { /** * The interaction type that opened the component, or `null` when the * component is not currently open. Reactive accessor — mirrors React's * `openMethod` state value. */ openMethod: Accessor; /** * Trigger props to spread onto the opening element. Shape matches Base UI * React's return: `{ onClick, onPointerDown }`, ready for `mergePropsN` * composition. */ triggerProps: PropsLike; } /** * Determines the interaction type (keyboard, mouse, touch, etc.) that * opened the component. * * Port of Base UI React's * `packages/react/src/utils/useOpenInteractionType.ts`. The semantic * contract matches 1:1: * * - While the component is closed, the next `pointerdown` / `click` on * the trigger captures the interaction type and stores it on open. * - While the component is open, additional clicks do NOT overwrite the * captured type — the React source gates `setOpenMethod` on `!open`. * - When `open` transitions `true → false`, the captured type is reset * to `null`. * - On iOS Safari the "hitslop" around touch targets can fire * `mousedown` without a matching `pointerdown`, producing an empty * `interactionType`. In that case we fall back to `"touch"`. * * Solid 2 notes: * * - `open` is an accessor — there is no render cycle, so consumers must * thread reactive state through signals. * - `useValueChanged` handles the `true → false` reset idiomatically. * - `handleTriggerClick` is wrapped with `createStableCallback` to * match React's `useStableCallback` contract; it's also what lets the * closure read the latest `open()` value at invocation time without * re-creating the inner callback. */ export declare function useOpenInteractionType(open: Accessor): UseOpenInteractionTypeReturn; //# sourceMappingURL=use-open-interaction-type.d.ts.map