🚧 WIP(custom): v3.0.0 migrate to vite and esm

This commit is contained in:
Kuingsmile
2025-07-31 17:37:30 +08:00
parent cd76bc7c10
commit 054f4b4cff
597 changed files with 197292 additions and 13329 deletions

View File

@@ -1,8 +1,6 @@
import { ipcRenderer } from 'electron'
import { isReactive, isRef, toRaw, unref } from 'vue'
import { RPC_ACTIONS, RPC_ACTIONS_INVOKE } from '#/events/constants'
import { IRPCActionType } from '#/types/enum'
import { ITalkingDataOptions } from '#/types/types'
export const handleTalkingDataEvent = (data: ITalkingDataOptions) => {
try {
@@ -30,20 +28,3 @@ export const getRawData = (args: any): any => {
}
return args
}
export function sendToMain(channel: string, ...args: any[]) {
const data = getRawData(args)
ipcRenderer.send(channel, ...data)
}
export function sendRPC(action: IRPCActionType, ...args: any[]): void {
ipcRenderer.send(RPC_ACTIONS, action, getRawData(args))
}
export function sendRpcSync(action: IRPCActionType, ...args: any[]) {
return ipcRenderer.sendSync(RPC_ACTIONS, action, getRawData(args))
}
export async function triggerRPC<T>(action: IRPCActionType, ...args: any[]): Promise<T | undefined> {
return await ipcRenderer.invoke(RPC_ACTIONS_INVOKE, action, getRawData(args))
}