@ahmic/autoit-js
Version:
Node.js bindings for AutoItX3.dll
102 lines (101 loc) • 4.36 kB
TypeScript
/**
* Enumeration of commands for interacting with controls in a window.
*/
export declare enum Command {
/** Returns 1 if Control is visible, 0 otherwise */
IsVisible = "IsVisible",
/** Returns 1 if Control is enabled, 0 otherwise */
IsEnabled = "IsEnabled",
/** Displays the ComboBox dropdown */
ShowDropDown = "ShowDropDown",
/** Hides the ComboBox dropdown */
HideDropDown = "HideDropDown",
/** Adds a string to the end in a ListBox or ComboBox */
AddString = "AddString",
/** Deletes a string according to occurrence in a ListBox or ComboBox */
DelString = "DelString",
/** Returns occurrence ref of the exact string in a ListBox or ComboBox */
FindString = "FindString",
/** Returns number of entries in a ListBox or ComboBox */
GetCount = "GetCount",
/** Sets selection to occurrence ref in a ListBox or ComboBox */
SetCurrentSelection = "SetCurrentSelection",
/** Sets selection according to string in a ListBox or ComboBox */
SelectString = "SelectString",
/** Returns 1 if Button is checked, 0 otherwise */
IsChecked = "IsChecked",
/** Checks radio or check Button */
Check = "Check",
/** Unchecks radio or check Button */
UnCheck = "UnCheck",
/** Returns the line # where the caret is in an Edit */
GetCurrentLine = "GetCurrentLine",
/** Returns the column # where the caret is in an Edit */
GetCurrentCol = "GetCurrentCol",
/** Returns name of the currently selected item in a ListBox or ComboBox */
GetCurrentSelection = "GetCurrentSelection",
/** Returns # of lines in an Edit */
GetLineCount = "GetLineCount",
/** Returns text at line # passed of an Edit */
GetLine = "GetLine",
/** Returns selected text of an Edit */
GetSelected = "GetSelected",
/** Pastes the 'string' at the Edit's caret position */
EditPaste = "EditPaste",
/** Returns the current Tab shown of a SysTabControl32 */
CurrentTab = "CurrentTab",
/** Moves to the next tab to the right of a SysTabControl32 */
TabRight = "TabRight",
/** Moves to the next tab to the left of a SysTabControl32 */
TabLeft = "TabLeft",
/** Simulates the WM_COMMAND message. Usually used for ToolbarWindow32 controls - use the ToolBar tab of Au3Info to get the Command ID. */
SendCommandID = "SendCommandID"
}
/**
* Sends a command to a control in a window.
*
* @param windowTitle The title of the window to access.
* @param windowText Optional text found in the window.
* @param controlId The ID of the control to send the command to.
* @param command The command to send to the control.
* @param option Optional additional parameter for the command.
* @param characterCount The size of the buffer to store the result.
*
* @returns The result of the command as a string.
*
* @example
* ```typescript
* import { ControlCommandSync } from '@ahmic/autoit-js';
*
* const result = ControlCommandSync('Untitled - Notepad', '', 'Edit1', 'IsVisible');
*
* console.log(result); // Output: "1" if visible, "0" otherwise
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/ControlCommand.htm
*/
export declare function ControlCommandSync(windowTitle: string, windowText: string, controlId: string, command: Command, option?: string, characterCount?: number): string;
/**
* Sends a command to a control in a window.
*
* @param windowTitle The title of the window to access.
* @param windowText Optional text found in the window.
* @param controlId The ID of the control to send the command to.
* @param command The command to send to the control.
* @param option Optional additional parameter for the command.
* @param characterCount The size of the buffer to store the result.
*
* @returns A promise that resolves to the result of the command as a string.
*
* @example
* ```typescript
* import { ControlCommand } from '@ahmic/autoit-js';
*
* const result = await ControlCommand('Untitled - Notepad', '', 'Edit1', 'IsVisible');
*
* console.log(result); // Output: "1" if visible, "0" otherwise
* ```
*
* @see https://www.autoitscript.com/autoit3/docs/functions/ControlCommand.htm
*/
export declare function ControlCommand(windowTitle: string, windowText: string, controlId: string, command: Command, option?: string, characterCount?: number): Promise<string>;