import type { Position, Size } from '@appium/types'; export type User32 = { SendInput: (cInputs: number, pInputs: unknown, cbSize: number) => Promise; GetSystemMetrics: (nIndex: number) => Promise; SetProcessDpiAwarenessContext: (value: number) => Promise; }; export type KeyInput = { type: number; union: { ki: { wVk: number; time: number; dwExtraInfo: number; wScan: number; dwFlags: number; }; }; }; export type MouseInput = { type: number; union: { mi: { time: number; dwExtraInfo: number; dwFlags: number; dx: number; dy: number; mouseData: number; }; }; }; export declare const KEYEVENTF_KEYUP = 2; export declare const KEY_ACTION: Readonly<{ UP: "up"; DOWN: "down"; }>; export declare const MODIFIER_KEY: Readonly<{ shift: 16; ctrl: 17; alt: 18; win: 91; }>; export declare const MOUSE_BUTTON: Readonly<{ LEFT: "left"; MIDDLE: "middle"; RIGHT: "right"; BACK: "back"; FORWARD: "forward"; }>; export declare const MOUSE_BUTTON_ACTION: Readonly<{ UP: "up"; DOWN: "down"; CLICK: "click"; }>; export interface MouseButtonOptions { button: (typeof MOUSE_BUTTON)[keyof typeof MOUSE_BUTTON]; action: (typeof MOUSE_BUTTON_ACTION)[keyof typeof MOUSE_BUTTON_ACTION]; } type KeybdInputFields = Partial<{ wVk: number; wScan: number; dwFlags: number; time: number; dwExtraInfo: number; }>; /** * Builds an INPUT structure for keyboard injection via SendInput. * * @param params Key input field overrides merged into the default keyboard payload. */ export declare function createKeyInput(params?: KeybdInputFields): KeyInput; /** * Sends input structure(s) to the SendInput WinAPI (prefer batching keyboard inputs). * * @param inputs A single INPUT payload or an array of INPUT payloads. * @returns Number of successfully sent input payloads. */ export declare function handleInputs(inputs: object | object[]): Promise; /** Ensures DPI awareness for the current process. */ export declare const ensureDpiAwareness: (() => Promise) & { cache: Map>; }; /** * Builds a mouse button SendInput structure (click, press, or release). * * @param opts Mouse button and action pair to convert. * @returns SendInput payload for the requested button action. */ export declare function toMouseButtonInput({ button, action, }: MouseButtonOptions): Promise; /** * Transforms mouse move parameters into a SendInput structure. * * @param x Absolute horizontal cursor coordinate. * @param y Absolute vertical cursor coordinate. * @param screenSize Optional virtual screen size cache; fetched when omitted. * @returns SendInput payload for moving the mouse to the target coordinates. * @see https://www.reddit.com/r/cpp_questions/comments/1eslzdv/difficulty_with_win32_mouse_position/ */ export declare function toMouseMoveInput(x: number, y: number, screenSize?: Size | null): Promise; /** * Builds a mouse wheel SendInput structure, or returns null when the delta is zero. * * @param dx Horizontal scroll delta. Provide either this or `dy`. * @param dy Vertical scroll delta. Provide either this or `dx`. * @returns SendInput payload, or null when effective scroll delta is zero. */ export declare function toMouseWheelInput(dx?: number, dy?: number): MouseInput | null; /** * Expands Unicode text into key-down/key-up SendInput pairs (Unicode mode). * * @param text Text to emit as keyboard input. * @returns Sequence of keyboard INPUT payloads. */ export declare function toUnicodeKeyInputs(text: string): KeyInput[]; /** Virtual monitor width/height from GetSystemMetrics. */ export declare function getVirtualScreenSize(): Promise; /** Virtual monitor origin from GetSystemMetrics. */ export declare function getVirtualScreenPosition(): Promise; export {}; //# sourceMappingURL=user32.d.ts.map