import { MOUSE_BUTTON } from './winapi/user32'; import type { WindowsDriver } from '../driver'; type MouseButtonName = (typeof MOUSE_BUTTON)[keyof typeof MOUSE_BUTTON]; /** One key action for {@link windowsKeys}; only one of `pause`, `text`, or `virtualKeyCode` should be set. */ interface KeyAction { pause?: number; text?: string; virtualKeyCode?: number; /** With `virtualKeyCode`, set to depress (`true`) or release (`false`) instead of a full keypress. */ down?: boolean; } /** * Performs single click mouse gesture. * * @param elementId Hexadecimal identifier of the element to click on. * If this parameter is missing then given coordinates will be parsed as absolute ones. * Otherwise they are parsed as relative to the top left corner of this element. * @param x Integer horizontal coordinate of the click point. Both x and y coordinates * must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param y Integer vertical coordinate of the click point. Both x and y coordinates * must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param button Name of * the mouse button to be clicked. An exception is thrown if an unknown button name * is provided. * @param modifierKeys List of possible keys or a single key name to * depress while the click is being performed. Supported key names are: Shift, Ctrl, Alt, Win. * For example, in order to keep Ctrl+Alt depressed while clicking, provide the value of * ['ctrl', 'alt'] * @param durationMs The number of milliseconds to wait between pressing * and releasing the mouse button. By default no delay is applied, which simulates a * regular click. * @param times How many times the click must be performed. * @param interClickDelayMs Duration od the pause between each * click gesture. Only makes sense if `times` is greater than one. * @throws If given options are not acceptable or the gesture has failed. */ export declare function windowsClick(this: WindowsDriver, elementId?: string, x?: number, y?: number, button?: MouseButtonName, modifierKeys?: string | string[], durationMs?: number, times?: number, interClickDelayMs?: number): Promise; /** * Performs horizontal or vertical scrolling with mouse wheel. * * @param elementId Hexadecimal identifier of the element to scroll. * If this parameter is missing then given coordinates will be parsed as absolute ones. * Otherwise they are parsed as relative to the top left corner of this element. * @param x Integer horizontal coordinate of the scroll point. Both x and y coordinates * must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param y Integer vertical coordinate of the scroll point. Both x and y coordinates * must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param deltaX Integer horizontal scroll delta. Either this value * or deltaY must be provided, but not both. * @param deltaY Integer vertical scroll delta. Either this value * or deltaX must be provided, but not both. * @param modifierKeys List of possible keys or a single key name to * depress while the scroll is being performed. Supported key names are: Shift, Ctrl, Alt, Win. * For example, in order to keep Ctrl+Alt depressed while clicking, provide the value of * ['ctrl', 'alt'] * @throws If given options are not acceptable or the gesture has failed. */ export declare function windowsScroll(this: WindowsDriver, elementId?: string, x?: number, y?: number, deltaX?: number, deltaY?: number, modifierKeys?: string | string[]): Promise; /** * Performs drag and drop mouse gesture. * * @param startElementId Hexadecimal identifier of the element to start the drag from. * If this parameter is missing then given coordinates will be parsed as absolute ones. * Otherwise they are parsed as relative to the top left corner of this element. * @param startX Integer horizontal coordinate of the drag start point. Both startX * and startY coordinates must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param startY Integer vertical coordinate of the drag start point. Both startX and * startY coordinates must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param endElementId Hexadecimal identifier of the element to end the drag on. * If this parameter is missing then given coordinates will be parsed as absolute ones. * Otherwise they are parsed as relative to the top left corner of this element. * @param endX Integer horizontal coordinate of the drag end point. Both endX and endY coordinates * must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param endY Integer vertical coordinate of the drag end point. Both endX and endY coordinates * must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param modifierKeys List of possible keys or a single key name to * depress while the drag is being performed. Supported key names are: Shift, Ctrl, Alt, Win. * For example, in order to keep Ctrl+Alt depressed while clicking, provide the value of * ['ctrl', 'alt'] * @param durationMs The number of milliseconds to wait between pressing * the left mouse button and moving the cursor to the ending drag point. * @throws If given options are not acceptable or the gesture has failed. */ export declare function windowsClickAndDrag(this: WindowsDriver, startElementId?: string, startX?: number, startY?: number, endElementId?: string, endX?: number, endY?: number, modifierKeys?: string | string[], durationMs?: number): Promise; /** * Performs hover mouse gesture. * * @param startElementId Hexadecimal identifier of the element to start the hover from. * If this parameter is missing then given coordinates will be parsed as absolute ones. * Otherwise they are parsed as relative to the top left corner of this element. * @param startX Integer horizontal coordinate of the hover start point. Both startX * and startY coordinates must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param startY Integer vertical coordinate of the hover start point. Both startX and * startY coordinates must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param endElementId Hexadecimal identifier of the element to end the hover on. * If this parameter is missing then given coordinates will be parsed as absolute ones. * Otherwise they are parsed as relative to the top left corner of this element. * @param endX Integer horizontal coordinate of the hover end point. Both endX and endY coordinates * must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param endY Integer vertical coordinate of the hover end point. Both endX and endY coordinates * must be provided or none of them if elementId is present. In such case the gesture * will be performed at the center point of the given element. * @param modifierKeys List of possible keys or a single key name to * depress while the hover is being performed. Supported key names are: Shift, Ctrl, Alt, Win. * For example, in order to keep Ctrl+Alt depressed while hovering, provide the value of * ['ctrl', 'alt'] * @param durationMs The number of milliseconds between * moving the cursor from the starting to the ending hover point. * @throws If given options are not acceptable or the gesture has failed. */ export declare function windowsHover(this: WindowsDriver, startElementId?: string, startX?: number, startY?: number, endElementId?: string, endX?: number, endY?: number, modifierKeys?: string | string[], durationMs?: number): Promise; /** * Performs customized keyboard input. * * @param actions - One or more key actions. * @throws If given options are not acceptable or the gesture has failed. */ export declare function windowsKeys(this: WindowsDriver, actions: KeyAction | KeyAction[]): Promise; export {}; //# sourceMappingURL=gestures.d.ts.map