MCPcopy
hub / github.com/ZToolsCenter/ZTools / setupIPC

Method setupIPC

src/main/api/renderer/commands.ts:89–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87 }
88
89 private setupIPC(): void {
90 ipcMain.handle('get-apps', () => this.getApps())
91 ipcMain.handle('get-commands', () => this.getCommands())
92 ipcMain.handle('launch', (_event, options: any) => this.launch(options))
93 ipcMain.handle('launch-as-admin', (_event, appPath: string, name?: string) =>
94 this.launchAsAdmin(appPath, name)
95 )
96 ipcMain.handle('refresh-apps-cache', () => this.refreshAppsCache())
97
98 // 历史记录管理
99 ipcMain.handle(
100 'remove-from-history',
101 (_event, appPath: string, featureCode?: string, name?: string) =>
102 this.removeFromHistory(appPath, featureCode, name)
103 )
104
105 // 固定应用管理
106 ipcMain.handle('pin-app', (_event, app: any) => this.pinApp(app))
107 ipcMain.handle('unpin-app', (_event, appPath: string, featureCode?: string, name?: string) =>
108 this.unpinApp(appPath, featureCode, name)
109 )
110 ipcMain.handle('update-pinned-order', (_event, newOrder: any[]) =>
111 this.updatePinnedOrder(newOrder)
112 )
113
114 // 上次匹配状态管理
115 ipcMain.handle('get-last-match-state', () => this.getLastMatchState())
116 ipcMain.handle('restore-last-match', () => this.restoreLastMatch())
117
118 // 使用统计管理
119 ipcMain.handle('get-usage-stats', () => this.getUsageStats())
120 }
121
122 /**
123 * 设置本地应用搜索开启状态

Callers 1

initMethod · 0.95

Calls 12

getAppsMethod · 0.95
getCommandsMethod · 0.95
launchMethod · 0.95
launchAsAdminMethod · 0.95
refreshAppsCacheMethod · 0.95
removeFromHistoryMethod · 0.95
pinAppMethod · 0.95
unpinAppMethod · 0.95
updatePinnedOrderMethod · 0.95
getLastMatchStateMethod · 0.95
restoreLastMatchMethod · 0.95
getUsageStatsMethod · 0.95

Tested by

no test coverage detected