@ahmic/autoit-js
Version:
Node.js bindings for AutoItX3.dll
43 lines (42 loc) • 1.37 kB
TypeScript
/**
* Runs a program and waits for it to close before continuing.
*
* @param program The name of the program to run.
* @param directory Optional working directory for the program.
* @param showFlag Optional flag to control how the program's window is shown.
*
* @returns The exit code of the program.
*
* @example
* ```typescript
* import { RunWaitSync } from '@ahmic/autoit-js';
*
* const exitCode = RunWaitSync('notepad.exe');
*
* console.log(exitCode); // Output: 0
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/RunWait.htm
*/
export declare function RunWaitSync(program: string, directory?: string, showFlag?: number): number;
/**
* Runs a program and waits for it to close before continuing.
*
* @param program The name of the program to run.
* @param directory Optional working directory for the program.
* @param showFlag Optional flag to control how the program's window is shown.
*
* @returns A promise that resolves to the exit code of the program.
*
* @example
* ```typescript
* import { RunWait } from '@ahmic/autoit-js';
*
* const exitCode = await RunWait('notepad.exe');
*
* console.log(exitCode); // Output: 0
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/RunWait.htm
*/
export declare function RunWait(program: string, directory?: string, showFlag?: number): Promise<number>;