Implement notifications for Electron

This commit is contained in:
2025-09-21 15:23:27 +03:00
Unverified
parent fcb567a198
commit 137d02567b
7 changed files with 368 additions and 183 deletions
+6 -2
View File
@@ -1,9 +1,13 @@
import { contextBridge } from "electron";
import { contextBridge, ipcRenderer } from "electron";
import type { ElectronInterface, Platform } from "../electron";
const electronInterface: ElectronInterface = {
desktop: true,
platform: process.platform as Platform
platform: process.platform as Platform,
notifications: {
requestPermission: () => ipcRenderer.invoke('request-notification-permission'),
show: (options: any) => ipcRenderer.invoke('show-notification', options)
}
}
contextBridge.exposeInMainWorld("electronInterface", electronInterface);