@ahmic/autoit-js
Version:
Node.js bindings for AutoItX3.dll
64 lines (63 loc) • 1.73 kB
TypeScript
/**
* Enumeration for window states.
*/
export declare enum StateFlag {
/**
* Hides the window.
*/
Hide = 0,
/**
* Shows the window.
*/
Show = 5,
/**
* Minimizes the window.
*/
Minimize = 6,
/**
* Maximizes the window.
*/
Maximize = 3,
/**
* Restores the window to its original size and position.
*/
Restore = 9
}
/**
* Changes the state of a window.
*
* @param windowTitle The title of the window.
* @param windowText Optional text found in the window.
* @param flags The state flags to apply. See {@linkcode StateFlag} for details.
*
* @returns 1 if successful, 0 otherwise.
*
* @example
* ```typescript
* import { WinSetStateSync, StateFlag } from '@ahmic/autoit-js';
*
* WinSetStateSync('Untitled - Notepad', '', StateFlag.Minimize);
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/WinSetState.htm
*/
export declare function WinSetStateSync(windowTitle: string, windowText: string | undefined, flags: StateFlag): number;
/**
* Changes the state of a window.
*
* @param windowTitle The title of the window.
* @param windowText Optional text found in the window.
* @param flags The state flags to apply. See {@linkcode StateFlag} for details.
*
* @returns A promise that resolves to 1 if successful, or 0 otherwise.
*
* @example
* ```typescript
* import { WinSetState, StateFlag } from '@ahmic/autoit-js';
*
* await WinSetState('Untitled - Notepad', '', StateFlag.Minimize);
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/WinSetState.htm
*/
export declare function WinSetState(windowTitle: string, windowText: string | undefined, flags: StateFlag): Promise<number>;