- Added electron-ipc-decorator as a dependency to streamline IPC method registration and context management. - Refactored IPC service classes to utilize the new decorator, enhancing code organization and readability. - Removed the base IPC context file, consolidating IPC logic within the decorator framework. - Updated package.json files to include electron-ipc-decorator in both main and renderer processes. These changes collectively enhance the IPC architecture, improving maintainability and reducing boilerplate code. Signed-off-by: Innei <tukon479@gmail.com>
8 lines
281 B
TypeScript
8 lines
281 B
TypeScript
import type { IpcServices } from "@follow/electron-main"
|
|
import type { IpcRenderer } from "electron"
|
|
import { createIpcProxy } from "electron-ipc-decorator/client"
|
|
|
|
export const ipcServices = createIpcProxy<IpcServices>(
|
|
window.electron?.ipcRenderer as unknown as IpcRenderer,
|
|
)
|