Something went wrong. Try again.
Notifications for pi.dev
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132import notifier from "node-notifier";import type { NativeConfig } from "./config.js";
/** * Send a native OS desktop notification. * Silently no-ops if native notifications are disabled in config. */export async function sendNative( title: string, message: string, config: { native: NativeConfig },): Promise<void> { if (!config.native.enabled) return;
return new Promise((resolve, reject) => { notifier.notify( { title, message, appID: config.native.windowsAppId ?? undefined, }, (err: Error | null) => { if (err) { reject(new Error(`Native notification failed: ${err.message}`)); } else { resolve(); } }, ); });}