# tsElectronJsIPC **Repository Path**: gzmmc/tsElectronJsIPC ## Basic Information - **Project Name**: tsElectronJsIPC - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-04-08 - **Last Updated**: 2025-04-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # tsElectronJsIPC elecctronjs ipc 通信框架,支持ts开发。 ## 调用 #### 主线程 ```ts let wc = createWindow() let sss = new Server(ipcMain, wc) sss.addCall('test', (data, wcfc, endfc) => { console.log("收到请求", data) let handle = setInterval(() => { wcfc(String(Math.random())) },300) setTimeout(() => { clearInterval(handle) endfc() },3000) }) ``` #### perload脚本 ```ts initExposeInMainWorld(contextBridge) ``` #### 渲染线程 ```ts let client = Client.getInstance() client.send({ call: "loadToken", data: "adasdasd" },(d) => console.log("client in app res", d)) ```