11/// <reference types="vite-plugin-electron/electron-env" />
22
3+ import { AppConfig , Shortcut } from '@/utils/types'
4+
35declare namespace NodeJS {
46 interface ProcessEnv {
57 /**
@@ -21,20 +23,19 @@ declare namespace NodeJS {
2123 }
2224}
2325
24- // Used in Renderer process, expose in `preload.ts`
2526declare global {
2627 interface Window {
2728 ipcRenderer : import ( 'electron' ) . IpcRenderer
28- // 对应 preload 的 api Key
29+ /* 对应 preload 的 api Key
30+ Used in Renderer process, expose in `preload.ts` */
2931 windowApi : WindowApi
3032 configApi : ConfigApi
3133 controlApi : ControlApi
3234 }
33- type AppConfig = {
34- name : string ;
35- icon : string ;
36- shortcut : {
37- [ shortcutName : string ] : [ string , string ] ;
35+
36+ interface Navigator {
37+ keyboard : {
38+ getLayoutMap : ( ) => Map < string , string > ;
3839 } ;
3940 }
4041}
@@ -54,8 +55,9 @@ interface ConfigApi {
5455 initialConfig : ( ) => Promise < AppConfig [ ] > ;
5556 updateAppConfig : ( appName : string , base64Icon : string ) => Promise < boolean >
5657 deleteAppConfig : ( appName : string ) => Promise < boolean > ;
57- updateShortcutConfig : ( appName : string , shortcut : string , leftHand : string , rightHand : string ) => Promise < boolean > ;
58- deleteShortcutConfig : ( appName : string , shortcut : string ) => Promise < boolean > ;
58+ updateShortcutConfig : ( appName : string , shortcut : Shortcut ) => Promise < boolean > ;
59+ deleteShortcutConfig : ( appName : string , keyCombination : string ) => Promise < boolean > ;
60+ toggleShortcutConfig : ( appName : string , shortcut : Shortcut ) => Promise < boolean > ;
5961 getBase64Icon : ( appPath : string ) => Promise < string >
6062 getProjectVersion : ( ) => Promise < string > ;
6163}
0 commit comments