import type { PropsLike } from "./merge-props-n.js"; /** * Cross-browser pointer-type a click originated from. * * Mirrors the string union in Base UI React's * `@base-ui/utils/useEnhancedClickHandler` — empty string means "unknown" * (no prior `pointerdown` was observed and the underlying `MouseEvent` * didn't surface a `pointerType`). */ export type InteractionType = "mouse" | "touch" | "pen" | "keyboard" | ""; /** * Accessor-or-value. Every gate on the handler may be supplied as a plain * value or a Solid accessor so consumers can thread reactive inputs without * materializing a memo. */ type MaybeAccessor = T | (() => T); export interface UseEnhancedClickHandlerOptions { /** * When `true` the produced handlers short-circuit: neither the pointer * snapshot nor the consumer callback runs. Defaults to `false`. */ disabled?: MaybeAccessor | undefined; } /** * Port of Base UI React's `useEnhancedClickHandler`. Returns a pair of * handlers (`onClick`, `onPointerDown`) that cooperate to derive the * interaction type of a click: * * - Chromium reports `pointerType` directly on the click event — we use it. * - WebKit / Gecko emit a plain `MouseEvent` on click; we fall back to the * pointer type captured on the most recent `pointerdown`. * - Keyboard activation is detected via `event.detail === 0`. * * The returned object is shaped so consumers can hand it straight to * `mergePropsN` without further massaging. Solid 2 notes: * * - Handlers are created once per consumer; they read `options.disabled` * at call time, so reactive accessors are picked up without recreating * the primitive. * - Unlike the React version, the consumer handler is NOT memoized — Solid * components don't re-run, so there is no identity churn to guard * against. Callers are responsible for wrapping a changing consumer * callback in `createStableCallback` if they need a stable identity. */ export declare function useEnhancedClickHandler(handler: (event: MouseEvent | PointerEvent, interactionType: InteractionType) => void, options?: UseEnhancedClickHandlerOptions): PropsLike; export {}; //# sourceMappingURL=use-enhanced-click-handler.d.ts.map