Skip to main content

@svatah/yam-adapter-uia

Windows UI Automation adapter: the Yam agent surface over UIAutomationClient

Exports

ExportKindSignature
automationIdOffunctionexport function automationIdOf(node: UiaNode): string | undefinedThe automationId candidate's value (LLD §3.3, §7.5).
childIndexfunctionexport function childIndex(nodes: readonly UiaNode[]): Map<number, number[]>Every node's children, by parent index.
controlPathOffunctionexport function controlPathOf(Window[Yam]/Group[2]/Button[Run] (LLD §3.3, §7.5).
ConvertOptionsinterfaceexport interface ConvertOptions
convertTreefunctionexport function convertTree(nodes: readonly UiaNode[], options: ConvertOptions): UiaSnapshotNode[]Flatten one window's tree into snapshot nodes. See the AX sibling for the rule.
createUiaSurfacefunctionexport function createUiaSurface(config:The factory the registry calls (LLD §2.4).
encodePowershellfunctionexport function encodePowershell(script: string, argument: unknown): stringThe request, and the console, put where the script can reach them (T7.2).
escapeSendKeysfunctionexport function escapeSendKeys(text: string): stringEscape a literal for SendKeys.
evaluateUiaPredicatefunctionexport function evaluateUiaPredicate(
insideChooserfunctionexport function insideChooser(nodes: readonly UiaNode[], index: number): booleanWhether this node is inside a chooser's list (see roleOf).
insideRowfunctionexport function insideRow(nodes: readonly UiaNode[], index: number): booleanWhether this node is inside a table row (see roleOf).
isTextualfunctionexport function isTextual(node: UiaNode): booleanWhether the element takes text, for type and for value.
literalValuefunctionexport function literalValue(ref: ValueRef): stringThe literal a ValueRef names; an unresolved one is a caller mistake (LLD §8.2).
matchNodesfunctionexport function matchNodes(Every node the candidate matches, in snapshot order.
nameOffunctionexport function nameOf(node: UiaNode): stringThe accessible name (REQ-SURF-4).
powershellBridgefunctionexport function powershellBridge(options: PowershellBridgeOptions): UiaBridgeThe real bridge: PowerShell, UIAutomationClient, and this machine.
PowershellBridgeOptionsinterfaceexport interface PowershellBridgeOptions
readablePowershellErrorfunctionexport function readablePowershellError(stderr: string): stringPowerShell's stderr, made readable (T7.2).
registerUiaAdapterfunctionexport function registerUiaAdapter(): voidRegister the adapter. Idempotent, like every other registration.
roleOffunctionexport function roleOf(ControlType → an ARIA role, with LocalizedControlType consulted first.
runPowershellfunctionexport async function runPowershell(Run one PowerShell script, with a hard deadline.
saidByfunctionexport function saidBy(node:The words an element itself puts on the screen (native-feedback D3).
sendKeysForfunctionexport function sendKeysFor(key: string): stringA key name → a SendKeys sequence.
statesOffunctionexport function statesOf(node: UiaNode): NodeState[]The states LLD §2.2 lists, from the properties UIA exposes.
synthesisefunctionexport function synthesise(The candidate bundle for one element, best first (REQ-REC-3, LLD §3.3).
UIA_ADAPTER_NAMEvariableUIA_ADAPTER_NAME = "uia"The name this adapter is selected by in yam.config.yaml (LLD §2.4).
UIA_CAPABILITIESvariableUIA_CAPABILITIES: Capabilities What this adapter can do (LLD §2.4).
UiaAdapterOptionsinterfaceexport interface UiaAdapterOptions
UiaAvailabilityinterfaceexport interface UiaAvailability
UiaAvailabilityStatetypealiasexport type UiaAvailabilityState Why UI Automation could not be reached.
UiaBridgeinterfaceexport interface UiaBridge
UiaBridgeErrorclassexport class UiaBridgeError extends Error
UiaCheckContextinterfaceexport interface UiaCheckContext
UiaCommandtypealiasexport type UiaCommand An action the bridge performs on one element, addressed by its path.
UiaNodeinterfaceexport interface UiaNodeOne automation element, flattened (LLD §7.5).
UiaSnapshotCostinterfaceexport interface UiaSnapshotCostWhat one snapshot() cost (Draft 2.8 §7.5).
UiaSnapshotNodeinterfaceexport interface UiaSnapshotNode extends SnapshotNodeA snapshot node, plus what only the walk knows.
UiaSurfaceclassexport class UiaSurface implements AgentSurface
UiaWindowinterfaceexport interface UiaWindow
valueOffunctionexport function valueOf(node: UiaNode): string | undefinedThe value a read("value") and a value predicate see.