import { type KeySpec, type ModifierKey } from "./keys.js"; import type { CdpSend, Point } from "./types.js"; export type MouseButton = "left" | "right" | "middle"; /** Pointer position and the buttons and keys still held down in one tab. Kept * between calls so a press in one call and a release in a later one form one * gesture. */ export declare class InputState { position: Point; buttons: number; /** On macOS, editing shortcuts only take effect when sent as editor commands. */ macEditing: boolean; readonly heldKeys: Map; get modifiers(): number; get heldButton(): MouseButton | "none"; } export interface ClickOptions { button?: MouseButton; clickCount?: number; modifiers?: ModifierKey[]; } type InputEvents = Array<[string, Record]>; /** Input events for one gesture are written back to back without awaiting each in * turn: the browser processes them in arrival order, so the gesture costs one * round trip instead of one per event. */ export declare function dispatchAll(send: CdpSend, sessionId: string, events: InputEvents): Promise; export declare function clickAt(send: CdpSend, sessionId: string, state: InputState, point: Point, opts?: ClickOptions): Promise; export declare function mouseMove(send: CdpSend, sessionId: string, state: InputState, point: Point): Promise; export declare function mouseDown(send: CdpSend, sessionId: string, state: InputState, point?: Point, button?: MouseButton): Promise; export declare function mouseUp(send: CdpSend, sessionId: string, state: InputState, point?: Point, button?: MouseButton): Promise; /** Press at `from`, move in steps, release at `to`. */ export declare function drag(send: CdpSend, sessionId: string, state: InputState, from: Point, to: Point, steps?: number): Promise; export declare function wheelAt(send: CdpSend, sessionId: string, state: InputState, point: Point, deltaX: number, deltaY: number): Promise; /** Presses one chord ("ctrl+a", ["Control", "C"], "Return") `repeat` times, * pressing modifiers first and releasing them last. */ export declare function pressChord(send: CdpSend, sessionId: string, state: InputState, chord: string | string[], repeat?: number): Promise; /** Presses each space-separated chord in turn: "ctrl+a Delete". */ export declare function pressSequence(send: CdpSend, sessionId: string, state: InputState, sequence: string, repeat?: number): Promise; export declare function keyDown(send: CdpSend, sessionId: string, state: InputState, name: string): Promise; export declare function keyUp(send: CdpSend, sessionId: string, state: InputState, name: string): Promise; /** Releases every held mouse button and key so a failed or closing session * never leaves the page with a stuck modifier or a drag in progress. */ export declare function releaseAll(send: CdpSend, sessionId: string, state: InputState): Promise; export {}; //# sourceMappingURL=input.d.ts.map