@virid/bridge 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1 +1,11 @@
1
- todo
1
+ # @virid/bridge
2
+
3
+ `@virid/bridge` is responsible for providing a communication bridge between the main process and the rendering process for the Electron application.
4
+
5
+ Usage: Just write one line of code in preload. js
6
+
7
+ ```ts
8
+ import { injectViridBridge } from '@virid/bridge'
9
+ injectViridBridge()
10
+ ```
11
+
package/README.zh.md CHANGED
@@ -1 +1,12 @@
1
- todo
1
+ # @virid/bridge
2
+
3
+ `@virid/brideg` 负责为electron应用提供主进程与渲染进程之间的通讯桥接。
4
+
5
+ 使用方法:仅需在preload.js中写一行代码即可
6
+
7
+ ```ts
8
+ import { injectViridBridge } from '@virid/bridge'
9
+ injectViridBridge()
10
+
11
+ ```
12
+
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @virid/bridge v0.0.1
2
+ * @virid/bridge v0.1.1
3
3
  * Electron application preloading script
4
4
  */
5
5
  var _=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var o=(n,e)=>_(n,"name",{value:e,configurable:!0});var p=(n,e)=>{for(var t in e)_(n,t,{get:e[t],enumerable:!0})},B=(n,e,t,I)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of d(e))!R.call(n,i)&&i!==t&&_(n,i,{get:()=>e[i],enumerable:!(I=c(e,i))||I.enumerable});return n};var D=n=>B(_({},"__esModule",{value:!0}),n);var V={};p(V,{injectViridBridge:()=>N});module.exports=D(V);var r=require("electron");var s="VIRID_INTERNAL_BUS";function N(){r.contextBridge.exposeInMainWorld("__VIRID_BRIDGE__",{post:o(n=>{r.ipcRenderer.send(s,n)},"post"),subscribe:o(n=>{let e=o((t,I)=>{n(I)},"internalHandler");return r.ipcRenderer.on(s,e),()=>{r.ipcRenderer.removeListener(s,e)}},"subscribe")})}o(N,"injectViridBridge");0&&(module.exports={injectViridBridge});
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @virid/bridge v0.0.1
2
+ * @virid/bridge v0.1.1
3
3
  * Electron application preloading script
4
4
  */
5
5
  var I=Object.defineProperty;var n=(e,r)=>I(e,"name",{value:r,configurable:!0});import{contextBridge as _,ipcRenderer as t}from"electron";var i="VIRID_INTERNAL_BUS";function R(){_.exposeInMainWorld("__VIRID_BRIDGE__",{post:n(e=>{t.send(i,e)},"post"),subscribe:n(e=>{let r=n((s,o)=>{e(o)},"internalHandler");return t.on(i,r),()=>{t.removeListener(i,r)}},"subscribe")})}n(R,"injectViridBridge");export{R as injectViridBridge};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@virid/bridge",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "description": "Electron application preloading script",
6
6
  "license": "Apache 2.0",
7
7
  "author": "Ailrid",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "git+https://github.com/ArisuYuki/virid.git"
15
+ "url": "git+https://github.com/Ailrid/virid.git"
16
16
  },
17
17
  "main": "./dist/index.cjs",
18
18
  "module": "./dist/index.js",