@ahmic/autoit-js
Version:
Node.js bindings for AutoItX3.dll
37 lines (36 loc) • 1.02 kB
TypeScript
/**
* Closes a window.
*
* @param windowHandle The handle of the window to close.
*
* @returns 1 if successful, 0 otherwise.
*
* @example
* ```typescript
* import { WinCloseByHandleSync, WinGetHandleSync } from '@ahmic/autoit-js';
*
* const handle = WinGetHandleSync('Untitled - Notepad');
* WinCloseByHandleSync(handle);
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/WinClose.htm
*/
export declare function WinCloseByHandleSync(windowHandle: bigint): number;
/**
* Closes a window.
*
* @param windowHandle The handle of the window to close.
*
* @returns A promise that resolves to 1 if successful, or 0 otherwise.
*
* @example
* ```typescript
* import { WinCloseByHandle, WinGetHandle } from '@ahmic/autoit-js';
*
* const handle = await WinGetHandle('Untitled - Notepad');
* await WinCloseByHandle(handle);
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/WinClose.htm
*/
export declare function WinCloseByHandle(windowHandle: bigint): Promise<number>;