🚧 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,16 +1,15 @@
import { sendRPC, triggerRPC } from '@/utils/common'
import { IRPCActionType } from '#/types/enum'
import { IObj } from '#/types/types'
export function saveConfig(config: IObj | string, value?: any) {
export function saveConfig (config: IObj | string, value?: any) {
const configObj = typeof config === 'string' ? { [config]: value } : config
sendRPC(IRPCActionType.MANAGE_SAVE_CONFIG, configObj)
window.electron.sendRPC(IRPCActionType.MANAGE_SAVE_CONFIG, configObj)
}
export async function getConfig<T>(key?: string): Promise<T | undefined> {
return await triggerRPC<T>(IRPCActionType.MANAGE_GET_CONFIG, key)
export async function getConfig<T> (key?: string): Promise<T | undefined> {
return await window.electron.triggerRPC<T>(IRPCActionType.MANAGE_GET_CONFIG, key)
}
export function removeConfig(key: string, propName: string) {
sendRPC(IRPCActionType.MANAGE_REMOVE_CONFIG, key, propName)
export function removeConfig (key: string, propName: string) {
window.electron.sendRPC(IRPCActionType.MANAGE_REMOVE_CONFIG, key, propName)
}