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.
BuniumWindow.createOverlay(options)Creates a trusted transparent CEF surface above native guests; macOS-only pending Windows/Linux qualification.
BuniumWindowOptionsConstructor options type.
WindowControlCapabilities / WindowControlPer-window minimize/maximize/restore/focus/show/hide/always-on-top support and operation names.
WindowControlErrorThrown for unsupported operations, native failures, or controls used after close; inspect code for the reason.
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: expected product, feedUrl, currentVersion, exact runtimeVersion/cefVersion, current three-part currentOsVersion, persisted currentSequence, trustedKeys, channel?, platform?, arch?. Result: UpdateCheckResult; schema-2 signed manifest binds product, updater ABI, runtime/CEF compatibility, minimum Bun/OS versions, app-tree payload kind, sequence, timestamps, platform/channel and artifact sizes/hashes. Platform = "mac" | "linux" | "win"; Arch = "arm64" | "x64"; defaultPlatform()/defaultArch() helpers.
updateAbiVersionManifest/apply compatibility version; increment for incompatible updater changes.
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.

Guest views ​

ExportNotes
BuniumGuestNative untrusted guest view composited into a BuniumWindow. Supports a bounded document-start bridge, instance-scoped messages, navigation generations, lifecycle events, rectangular or rounded clipping on macOS, and disposal. The flattened primary host DOM still paints below guests.
BuniumGuestOptions, GuestBounds, GuestEvent, GuestMessageGuest creation options, geometry, lifecycle events and generation-tagged messages.
BuniumOverlayTrusted transparent CEF surface with independent IPC, bounds, rectangular clipping and origin-restricted navigation. Transparent pixels inside its hit-test rectangle still receive input.
BuniumOverlayOptions, OverlayBoundsOverlay URL and window-local logical-pixel geometry.
DeviceEmulationDescriptorSupported guest screen dimensions and device scale factor; viewport comes from guest bounds.
deviceEmulationCapabilities, validateDeviceEmulationCapability declaration and bounded screen, raster, touch and pointer descriptor validation.
guestApiVersionRuntime capability version for consumers that require native guest views.

See Guest views and Device emulation.

Renderer types ​

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

macOS, Linux, and Windows all supported.