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

• theme.color.bg?: string= undefined

Main background color for the application

• theme.color.black?: string= undefined

Black color used for high contrast elements

• theme.color.blue?: string= undefined

Blue color for informational elements and links

• theme.color.border?: string= undefined

Primary border color for main UI elements

• theme.color.cerise?: string= undefined

Bright magenta/cerise color for special emphasis

• theme.color.darkGray?: string= undefined

Dark gray color for muted text and secondary elements

• theme.color.darkPurple?: string= undefined

Dark purple color for premium features or special elements

• theme.color.editor.atom?: string= undefined

Color for atomic values like boolean literals

• theme.color.editor.attribute?: string= undefined

Color for HTML/XML/GraphQL attributes

• theme.color.editor.builtin?: string= undefined

Color for built-in functions and types

• theme.color.editor.comment?: string= undefined

Color for code comments and documentation

• theme.color.editor.cursor?: string= undefined

Color for the text cursor in the editor

• theme.color.editor.definition?: string= undefined

Color for function, class, type definitions

• theme.color.editor.keyword?: string= undefined

Color for programming language keywords

• theme.color.editor.number?: string= undefined

Color for numeric literals in code

• theme.color.editor.property?: string= undefined

Color for properties

• theme.color.editor.punctuation?: string= undefined

Color for punctuation marks like brackets and commas

• theme.color.editor.string?: string= undefined

Color for string literals in code

• theme.color.editor.variable?: string= undefined

Color for variable names and identifiers

• theme.color.font?: string= undefined

Primary text color for readable content

• theme.color.gray?: string= undefined

Medium gray color for neutral backgrounds and borders

• theme.color.green?: string= undefined

Green color typically used for success states and positive actions

• theme.color.headerBg?: string= undefined

Background color specifically for the header section

• theme.color.lightGray?: string= undefined

Light gray color for subtle backgrounds and dividers

• theme.color.lightRed?: string= undefined

Light red/salmon color for subtle error indicators

• theme.color.offBg?: string= undefined

Alternative background color for cards, panels, and sections

• theme.color.offBorder?: string= undefined

Secondary border color for subtle divisions

• theme.color.offFont?: string= undefined

Secondary text color for less emphasized content

• theme.color.orange?: string= undefined

Orange color for warning states and secondary actions

• theme.color.primary?: string= undefined

Primary brand color used for main interactive elements

• theme.color.red?: string= undefined

Red color for error states and destructive actions

• theme.color.rose?: string= undefined

Rose/pink color for accent elements and highlights

• theme.color.secondary?: string= undefined

Secondary brand color used for supporting interactive elements

• theme.color.tertiary?: string= undefined

Tertiary brand color used for accent and decorative elements

• theme.color.white?: string= undefined

White color for light backgrounds and text

• theme.color.yellow?: string= undefined

Yellow color for caution states and highlights

• theme.easing?: string= undefined

CSS transition easing function for smooth animations

• theme.fontFamily.code?: string= undefined

Font family specifically for code editor and monospace content

• theme.fontFamily.default?: string= undefined

Default system font stack for UI elements

• theme.fontSize.base?: number= undefined

Base font size in pixels used for calculations

• theme.fontSize.body?: number= undefined

Standard body text font size

• theme.fontSize.bodySmaller?: number= undefined

Smaller body text font size for secondary content

• theme.fontSize.code?: number= undefined

Font size for code editor text

• theme.fontSize.remBase?: number= undefined

Root em base size in pixels for responsive typography

• theme.isSystem?: boolean= undefined

Whether this theme follows system preferences (light/dark mode)

• theme.shadow.color?: string= undefined

Color used for drop shadows and elevation effects

• theme.shadow.opacity?: number= undefined

Opacity level for shadow effects (0.0 to 1.0)

Returns ​

void

enable() ​

enables the specified theme

Parameters ​

• name: string

• darkMode?: boolean

Returns ​

Promise<void>