alert + options.type
alert(message?, buttons?: AlertButton[], options?: { type?: 'primary'|'success'|'info'|'warning'|'danger' }): Promise<string>
prompt + options.defaultValue
prompt(message?, placeholder?, options?: { defaultValue?: string }): Promise<string|null>
showSpinner + html arg
showSpinner(html?: string): void
showColorPicker str | { defaultColor }
showColorPicker(defaultColor?: string): Promise<string>
showColorPicker(options?: { defaultColor?: string }): Promise<string>
showFontPicker str | { defaultFont }
showFontPicker(defaultFont?: string): Promise<{ fontFamily: string }>
showFontPicker(options?: { defaultFont?: string }): Promise<{ fontFamily: string }>
showOpenFilePicker + options.path
showOpenFilePicker(options?: { multiple?, accept?, path?: string }): CancelAwarePromise<FSItem|FSItem[]>
showSaveFilePicker 3-arg + type
showSaveFilePicker(content?, suggestedName?: string, type?: 'url'|'move'|'copy'): CancelAwarePromise<FSItem>
setWindow* app-only + window_id
setWindowTitle(title, window_id?: string|{id})
setWindowWidth(w, window_id?), setWindowHeight(h, window_id?)
setWindowSize(w, h, window_id?)
setWindowPosition(x, y, window_id?)
setWindowX(x, window_id?), setWindowY(y, window_id?)
handle: (none)
setMenubar app-only + id, disabled, checked, icon_active, '-'
setMenubar({ items: (MenuItem | '-')[] })
MenuItem: { label, id?, action?, items?, icon?, icon_active?, checked?, disabled? }
Demonstrates: id, action, sub-items, icon + icon_active, checked, disabled, '-' separators.
launchApp app-only + pseudonym, items, launchResult
launchApp(name?, args?, callback?)
launchApp({ name?, app_name?, args?, file_paths?, items?, pseudonym?, callback? })
// "name#(as)pseudonym" shorthand also supported
on('connection') new event
on('connection', (e: { conn: AppConnection, accept(value?), reject(value?) }) => void)
Listens for incoming AppConnection requests from other apps. Accept/reject below.
no listener installed
on('localeChanged' | 'themeChanged')
on('localeChanged', (d: { language: string }) => void)
on('themeChanged', (d: { palette: { primaryHue, primarySaturation, primaryLightness, primaryAlpha, primaryColor } }) => void)