ui
Enables the extension to interact with the command bar window.
Functions
ui.createToast
ui.createToast(options: ToastOptions): Toast
Create a toast instance.
Example
ui.showToast
ui.showToast(options: ToastOptions): void
Create and show toast
Example
ui.closeWindow
ui.closeWindow(): Promise<void>
Close the command bar window
Example
ui.searchPanel.clearValue
ui.searchPanel.clearValue(): void
Clear the command bar search panel value.
Example
ui.searchPanel.updatePlaceholder
ui.searchPanel.updatePlaceholder(placeholder: string): void
Update the command bar search panel placeholder.
Example
ui.alert.confirm
ui.alert.confirm(options: ConfirmOptions): Promise<boolean>
Show confirmation alert.
Example
Events
ui.searchPanel.onChanged
Events.Event<(value: string) => void>
Fired when the command bar search panel value is changed.
Example
ui.searchPanel.onKeydown
Events.Event<(event: KeydownEvent) => void>
Fired when a keys is pressed on the command bar search panel.
Example
Types
ui.ToastOptions
Options for the ui.createToast
method.
Property | Type | Description |
---|---|---|
title | string | The toast’s title |
description | ?string | The toast’s description |
type | ?('loading' | 'error' | 'success') | The toast’s type |
timeout | ?number | How long to display the toast in milliseconds. Default to 3000 |
ui.Toast
The toast instance.
Property | Type | Description |
---|---|---|
hide | () => void | Hide the toast |
hide | (options: Partial<ToastOptions>) => void | Show the toast |
ui.searchPanel.KeyDownEvent
Event when key is pressed on the command bar search panel.
Property | Type | Description |
---|---|---|
key | string | The pressed key |
altKey | boolean | Whether the alt key is pressed |
ctrlKey | boolean | Whether the ctrl key is pressed |
metaKey | boolean | Whether the meta key is pressed |
shiftKey | boolean | Whether the shift key is pressed |
ui.alert.ConfirmOptions
Options for the ui.alert.confirm
method.
Property | Type | Description |
---|---|---|
title | string | The confirm title |
body | ?string | The confirm body |
okText | ?string | The confirm ok text button |
cancelText | ?string | The confirm cancel text button |
okText | ?ButtonVariant | The confirm ok button variant |
ui.alert.ButtonVariant
The alert button variant.