@ahmic/autoit-js
Version:
Node.js bindings for AutoItX3.dll
43 lines (42 loc) • 1.46 kB
TypeScript
/**
* Retrieves the text from a window.
*
* @param windowHandle The handle of the window to access.
* @param characterCount The maximum number of characters to retrieve. Default is 1024.
*
* @returns The text of the window as a string.
*
* @example
* ```typescript
* import { WinGetTextByHandleSync, WinGetHandleSync } from '@ahmic/autoit-js';
*
* const windowHandle = WinGetHandleSync('Untitled - Notepad');
* const text = WinGetTextByHandleSync(windowHandle);
*
* console.log(text); // Output: "Example text"
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/WinGetText.htm
*/
export declare function WinGetTextByHandleSync(windowHandle: bigint, characterCount?: number): string;
/**
* Retrieves the text from a window.
*
* @param windowHandle The handle of the window to access.
* @param characterCount The maximum number of characters to retrieve. Default is 1024.
*
* @returns A promise that resolves to the text of the window as a string.
*
* @example
* ```typescript
* import { WinGetTextByHandle, WinGetHandle } from '@ahmic/autoit-js';
*
* const windowHandle = await WinGetHandle('Untitled - Notepad');
* const text = await WinGetTextByHandle(windowHandle);
*
* console.log(text); // Output: "Example text"
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/WinGetText.htm
*/
export declare function WinGetTextByHandle(windowHandle: bigint, characterCount?: number): Promise<string>;