@rongcloud/electron-renderer 0.0.1-c-rs-alpha.1

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/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2016 RongCloud.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # @rongcloud/electron-renderer
2
+ 融云官方即时通讯 Electron SDK 依赖包,不单独使用,需要配合 @rongcloud/electron 一起使用。
package/index.cjs ADDED
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var electron = require('electron');
4
+
5
+ const bridge = {
6
+ ipcRenderer: {
7
+ on(eventName, callback) {
8
+ electron.ipcRenderer.on(eventName, (event, ...args) => {
9
+ callback(event, ...args);
10
+ });
11
+ },
12
+ off(eventName) {
13
+ electron.ipcRenderer.removeAllListeners(eventName);
14
+ },
15
+ invoke(eventName, ...args) {
16
+ return electron.ipcRenderer.invoke(eventName, ...args);
17
+ },
18
+ send(eventName, ...args) {
19
+ electron.ipcRenderer.send(eventName, ...args);
20
+ },
21
+ sendSync(eventName, ...args) {
22
+ return electron.ipcRenderer.sendSync(eventName, ...args);
23
+ },
24
+ },
25
+ process: {
26
+ title: process.title,
27
+ pid: process.pid,
28
+ ppid: process.ppid,
29
+ platform: process.platform,
30
+ arch: process.arch,
31
+ uptime: () => process.uptime(),
32
+ cpuUsage: () => process.cpuUsage(),
33
+ memoryUsage: () => process.memoryUsage(),
34
+ resourceUsage: () => process.resourceUsage(),
35
+ },
36
+ };
37
+ if (process.contextIsolated) {
38
+ // 只有开启上下文隔离时,才能调用 contextBridge.exposeInMainWorld 方法
39
+ electron.contextBridge.exposeInMainWorld('__RCRustContextBridge__', bridge);
40
+ }
41
+ else {
42
+ // 未开启上下文隔离时,直接挂载到 window 对象上
43
+ window.__RCRustContextBridge__ = bridge;
44
+ }
package/index.cjs.js ADDED
@@ -0,0 +1,44 @@
1
+ 'use strict';
2
+
3
+ var electron = require('electron');
4
+
5
+ const bridge = {
6
+ ipcRenderer: {
7
+ on(eventName, callback) {
8
+ electron.ipcRenderer.on(eventName, (event, ...args) => {
9
+ callback(event, ...args);
10
+ });
11
+ },
12
+ off(eventName) {
13
+ electron.ipcRenderer.removeAllListeners(eventName);
14
+ },
15
+ invoke(eventName, ...args) {
16
+ return electron.ipcRenderer.invoke(eventName, ...args);
17
+ },
18
+ send(eventName, ...args) {
19
+ electron.ipcRenderer.send(eventName, ...args);
20
+ },
21
+ sendSync(eventName, ...args) {
22
+ return electron.ipcRenderer.sendSync(eventName, ...args);
23
+ },
24
+ },
25
+ process: {
26
+ title: process.title,
27
+ pid: process.pid,
28
+ ppid: process.ppid,
29
+ platform: process.platform,
30
+ arch: process.arch,
31
+ uptime: () => process.uptime(),
32
+ cpuUsage: () => process.cpuUsage(),
33
+ memoryUsage: () => process.memoryUsage(),
34
+ resourceUsage: () => process.resourceUsage(),
35
+ },
36
+ };
37
+ if (process.contextIsolated) {
38
+ // 只有开启上下文隔离时,才能调用 contextBridge.exposeInMainWorld 方法
39
+ electron.contextBridge.exposeInMainWorld('__RCRustContextBridge__', bridge);
40
+ }
41
+ else {
42
+ // 未开启上下文隔离时,直接挂载到 window 对象上
43
+ window.__RCRustContextBridge__ = bridge;
44
+ }
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.d.ts.map
package/index.esm.js ADDED
@@ -0,0 +1,42 @@
1
+ import { ipcRenderer, contextBridge } from 'electron';
2
+
3
+ const bridge = {
4
+ ipcRenderer: {
5
+ on(eventName, callback) {
6
+ ipcRenderer.on(eventName, (event, ...args) => {
7
+ callback(event, ...args);
8
+ });
9
+ },
10
+ off(eventName) {
11
+ ipcRenderer.removeAllListeners(eventName);
12
+ },
13
+ invoke(eventName, ...args) {
14
+ return ipcRenderer.invoke(eventName, ...args);
15
+ },
16
+ send(eventName, ...args) {
17
+ ipcRenderer.send(eventName, ...args);
18
+ },
19
+ sendSync(eventName, ...args) {
20
+ return ipcRenderer.sendSync(eventName, ...args);
21
+ },
22
+ },
23
+ process: {
24
+ title: process.title,
25
+ pid: process.pid,
26
+ ppid: process.ppid,
27
+ platform: process.platform,
28
+ arch: process.arch,
29
+ uptime: () => process.uptime(),
30
+ cpuUsage: () => process.cpuUsage(),
31
+ memoryUsage: () => process.memoryUsage(),
32
+ resourceUsage: () => process.resourceUsage(),
33
+ },
34
+ };
35
+ if (process.contextIsolated) {
36
+ // 只有开启上下文隔离时,才能调用 contextBridge.exposeInMainWorld 方法
37
+ contextBridge.exposeInMainWorld('__RCRustContextBridge__', bridge);
38
+ }
39
+ else {
40
+ // 未开启上下文隔离时,直接挂载到 window 对象上
41
+ window.__RCRustContextBridge__ = bridge;
42
+ }
package/index.mjs ADDED
@@ -0,0 +1,42 @@
1
+ import { ipcRenderer, contextBridge } from 'electron';
2
+
3
+ const bridge = {
4
+ ipcRenderer: {
5
+ on(eventName, callback) {
6
+ ipcRenderer.on(eventName, (event, ...args) => {
7
+ callback(event, ...args);
8
+ });
9
+ },
10
+ off(eventName) {
11
+ ipcRenderer.removeAllListeners(eventName);
12
+ },
13
+ invoke(eventName, ...args) {
14
+ return ipcRenderer.invoke(eventName, ...args);
15
+ },
16
+ send(eventName, ...args) {
17
+ ipcRenderer.send(eventName, ...args);
18
+ },
19
+ sendSync(eventName, ...args) {
20
+ return ipcRenderer.sendSync(eventName, ...args);
21
+ },
22
+ },
23
+ process: {
24
+ title: process.title,
25
+ pid: process.pid,
26
+ ppid: process.ppid,
27
+ platform: process.platform,
28
+ arch: process.arch,
29
+ uptime: () => process.uptime(),
30
+ cpuUsage: () => process.cpuUsage(),
31
+ memoryUsage: () => process.memoryUsage(),
32
+ resourceUsage: () => process.resourceUsage(),
33
+ },
34
+ };
35
+ if (process.contextIsolated) {
36
+ // 只有开启上下文隔离时,才能调用 contextBridge.exposeInMainWorld 方法
37
+ contextBridge.exposeInMainWorld('__RCRustContextBridge__', bridge);
38
+ }
39
+ else {
40
+ // 未开启上下文隔离时,直接挂载到 window 对象上
41
+ window.__RCRustContextBridge__ = bridge;
42
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@rongcloud/electron-renderer",
3
+ "main": "index.cjs.js",
4
+ "types": "index.d.ts",
5
+ "module": "index.esm.js",
6
+ "exports": {
7
+ ".": {
8
+ "require": "./index.cjs",
9
+ "import": "./index.mjs",
10
+ "types": "./index.d.ts"
11
+ }
12
+ },
13
+ "version": "0.0.1-c-rs-alpha.1",
14
+ "author": "pass-web@rongcloud.cn",
15
+ "license": "LGPL 2.1",
16
+ "homepage": "https://www.rongcloud.cn",
17
+ "contributors": [
18
+ "pass-web@rongcloud.cn"
19
+ ],
20
+ "files": [
21
+ "LICENSE",
22
+ "index.cjs.js",
23
+ "index.d.ts",
24
+ "index.esm.js",
25
+ "index.cjs",
26
+ "index.mjs",
27
+ "README.md"
28
+ ],
29
+ "__attrs__": {
30
+ "globals": "RCCppContextBridge"
31
+ },
32
+ "peerDependencies": {
33
+ "@rongcloud/engine": "=0.0.1-c-rs-alpha.1"
34
+ }
35
+ }