Skip to content

PluginContext

Properties

app

app: object

addSubscriptionProvider()

adds a provider for subscriptions

Parameters

providerData: SubscriptionProviderData

Returns

void

createAction()

for rendering an action button with the specified title and the callback to execute when the button is clicked

Parameters

options: CreateActionOptions

Returns

AltairUiAction

createPanel()

for rendering the provided DOM element in a new panel within Altair

Parameters

element: HTMLElement

options?: CreatePanelOptions

Returns

AltairPanel

createWindow()

Parameters

data: ExportWindowState

Returns

void

destroyAction()

Parameters

uiAction: AltairUiAction

Returns

void

destroyPanel()

Parameters

panel: AltairPanel

Returns

void

executeCommand()

Returns

void

getCurrentWindowState()

Returns

Promise<undefined | PluginWindowState>

getWindowState()

resolves with the state of the specified window

Parameters

windowId: string

Returns

Promise<undefined | PluginWindowState>

isElectron()

Returns

boolean

setEndpoint()

Parameters

windowId: string

url: string

Returns

void

setHeader()

Parameters

windowId: string

key: string

value: string

Returns

void

setQuery()

Parameters

windowId: string

query: string

Returns

void

setVariables()

Parameters

windowId: string

variables: string

Returns

void


events

events: object

off()

Returns

void

on()

listens for events within Altair to perform an action within the plugin

Type parameters

E extends keyof PluginEventPayloadMap

Parameters

event: E

callback: PluginEventCallback<E>

Returns

object

unsubscribe()

unsubscribe: () => void

Returns

void


theme

theme: object

add()

adds the provided theme to Altair's theme registry which can later be used

Parameters

name: string

theme: RecursivePartial<ITheme>

Returns

void

enable()

enables the specified theme

Parameters

name: string

darkMode?: boolean

Returns

Promise<void>