Represents the bounding box of the UI.
If the UI is a window and is minimized, the Bounding box is 0.
Can use HomObject.updateCurrentBoundingBox to update boundingBox.
Represents the control type of the UI.
A descriptor that represents the element of the UI.
If the UI is a window, this will be null.
Represents whether the UI has value pattern.
Can use HomObject.updateCurrentHasValue to update value.
A descriptor that represents the window to which the UI belongs, or indicates that the UI is a window itself.
The id of the UI.
Represents whether the Host is focused.
Can use updateCurrentIsFocus to update isFocus.
Represents whether the UI has invoke pattern.
Can use HomObject.updateCurrentIsInvokable to update isInvokable.
Represents whether the Host is at the top of the window.
Can use updateCurrentIsOnTop to update isOnTop.
Represents whether the UI has scroll pattern.
Can use HomObject.updateCurrentIsScrollable to update isScrollable.
Represents whether the UI is selected.
Represents the key of a UI element. The key is unique.
Represents the name of the UI
Can use HomObject.updateCurrentName to update name.
Represents the scrollable view of the UI.
If the UI has scroll pattern, can use HomObject.updateCurrentScrollableView to update the scrollable view. Otherwise, scrollableView is null.
Represents the toggle state of the UI.
Represents the value of the UI.
If the UI has value pattern, can using HomObject.updateCurrentValue to update the value. Otherwise, value is null.
Static Readonly ALLPROPERTYIDIf the UI has ExpandCollapse pattern, expand the UI.
(ExpandCollapse pattern related functions are not provided yet.)
UI does not support the ExpandCollapse pattern.
The UI result after calling expand() is roughly as follows.
(using file explorer as an example)

Retrieves the audio buffer.
The callback function to handle the audio buffer data.
A promise that resolves when the audio buffer is retrieved.
// Before using setValue(), must first update updateCurrentHasValue() to confirm whether there is a value pattern
await homObject.getAudioBuffer((data: Buffer) => {
console.log('Received audio buffer:', data);
});
Retrieves child elements by their descriptor. If the element does not exist, subscribes to it and creates a new component.
The descriptor of the element.
Optional uiTreeScope: UITreeScopeThe scope of the UI tree. (Warning: Undefined are not supported below v2.0)
A promise that resolves to the matching HomElements.
If the UI has invoke pattern, invoke the UI.
(can use HomObject.isInvokable to check UI supports the invoke pattern.)
UI does not support the invoke pattern.
// Before using invoke(), must first update updateCurrentIsInvokable() to confirm whether there is an invoke pattern
const isInvokable = await homObject.updateCurrentIsInvokable()
if (isInvokable) {
await homObject.invoke()
}
The UI result after calling invoke() is roughly as follows.
(using file explorer as an example)

If the UI has window pattern, restore the window.
(Window pattern related functions are not provided yet.)
UI does not support the window pattern.
The UI result after calling maximize() is roughly as follows.
(using file explorer as an example)

If the UI has window pattern, minimize the window.
(Window pattern related functions are not provided yet.)
UI does not support the window pattern.
The UI result after calling minimize() is roughly as follows.
(using file explorer as an example)

Moves the mouse into the UI center and click.
// Click the left mouse button into the UI center
await homObject.mouseClick()
// Click the right mouse button into the UI center
await homObject.mouseClick({ key: 'right' })
Moves the mouse into the UI center and Hold.
// Hold the left mouse button into the UI center
await homObject.mousePress()
// Hold the right mouse button into the UI center
// await homObject.mousePress({ key: 'right' })
Moves the mouse into the UI center and release.
// Hold the left mouse button into the UI center before release
await homObject.mousePress()
// Release the left mouse button into the UI center
await homObject.mouseRelease()
// Release the right mouse button into the UI center
// await homObject.mouseRelease({ key: 'right' })
Moves the mouse into the UI center and scroll down.
// Scroll down the mouse wheel into the UI center
await homObject.mouseScrollDown()
// Scroll down the mouse wheel into the UI center with 3 ticks
await homObject.mouseScrollDown({ tick: 3 })
// Scroll down the mouse wheel into the UI center with 120 amount
await homObject.mouseScrollDown({ amount: 120 })
Moves the mouse into the UI center and scroll up.
// Scroll up the mouse wheel into the UI center
await homObject.mouseScrollUp()
// Scroll up the mouse wheel into the UI center with 3 ticks
await homObject.mouseScrollUp({ tick: 3 })
// Scroll up the mouse wheel into the UI center with 120 amount
await homObject.mouseScrollUp({ amount: 120 })
If the host has Transform pattern, moves the host object to the specified coordinates.
(Transform pattern related functions are not provided yet.)
The x-coordinate to move the host object to.
The y-coordinate to move the host object to.
Optional space: ScreenPositionSpaceThe coordinate space to use for the movement. Defaults to 'absolute'.
UI does not support the Transform pattern.
// Move host to the (100, 100) position on the screen
await host.moveTo(100, 100)
// Move the host object to the (100, 100) coordinates relative to its current position.
// await host.moveTo(100, 100, 'relative')
The UI result after calling moveTo() is roughly as follows.
(using file explorer as an example)

If the UI has scroll pattern, scroll the UI horizontally.
(can use HomObject.isScrollable to check UI supports the scroll pattern.)
The amount to scroll horizontally.
UI does not support the scroll pattern.
// Before using scrollHorizontal(), must first update updateCurrentIsScrollable() to confirm whether there is a scroll pattern
const isScrollable = await homObject.updateCurrentIsScrollable()
if (isScrollable) {
await homObject.scrollHorizontal(Amount.LargeDecrement)
}
The UI result after calling scrollHorizontal() is roughly as follows.
(using file explorer as an example)

If the UI has scroll pattern, scroll the UI vertically.
(can use HomObject.isScrollable to check UI supports the scroll pattern.)
The amount to scroll vertically.
UI does not support the scroll pattern.
// Before using scrollVertical(), must first update updateCurrentIsScrollable() to confirm whether there is a scroll pattern
const isScrollable = await homObject.updateCurrentIsScrollable()
if (isScrollable) {
await homObject.scrollVertical(Amount.LargeDecrement)
}
The UI result after calling scrollVertical() is roughly as follows.
(using file explorer as an example)

Asynchronously invokes the horizontal scrolling action.
(can use HomObject.isScrollable to check UI supports the scroll pattern.)
Set the percentage of horizontal scrolling.
UI does not support the scroll pattern.
// Before using setHorizontalScrollPercent(), must first update updateCurrentIsScrollable() to confirm whether there is a scroll pattern
const isScrollable = await homObject.updateCurrentIsScrollable()
if (isScrollable) {
await homObject.setHorizontalScrollPercent(50)
}
The UI result after calling setHorizontalScrollPercent() is roughly as follows.
(using file explorer as an example)

If the host has Transform pattern, resizes the subscribed UI to the specified width and height.
(Transform pattern related functions are not provided yet.)
The new width of the UI.
The new height of the UI.
A promise that resolves when the UI has been resized.
UI does not support the Transform pattern.
// Resize the host to 100x100
await host.setSize(100, 100)
The UI result after calling setSize() is roughly as follows.
(using file explorer as an example)

If the UI has value pattern, set the value of the UI.
(can use HomObject.hasValue to check UI supports the value pattern.)
Value used to set the UI.
UI does not support the value pattern.
// Before using setValue(), must first update updateCurrentHasValue() to confirm whether there is a value pattern
const hasValue = await homObject.updateCurrentHasValue()
if (hasValue) {
await homObject.setValue('scrollV')
}
The UI result after calling setValue() is roughly as follows.
(using file explorer as an example)

Asynchronously invokes the vertical scrolling action.
(can use HomObject.isScrollable to check UI supports the scroll pattern.)
Set the percentage of vertical scrolling.
UI does not support the scroll pattern.
// Before using setVerticalScrollPercent(), must first update updateCurrentIsScrollable() to confirm whether there is a scroll pattern
const isScrollable = await homObject.updateCurrentIsScrollable()
if (isScrollable) {
await homObject.setVerticalScrollPercent(50)
}
The UI result after calling setVerticalScrollPercent() is roughly as follows.
(using file explorer as an example)

Starts the audio listening.
Optional channel: numberchannelRate, defaults to 1
Optional sampleRate: numbersampleRate, defaults to 44100
Optional bits: numberbits, defaults to 16
A promise that resolves when the audio listening is started.
// Before using setValue(), must first update updateCurrentHasValue() to confirm whether there is a value pattern
await homObject.startAudioListening()
// or with specific parameters
await homObject.startAudioListening(2)
await homObject.startAudioListening(2, 16000)
await homObject.startAudioListening(2, 16000, 8)
If the UI has window pattern, restore the window.
(Window pattern related functions are not provided yet.)
UI does not support the window pattern.
The UI result after calling unMaximize() is roughly as follows.
(using file explorer as an example)

Updates the current bounding box property of the UI, this will update HomObject.boundingBox property.
A promise that resolves to the updated bounding box property.
const boundingBox = await homObject.updateCurrentBoundingBox()
// a new homObject.boundingBox property
console.log(boundingBox)
Updates the current hasValue property of the UI, this will update HomObject.hasValue property.
A promise that resolves to the updated hasValue property.
const hasValue = await homObject.updateCurrentHasValue()
// a new homObject.hasValue property
console.log(hasValue)
// homObject.hasValue property can be used to check if the UI has value pattern.
if (hasValue) {
// setValue() only works if the UI has value pattern.
homObject.setValue('new value')
}
Updates the current focus state of the host.
this will update isFocus property.
const isFocus = await host.updateCurrentIsFocus()
// a new host.isFocus property
console.log(isFocus)
Updates the current isInvokable property of the UI, this will update HomObject.isInvokable property.
A promise that resolves to the updated isInvokable property.
const isInvokable = await homObject.updateCurrentIsInvokable()
// a new homObject.isInvokable property
console.log(isInvokable)
// homObject.isInvokable property can be used to check if the UI has invoke pattern.
if (isInvokable) {
// invoke() only works if the UI has invoke pattern.
homObject.invoke()
}
Updates the current isOnTop property of the host.
this will update isOnTop property.
const isOnTop = await host.updateCurrentIsOnTop()
// a new host.isOnTop property
console.log(isOnTop)
Updates the current isScrollable property of the UI, this will update HomObject.isScrollable property.
A promise that resolves to the updated isScrollable property.
const isScrollable = await homObject.updateCurrentIsScrollable()
// a new homObject.isScrollable property
console.log(isScrollable)
// homObject.isScrollable property can be used to check if the UI has scroll pattern.
if (isScrollable) {
// scrollVertical() only works if the UI has scroll pattern.
homObject.scrollVertical(Amount.LargeDecrement)
}
Updates the current name property of the UI, this will update HomObject.name property.
A promise that resolves to the updated name property.
const name = await homObject.updateCurrentName()
// a new homObject.name property
console.log(name)
If the UI has scroll pattern, updates the current scrollableView property, otherwise, it will throw an error.
this will update HomObject.scrollableView property.
A promise that resolves to the updated scrollableView property.
Can use HomObject.isScrollable to check if the UI supports the scroll pattern.
// Before using updateCurrentScrollableView(), must first update updateCurrentIsScrollable() to confirm whether there is a scroll pattern
const isScrollable = await homObject.updateCurrentIsScrollable()
if (isScrollable) {
const scrollableView = await homObject.updateCurrentScrollableView()
// a new homObject.scrollableView property
console.log(scrollableView)
}
UI does not support the scroll pattern.
If the UI has value pattern, updates the current value property, otherwise, it will throw an error.
this will update HomObject.value property.
A promise that resolves to the updated value property.
Can use HomObject.hasValue to check if the UI supports the value pattern.
// Before using updateCurrentValue(), must first update updateCurrentHasValue() to confirm whether there is a value pattern
const hasValue = await homObject.updateCurrentHasValue()
if (hasValue) {
const value = await homObject.updateCurrentValue()
// a new homObject.value property
console.log(value)
}
UI does not support the value pattern.
Represents another host, multiple hosts can exist at the same time