Skip to content

API reference

All exports are typed, strict-mode TS. Everything below is the full public surface of the bunium package.

Main process singleton

ExportNotes
appBuniumApp singleton. init() (implicit via first window), setAppRoot(dir), shutdown(). One per process — CEF's singleton model.
BuniumWindownew BuniumWindow<M>(options). See Window.
BuniumWindowOptionsConstructor options type.
BuniumMessageMapRecord<string, any> base; override with your own interface for typed IPC. See Typed IPC.

System

ExportNotes
MenuNative menu bar builder. new Menu(items), onClick(id), setAsApplicationMenu().
MenuItemSpecFlat item union: {type: "separator"} | {label, id?, submenu?}.
TrayNative tray icon. setMenu, onClick, setIcon(path, {template}), setSymbol(name).
Notificationnew Notification({title, body?, id?}), show(), onClick().
showOpenDialog / showSaveDialog / showMessageBoxPromise-based; never block the UI. Result types: OpenDialogResult (canceled, paths), SaveDialogResult (canceled, path), MessageBoxResult (response). Options: OpenDialogOptions, SaveDialogOptions, MessageBoxOptions.
systemEventsShared event bus for system-feature callbacks.

See System features.

Updates

ExportNotes
updaterUpdater singleton: check(), install(), relaunch(), repairInterruptedUpdate(), isUpToDate, typed on().
updater.check inputsUpdateCheckOptions: feedUrl, currentVersion, channel?, platform?, arch?. Result: UpdateCheckResult; manifest type UpdateManifest. Platform = "mac" | "linux" | "win"; Arch = "arm64" | "x64"; defaultPlatform()/defaultArch() helpers.
UpdaterEvent(s) / UpdaterEventsDiscriminated-union event payloads: checking, downloadStarted, progress (phase: "download"|"apply"), applying (method: "patch"|"full"), ready, relaunching, error (recoverable flag).
repairInterruptedUpdate(installDir)Recovers from an interrupted update; returns UpdateRepairResult ("repaired"|"rolled-back"|"none").
relaunchApp(options?)Restart the app after an update. RelaunchOptions: args?, pollIntervalMs?.
buildRelaunchCommand(options?)Pure; returns the detached restart command for testing.

See Auto-update.

Renderer types

ExportNotes
HTMLBuniumWebviewElementAmbient global type (src property) + HTMLElementTagNameMap augmentation. See <bunium-webview>.

macOS, Linux, and Windows all supported.