/**
 * @file useTouchTrigger.ts
 * @input Touch trigger mode, layer open state, trigger ref, show/hide callbacks
 * @output Exports useTouchTrigger hook, isActionTrigger, LayerTouchTrigger type
 * @position Layer hook; shared touch behavior for useTooltip and useHoverCard
 *
 * SYNC: When modified, update:
 * - /packages/core/src/Layer/index.ts
 *
 * Hover is the one trigger a touch screen cannot express. A tap synthesizes
 * `mouseenter`, so an untreated hover layer either opens on every tap and
 * lingers with nothing to close it, or swallows the tap the user aimed at the
 * control underneath.
 *
 * What the trigger DOES decides which of those the tap deserves. A trigger
 * that performs an action — a button, a link, a form control — keeps its tap:
 * the layer stays shut, because the tap already has somewhere to go and a hint
 * about a control the user just operated is noise. A trigger that performs no
 * action — an info icon, an abbreviation, a truncated label — has nothing to
 * lose, so the tap opens the layer and the next tap outside dismisses it. That
 * is `auto`; `tap` and `none` state the choice outright, which is what an
 * icon-button whose only job is to reveal the layer needs.
 */
import { type RefObject } from 'react';
/**
 * How a hover layer behaves on a touch pointer.
 *
 * - `auto`: tap-to-open, unless the trigger performs an action of its own
 * - `tap`: always tap-to-open, even on a trigger that performs an action
 * - `none`: never open on touch
 */
export type LayerTouchTrigger = 'auto' | 'tap' | 'none';
/**
 * Whether activating this element does something other than reveal the layer.
 *
 * Deliberately narrower than "focusable": the wrapper a text-only Tooltip
 * renders carries `tabindex=0` so keyboard users can reach the hint, and it
 * still performs no action.
 *
 * True only decides that the layer stays shut — the tap itself is never
 * swallowed. Nothing here calls `preventDefault` or `stopPropagation`, so an
 * inert trigger that happens to carry its own `onClick` (a `<div onClick>`
 * with no role) gets both: the layer opens and the handler runs.
 */
export declare function isActionTrigger(element: HTMLElement): boolean;
export interface UseTouchTriggerOptions {
    /** How the layer should behave on a touch pointer. */
    touchTrigger: LayerTouchTrigger;
    /** Whether the layer's triggers are live at all. */
    isEnabled: boolean;
    /**
     * Whether the consumer controls visibility. A controlled layer is never
     * toggled by a tap — its visibility is the consumer's to own.
     */
    isControlled: boolean;
    /** Whether the layer is currently open. */
    isOpen: boolean;
    /** Element id of the layer surface, so taps inside it count as inside. */
    layerId: string;
    /** The trigger element the layer is anchored to. */
    triggerRef: RefObject<HTMLElement | null>;
    /** Open the layer immediately, with no hover delay. */
    show: () => void;
    /** Close the layer immediately. */
    hide: () => void;
}
export interface UseTouchTriggerReturn {
    /**
     * Whether the pointer in play on this trigger has no hover of its own: a
     * finger, or a pen that has landed. A hovering pen reads as false, because
     * it hovers.
     */
    isTouchPointerRef: RefObject<boolean>;
    /**
     * Whether the interaction in flight is a touch one. Unlike the raw ref this
     * goes false again as soon as the user reaches for the keyboard, so
     * focus-driven triggers stay available after a tap.
     */
    isTouchInteraction: () => boolean;
    /**
     * Attach to the trigger: records pointer type ahead of synthesized hover.
     * Arrival alone only marks a finger — a pen hovers, so it is left to the
     * hover path until it presses.
     */
    handlePointerEnter: (event: PointerEvent) => void;
    /**
     * Attach to the trigger. Returns true when the press was a touch one and
     * this hook has dealt with it, meaning the caller's own pointer-down
     * behavior must not also run.
     */
    handlePointerDown: (event: PointerEvent) => boolean;
    /** Forget a tap-open. Call from every other close path (Escape, controlled). */
    clearTapOpen: () => void;
}
/**
 * Touch behavior shared by the hover layers.
 *
 * @example
 * ```
 * const touch = useTouchTrigger({
 *   touchTrigger,
 *   isEnabled,
 *   isControlled: isOpen !== undefined,
 *   isOpen: layer.isOpen,
 *   layerId: layer.id,
 *   triggerRef,
 *   show: showNow,
 *   hide: hideNow,
 * });
 * ```
 */
export declare function useTouchTrigger(options: UseTouchTriggerOptions): UseTouchTriggerReturn;
//# sourceMappingURL=useTouchTrigger.d.ts.map