import type { KeyboardEvent, MouseEvent, PointerEvent } from 'react'; /** The handlers a busy button must not run. */ export interface LoadingGuardHandlers { onClickCapture?: (event: MouseEvent) => void; onPointerDown?: (event: PointerEvent) => void; onMouseDown?: (event: MouseEvent) => void; onKeyDown?: (event: KeyboardEvent) => void; } /** * A loading button ignores activation but keeps keyboard focus: native * `disabled` would drop focus to the page. The click is stopped as it * starts, before any handler runs (an `asChild` child's own too), and * cancelled, so a submit does not send and a link does not navigate. * Presses, Enter and Space skip the given handlers, so a menu trigger * wrapped round the button does not open. Other keys still reach them, * so a roving group round it keeps its arrow keys and Shift+Tab. Spread * the result onto the button, with `aria-disabled` set while loading. */ export declare function loadingGuard(loading: boolean, handlers: LoadingGuardHandlers): LoadingGuardHandlers; //# sourceMappingURL=loading-guard.d.ts.map