///
import { type Readable } from 'svelte/store';
import type { ActionReturn } from 'svelte/action';
import type { PressEvent as IPressEvent, PressHandlers } from './events.js';
import type { EventBase, PointerType } from '../../types/index.js';
export type PressConfig = PressHandlers & {
/** Whether the target is in a controlled press state (e.g. an overlay it triggers is open). */
isPressed?: boolean;
/** Whether the press events should be disabled. */
isDisabled?: boolean;
/** Whether the target should not receive focus on press. */
preventFocusOnPress?: boolean;
/**
* Whether press events should be canceled when the pointer leaves the target while pressed.
* By default, this is `false`, which means if the pointer returns back over the target while
* still pressed, onPressStart will be fired again. If set to `true`, the press is canceled
* when the pointer leaves the target and onPressStart will not be fired if the pointer returns.
*/
shouldCancelOnPointerExit?: boolean;
/** Whether text selection should be enabled on the pressable element. */
allowTextSelectionOnPress?: boolean;
};
type PressActionReturn = ActionReturn) => void;
'on:pressstart'?: (e: CustomEvent) => void;
'on:pressend'?: (e: CustomEvent) => void;
'on:pressup'?: (e: CustomEvent) => void;
}>;
export type PressResult = {
/** Whether the target is currently pressed. */
isPressed: Readable;
/** A Svelte Action which handles applying the event listeners to the element. */
pressAction: (node: HTMLElement | SVGElement) => PressActionReturn;
};
declare class PressEvent implements IPressEvent {
#private;
type: IPressEvent['type'];
pointerType: PointerType;
target: Element;
shiftKey: boolean;
ctrlKey: boolean;
metaKey: boolean;
altKey: boolean;
constructor(type: IPressEvent['type'], pointerType: PointerType, originalEvent: EventBase);
continuePropagation(): void;
get shouldStopPropagation(): boolean;
}
/**
* Handles press interactions across mouse, touch, keyboard, and screen readers.
* It normalizes behavior across browsers and platforms, and handles many nuances
* of dealing with pointer and keyboard events.
*/
export declare function createPress(config?: PressConfig): PressResult;
export {};