Feature: sync with picgo 2.4.0 beta 1

This commit is contained in:
萌萌哒赫萝
2023-05-05 17:51:49 +08:00
parent bda1421aa5
commit e8d54fac4c
33 changed files with 1154 additions and 81 deletions

View File

@@ -49,6 +49,19 @@ export function triggerRPC<T> (action: IRPCActionType, ...args: any[]): Promise<
})
}
/**
* send a rpc request & do not need to wait for the response
*
* or the response will be handled by other listener
*/
export function sendRPC (action: IRPCActionType, ...args: any[]): void {
const data = getRawData(args)
ipcRenderer.send(RPC_ACTIONS, action, data)
}
/**
* @deprecated will be replaced by sendRPC in the future
*/
export function sendToMain (channel: string, ...args: any[]) {
const data = getRawData(args)
ipcRenderer.send(channel, ...data)