electron-ipc-bind
v0.0.3
Published
[![NPM version](https://img.shields.io/npm/v/electron-ipc-bind?color=a1b858&label=)](https://www.npmjs.com/package/electron-ipc-bind)
Downloads
4
Readme
[electron-ipc-bind]
Feature
- Use tsup to build
- Use nodemon and ts-node to development
- Use vitest to test
- Use ~~EsLint, Prettier~~ Biome to lint and format
API 设计
具体有两套 API 设计
同步消息(常见的,不需要返回结果的通信)
on(windowName: string | string[], eventName: string | string[], ...args: any[])
:增加对于某个窗口的某个事件的监听once(windowName: string | string[], eventName: string | string[], ...args: any[])
:增加对于某个窗口的某个事件的监听,触发后移除该监听emitTo(windowName: string | string[], eventName: string | string[], ...args: any[])
:触发某个窗口的某个事件off(windowName: string | string[], eventName: string | string[], ...args: any[])
:移除对于某个窗口的某个事件的监听
异步消息(异步,需要等待返回结果的通信)
handle(windowName: string | string[], eventName: string | string[], ...args: any[])
:增加对于某个窗口的某个事件的监听handleOnce(windowName: string | string[], eventName: string | string[], ...args: any[])
:增加对于某个窗口的某个事件的监听,触发后移除该监听invokeTo(windowName: string | string[], eventName: string | string[], ...args: any[])
:触发某个窗口的某个事件removeHandle(windowName: string | string[], eventName: string | string[], ...args: any[])
:移除对于某个窗口的某个事件的监听