Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
Update typings to add move/resize/focus functions for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
s1hofmann committed Oct 9, 2023
1 parent bb56983 commit d60fc59
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export interface Rect {
export function setKeyboardDelay(ms: number): void;
export function keyTap(key: string, modifier?: string | string[]): void;
export function keyToggle(
key: string,
down: string,
modifier?: string | string[]
key: string,
down: string,
modifier?: string | string[]
): void;
export function typeString(string: string): void;
export function typeStringDelayed(string: string, cpm: number): void;
Expand All @@ -52,4 +52,31 @@ export function getActiveWindow(): number;
export function getWindowRect(handle: number): Rect;
export function getWindowTitle(handle: number): string;

/**
* Sets the focus to a specific window using its handle.
*
* @param {number} handle - The handle ID of the window to be focused.
* @returns {void}
*/
export function focusWindow(handle: number): void

/**
* Resizes a window by its handle to the given width and height.
* The window is moved to the x & y coordinates if specified.
*
* @param {number} handle - The handle ID of the window to be resized.
* @param {Size} newSize - The new size of the window.
* @returns {void}
*/
export function resizeWindow(handle: number, newSize: Size): void

/**
* Moves a window by its handle to the given x and y coordinates.
*
* @param {number} handle - The handle ID of the window to be resized.
* @param {Point} newOrigin - The new size of the window.
* @returns {void}
*/
export function moveWindow(handle: number, newOrigin: Point): void

export const screen: Screen;

0 comments on commit d60fc59

Please sign in to comment.