@ahmic/autoit-js
Version: 
Node.js bindings for AutoItX3.dll
39 lines (38 loc) • 1.33 kB
TypeScript
/**
 * Waits for a window to close.
 *
 * @param windowHandle The handle of the window to wait for.
 * @param timeout The timeout in seconds. Default is 0 (wait indefinitely).
 *
 * @returns 1 if the window closes, 0 if the timeout is reached.
 *
 * @example
 * ```typescript
 * import { WinWaitCloseByHandleSync, WinGetHandleSync } from '@ahmic/autoit-js';
 *
 * const handle = WinGetHandleSync('Untitled - Notepad');
 * WinWaitCloseByHandleSync(handle, 10);
 * ```
 *
 * @see https://www.autoitscript.com/autoit3/docs/functions/WinWaitClose.htm
 */
export declare function WinWaitCloseByHandleSync(windowHandle: bigint, timeout?: number): number;
/**
 * Waits for a window to close.
 *
 * @param windowHandle The handle of the window to wait for.
 * @param timeout The timeout in seconds. Default is 0 (wait indefinitely).
 *
 * @returns A promise that resolves to 1 if the window closes, or 0 if the timeout is reached.
 *
 * @example
 * ```typescript
 * import { WinWaitCloseByHandle, WinGetHandle } from '@ahmic/autoit-js';
 *
 * const handle = await WinGetHandle('Untitled - Notepad');
 * await WinWaitCloseByHandle(handle, 10);
 * ```
 *
 * @see https://www.autoitscript.com/autoit3/docs/functions/WinWaitClose.htm
 */
export declare function WinWaitCloseByHandle(windowHandle: bigint, timeout?: number): Promise<number>;