emr-bridge 1.4.1 → 1.6.0
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 +20 -20
- package/cjs/enums.js +3 -3
- package/cjs/exp.d.ts +1 -1
- package/cjs/exp.js +1 -3
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +16 -0
- package/cjs/main.d.ts +4 -0
- package/cjs/main.js +18 -0
- package/cjs/scripts/Bridge.d.ts +2 -1
- package/cjs/scripts/Bridge.js +44 -28
- package/cjs/scripts/Main.d.ts +2 -1
- package/cjs/scripts/Main.js +71 -52
- package/cjs/scripts/newDecorators.d.ts +13 -6
- package/cjs/scripts/newDecorators.js +3 -3
- package/cjs/scripts/oldDecorators.d.ts +13 -117
- package/cjs/scripts/oldDecorators.js +30 -42
- package/cjs/scripts/preloadProvider.js +29 -16
- package/cjs/scripts/provider.js +86 -133
- package/cjs/scripts/publish.d.ts +9 -5
- package/cjs/scripts/publish.js +59 -33
- package/cjs/types.d.ts +10 -10
- package/esm/exp.d.ts +1 -1
- package/esm/exp.js +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.js +2 -0
- package/esm/main.d.ts +4 -0
- package/esm/main.js +3 -0
- package/esm/scripts/Bridge.d.ts +2 -1
- package/esm/scripts/Bridge.js +44 -28
- package/esm/scripts/Main.d.ts +2 -1
- package/esm/scripts/Main.js +71 -52
- package/esm/scripts/newDecorators.d.ts +13 -6
- package/esm/scripts/newDecorators.js +3 -3
- package/esm/scripts/oldDecorators.d.ts +13 -117
- package/esm/scripts/oldDecorators.js +29 -39
- package/esm/scripts/preloadProvider.js +13 -3
- package/esm/scripts/provider.js +87 -134
- package/esm/scripts/publish.d.ts +9 -5
- package/esm/scripts/publish.js +44 -21
- package/esm/types.d.ts +10 -10
- package/package.json +3 -35
package/esm/scripts/Bridge.js
CHANGED
|
@@ -1,37 +1,53 @@
|
|
|
1
1
|
import { Scope } from '../enums';
|
|
2
2
|
import createProvider from './provider';
|
|
3
|
-
if (!window.__provider__)
|
|
4
|
-
throw new Error('Required methods not provided. Did you forget to call "provide" in preload?');
|
|
5
|
-
const provider = window.__provider__;
|
|
6
|
-
const info = provider.getInfo();
|
|
7
3
|
/**
|
|
8
4
|
* Bridge between `renderer` and `main` processes.
|
|
9
5
|
*
|
|
10
6
|
* _only for renderer process_
|
|
11
7
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return provider.provided.functions[name](...args);
|
|
17
|
-
},
|
|
18
|
-
emitRendererEvent(name, arg) {
|
|
19
|
-
provider.provided.rendererEvents[name](arg);
|
|
20
|
-
},
|
|
21
|
-
handleMainEvent(name, type, handler) {
|
|
22
|
-
return provider.provided.mainEvents[name](type, handler);
|
|
23
|
-
},
|
|
24
|
-
getVariable(name) {
|
|
25
|
-
return provider.provided.properties[name].get();
|
|
26
|
-
},
|
|
27
|
-
setVariable(name, value) {
|
|
28
|
-
provider.provided.properties[name].set(value);
|
|
29
|
-
return undefined;
|
|
30
|
-
},
|
|
31
|
-
waitPromise(channel) {
|
|
32
|
-
return new Promise((resolve, reject) => {
|
|
33
|
-
provider.waitPromise(channel, resolve, reject);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
8
|
+
let Bridge = new Proxy({ as() { throwError(); } }, {
|
|
9
|
+
get() { throwError(); },
|
|
10
|
+
set() { throwError(); },
|
|
11
|
+
apply() { throwError(); }
|
|
36
12
|
});
|
|
13
|
+
/** Выбрасывает ошибку если используется не в том процессе */
|
|
14
|
+
let throwError;
|
|
15
|
+
if (typeof window === 'undefined') {
|
|
16
|
+
throwError = () => { throw new Error('"Bridge" is unavailable in main process. In preload use "Main" instead.'); };
|
|
17
|
+
}
|
|
18
|
+
else if (!window.__provider__) {
|
|
19
|
+
throwError = () => { throw new Error('Required methods not provided. Call "provideFromMain" in preload process.'); };
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
initInWeb();
|
|
23
|
+
}
|
|
24
|
+
/** Выполняется только в web */
|
|
25
|
+
function initInWeb() {
|
|
26
|
+
const provider = window.__provider__;
|
|
27
|
+
const info = provider.getInfo();
|
|
28
|
+
Bridge = createProvider({
|
|
29
|
+
info, scope: Scope.renderer,
|
|
30
|
+
callFunction(name, ...args) {
|
|
31
|
+
return provider.provided.functions[name](...args);
|
|
32
|
+
},
|
|
33
|
+
emitRendererEvent(name, arg) {
|
|
34
|
+
provider.provided.rendererEvents[name](arg);
|
|
35
|
+
},
|
|
36
|
+
handleMainEvent(name, type, handler) {
|
|
37
|
+
return provider.provided.mainEvents[name](type, handler);
|
|
38
|
+
},
|
|
39
|
+
getVariable(name) {
|
|
40
|
+
return provider.provided.properties[name].get();
|
|
41
|
+
},
|
|
42
|
+
setVariable(name, value) {
|
|
43
|
+
provider.provided.properties[name].set(value);
|
|
44
|
+
return undefined;
|
|
45
|
+
},
|
|
46
|
+
waitPromise(channel) {
|
|
47
|
+
return new Promise((resolve, reject) => {
|
|
48
|
+
provider.waitPromise(channel, resolve, reject);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
37
53
|
export default Bridge;
|
package/esm/scripts/Main.d.ts
CHANGED
package/esm/scripts/Main.js
CHANGED
|
@@ -1,61 +1,80 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Electron from 'electron';
|
|
2
2
|
import { IPCChannel, Scope } from '../enums';
|
|
3
3
|
import createProvider from './provider';
|
|
4
|
-
const info = ipcRenderer.sendSync(IPCChannel.getPublicInfo);
|
|
5
|
-
if (!info)
|
|
6
|
-
throw new Error('Public methods from main is not provided');
|
|
7
4
|
/**
|
|
8
5
|
* Bridge between `preload` and `main` processes.
|
|
9
6
|
*
|
|
10
7
|
* _only for preload process_
|
|
11
8
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return ipcRenderer.sendSync(IPCChannel.functionCall + name, ...args);
|
|
17
|
-
},
|
|
18
|
-
handleMainEvent(name, type, handler) {
|
|
19
|
-
const listener = (_, result) => handler(result);
|
|
20
|
-
const emitChannel = IPCChannel.mainEventEmit + name;
|
|
21
|
-
if (type === 'on') {
|
|
22
|
-
ipcRenderer.send(IPCChannel.mainEventOn + name);
|
|
23
|
-
ipcRenderer.on(emitChannel, listener);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
ipcRenderer.send(IPCChannel.mainEventOnce + name);
|
|
27
|
-
ipcRenderer.once(emitChannel, listener);
|
|
28
|
-
}
|
|
29
|
-
return () => ipcRenderer.removeListener(emitChannel, listener);
|
|
30
|
-
},
|
|
31
|
-
emitRendererEvent(name, arg) {
|
|
32
|
-
const emitChannel = IPCChannel.rendererEventEmit + name;
|
|
33
|
-
if (arg instanceof Promise) {
|
|
34
|
-
const promiseChannel = emitChannel + IPCChannel.promisePostfix;
|
|
35
|
-
ipcRenderer.sendSync(emitChannel, { promiseChannel });
|
|
36
|
-
arg
|
|
37
|
-
.then(value => ipcRenderer.send(promiseChannel, { value }))
|
|
38
|
-
.catch(reason => ipcRenderer.send(promiseChannel, { error: String(reason) }));
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
ipcRenderer.send(emitChannel, { value: arg });
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
getVariable(name) {
|
|
45
|
-
return ipcRenderer.sendSync(IPCChannel.propertyGet + name);
|
|
46
|
-
},
|
|
47
|
-
setVariable(name, value) {
|
|
48
|
-
return ipcRenderer.sendSync(IPCChannel.propertySet + name, value);
|
|
49
|
-
},
|
|
50
|
-
waitPromise(channel) {
|
|
51
|
-
return new Promise((resolve, reject) => {
|
|
52
|
-
ipcRenderer.once(channel, (_, result) => {
|
|
53
|
-
if (result.error)
|
|
54
|
-
reject(result.error);
|
|
55
|
-
else
|
|
56
|
-
resolve(result.value);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
9
|
+
let Main = new Proxy({ as() { throwError(); } }, {
|
|
10
|
+
get() { throwError(); },
|
|
11
|
+
set() { throwError(); },
|
|
12
|
+
apply() { throwError(); }
|
|
60
13
|
});
|
|
14
|
+
/** Выбрасывает ошибку если используется не в том процессе */
|
|
15
|
+
let throwError;
|
|
16
|
+
if (typeof window !== 'undefined') {
|
|
17
|
+
throwError = () => { throw new Error('"Main" is unavailable in renderer process. Use "Bridge" instead'); };
|
|
18
|
+
}
|
|
19
|
+
else if (!Electron.ipcRenderer) {
|
|
20
|
+
throwError = () => { throw new Error('"Main" is unavailable in main process.'); };
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
initInNode();
|
|
24
|
+
}
|
|
25
|
+
/** Выполняется только в NodeJS */
|
|
26
|
+
function initInNode() {
|
|
27
|
+
const { ipcRenderer } = Electron;
|
|
28
|
+
const info = ipcRenderer.sendSync(IPCChannel.getPublicInfo);
|
|
29
|
+
if (!info)
|
|
30
|
+
throw new Error('Public methods from main is not provided. Call any publish methods to provide it from main process.');
|
|
31
|
+
Main = createProvider({
|
|
32
|
+
info, scope: Scope.preload,
|
|
33
|
+
callFunction(name, ...args) {
|
|
34
|
+
return ipcRenderer.sendSync(IPCChannel.functionCall + name, ...args);
|
|
35
|
+
},
|
|
36
|
+
handleMainEvent(name, type, handler) {
|
|
37
|
+
const listener = (_, result) => handler(result);
|
|
38
|
+
const emitChannel = IPCChannel.mainEventEmit + name;
|
|
39
|
+
if (type === 'on') {
|
|
40
|
+
ipcRenderer.send(IPCChannel.mainEventOn + name);
|
|
41
|
+
ipcRenderer.on(emitChannel, listener);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
ipcRenderer.send(IPCChannel.mainEventOnce + name);
|
|
45
|
+
ipcRenderer.once(emitChannel, listener);
|
|
46
|
+
}
|
|
47
|
+
return () => ipcRenderer.removeListener(emitChannel, listener);
|
|
48
|
+
},
|
|
49
|
+
emitRendererEvent(name, arg) {
|
|
50
|
+
const emitChannel = IPCChannel.rendererEventEmit + name;
|
|
51
|
+
if (arg instanceof Promise) {
|
|
52
|
+
const promiseChannel = emitChannel + IPCChannel.promisePostfix;
|
|
53
|
+
ipcRenderer.sendSync(emitChannel, { promiseChannel });
|
|
54
|
+
arg
|
|
55
|
+
.then(value => ipcRenderer.send(promiseChannel, { value }))
|
|
56
|
+
.catch(reason => ipcRenderer.send(promiseChannel, { error: String(reason) }));
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
ipcRenderer.send(emitChannel, { value: arg });
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
getVariable(name) {
|
|
63
|
+
return ipcRenderer.sendSync(IPCChannel.propertyGet + name);
|
|
64
|
+
},
|
|
65
|
+
setVariable(name, value) {
|
|
66
|
+
return ipcRenderer.sendSync(IPCChannel.propertySet + name, value);
|
|
67
|
+
},
|
|
68
|
+
waitPromise(channel) {
|
|
69
|
+
return new Promise((resolve, reject) => {
|
|
70
|
+
ipcRenderer.once(channel, (_, result) => {
|
|
71
|
+
if (result.error)
|
|
72
|
+
reject(result.error);
|
|
73
|
+
else
|
|
74
|
+
resolve(result.value);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
61
80
|
export default Main;
|
|
@@ -9,6 +9,7 @@ export declare function publicMethod(): ClassMethodDecorator;
|
|
|
9
9
|
* Makes the method available for **renderer** and **preload** processes.
|
|
10
10
|
*
|
|
11
11
|
* _only new decorators_
|
|
12
|
+
*
|
|
12
13
|
* @param name - name by which the method will be accessed
|
|
13
14
|
*/
|
|
14
15
|
export declare function publicMethod(name: string): ClassMethodDecorator;
|
|
@@ -16,6 +17,7 @@ export declare function publicMethod(name: string): ClassMethodDecorator;
|
|
|
16
17
|
* Makes the method available for **renderer** and **preload** processes.
|
|
17
18
|
*
|
|
18
19
|
* _only new decorators_
|
|
20
|
+
*
|
|
19
21
|
* @param args - publish args
|
|
20
22
|
*/
|
|
21
23
|
export declare function publicMethod(args: IPublishMethodArgs): ClassMethodDecorator;
|
|
@@ -29,6 +31,7 @@ export declare function publicClassMainEvent(): ClassMethodDecorator;
|
|
|
29
31
|
* Makes the event available for **renderer** and **preload** processes.
|
|
30
32
|
*
|
|
31
33
|
* _only new decorators_
|
|
34
|
+
*
|
|
32
35
|
* @param name - name by which the event will be accessed
|
|
33
36
|
*/
|
|
34
37
|
export declare function publicClassMainEvent(name: string): ClassMethodDecorator;
|
|
@@ -36,6 +39,7 @@ export declare function publicClassMainEvent(name: string): ClassMethodDecorator
|
|
|
36
39
|
* Makes the event available for **renderer** and **preload** processes.
|
|
37
40
|
*
|
|
38
41
|
* _only new decorators_
|
|
42
|
+
*
|
|
39
43
|
* @param args - publish args
|
|
40
44
|
*/
|
|
41
45
|
export declare function publicClassMainEvent(args: IPublishMainEventArgs): ClassMethodDecorator;
|
|
@@ -49,6 +53,7 @@ export declare function publicClassRendererEvent(): ClassPropertyDecorator;
|
|
|
49
53
|
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
50
54
|
*
|
|
51
55
|
* _only new decorators_
|
|
56
|
+
*
|
|
52
57
|
* @param name - name by which the event will be accessed
|
|
53
58
|
*/
|
|
54
59
|
export declare function publicClassRendererEvent(name: string): ClassPropertyDecorator;
|
|
@@ -56,12 +61,14 @@ export declare function publicClassRendererEvent(name: string): ClassPropertyDec
|
|
|
56
61
|
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
57
62
|
*
|
|
58
63
|
* _only new decorators_
|
|
64
|
+
*
|
|
59
65
|
* @param receiver - linked receiver
|
|
60
66
|
*/
|
|
61
67
|
export declare function publicClassRendererEvent(receiver: EventReceiver): ClassPropertyDecorator;
|
|
62
68
|
/**
|
|
63
69
|
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
64
70
|
*
|
|
71
|
+
* * _only new decorators_
|
|
65
72
|
*
|
|
66
73
|
* @param name - name by which the event will be accessed
|
|
67
74
|
* @param receiver - linked receiver
|
|
@@ -71,13 +78,7 @@ export declare function publicClassRendererEvent(name: string, receiver: EventRe
|
|
|
71
78
|
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
72
79
|
*
|
|
73
80
|
* _only new decorators_
|
|
74
|
-
* @param args - publish args
|
|
75
|
-
*/
|
|
76
|
-
export declare function publicClassRendererEvent(args: IPublishRendererEventArgs): ClassPropertyDecorator;
|
|
77
|
-
/**
|
|
78
|
-
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
79
81
|
*
|
|
80
|
-
* _only new decorators_
|
|
81
82
|
* @param args - publish args
|
|
82
83
|
*/
|
|
83
84
|
export declare function publicClassRendererEvent(args: IPublishRendererEventArgs): ClassPropertyDecorator;
|
|
@@ -91,6 +92,7 @@ export declare function publicProperty(): ClassPropertyDecorator;
|
|
|
91
92
|
* Makes the property available for **renderer** and **preload** processes.
|
|
92
93
|
*
|
|
93
94
|
* _only new decorators_
|
|
95
|
+
*
|
|
94
96
|
* @param name - name by which the property will be accessed
|
|
95
97
|
*/
|
|
96
98
|
export declare function publicProperty(name: string): ClassPropertyDecorator;
|
|
@@ -98,6 +100,7 @@ export declare function publicProperty(name: string): ClassPropertyDecorator;
|
|
|
98
100
|
* Makes the property available for **renderer** and **preload** processes.
|
|
99
101
|
*
|
|
100
102
|
* _only new decorators_
|
|
103
|
+
*
|
|
101
104
|
* @param args - publish args
|
|
102
105
|
*/
|
|
103
106
|
export declare function publicProperty(args: IPublishPropertyArgs): ClassPropertyDecorator;
|
|
@@ -111,6 +114,7 @@ export declare function publicGetter(): ClassGetterDecorator;
|
|
|
111
114
|
* Makes the property getter available for **renderer** and **preload** processes.
|
|
112
115
|
*
|
|
113
116
|
* _only new decorators_
|
|
117
|
+
*
|
|
114
118
|
* @param name - name by which the property will be accessed
|
|
115
119
|
*/
|
|
116
120
|
export declare function publicGetter(name: string): ClassGetterDecorator;
|
|
@@ -118,6 +122,7 @@ export declare function publicGetter(name: string): ClassGetterDecorator;
|
|
|
118
122
|
* Makes the property getter available for **renderer** and **preload** processes.
|
|
119
123
|
*
|
|
120
124
|
* _only new decorators_
|
|
125
|
+
*
|
|
121
126
|
* @param args - publish args
|
|
122
127
|
*/
|
|
123
128
|
export declare function publicGetter(args: PublishGetterArgs): ClassGetterDecorator;
|
|
@@ -131,6 +136,7 @@ export declare function publicSetter(): ClassSetterDecorator;
|
|
|
131
136
|
* Makes the property setter available for **renderer** and **preload** processes.
|
|
132
137
|
*
|
|
133
138
|
* _only new decorators_
|
|
139
|
+
*
|
|
134
140
|
* @param name - name by which the property will be accessed
|
|
135
141
|
*/
|
|
136
142
|
export declare function publicSetter(name: string): ClassSetterDecorator;
|
|
@@ -138,6 +144,7 @@ export declare function publicSetter(name: string): ClassSetterDecorator;
|
|
|
138
144
|
* Makes the property setter available for **renderer** and **preload** processes.
|
|
139
145
|
*
|
|
140
146
|
* _only new decorators_
|
|
147
|
+
*
|
|
141
148
|
* @param args - publish args
|
|
142
149
|
*/
|
|
143
150
|
export declare function publicSetter(args: PublishSetterArgs): ClassSetterDecorator;
|
|
@@ -46,7 +46,7 @@ export function publicClassRendererEvent(arg) {
|
|
|
46
46
|
}
|
|
47
47
|
else if (typeof arg === 'object') {
|
|
48
48
|
name = arg.name ?? String(context.name);
|
|
49
|
-
receiver = arg.
|
|
49
|
+
receiver = arg.procFn ?? receiver;
|
|
50
50
|
if (arg.scope)
|
|
51
51
|
addScope(name, arg.scope);
|
|
52
52
|
}
|
|
@@ -79,11 +79,11 @@ export function publicProperty(arg) {
|
|
|
79
79
|
context.addInitializer(function () {
|
|
80
80
|
publicVariable(name, {
|
|
81
81
|
get: () => {
|
|
82
|
-
// @ts-
|
|
82
|
+
// @ts-expect-error
|
|
83
83
|
return this[key];
|
|
84
84
|
},
|
|
85
85
|
set: (value) => {
|
|
86
|
-
// @ts-
|
|
86
|
+
// @ts-expect-error
|
|
87
87
|
this[key] = value;
|
|
88
88
|
}
|
|
89
89
|
});
|
|
@@ -3,7 +3,6 @@ import type { EventReceiver, IPublishMainEventArgs, IPublishMethodArgs, IPublish
|
|
|
3
3
|
* Makes the method available for **renderer** and **preload** processes.
|
|
4
4
|
*
|
|
5
5
|
* _only for static_
|
|
6
|
-
*
|
|
7
6
|
* _experimental decorators_
|
|
8
7
|
*/
|
|
9
8
|
export declare function publicStaticMethod(): MethodDecorator;
|
|
@@ -11,8 +10,8 @@ export declare function publicStaticMethod(): MethodDecorator;
|
|
|
11
10
|
* Makes the method available for **renderer** and **preload** processes.
|
|
12
11
|
*
|
|
13
12
|
* _only for static_
|
|
14
|
-
*
|
|
15
13
|
* _experimental decorators_
|
|
14
|
+
*
|
|
16
15
|
* @param name - name by which the method will be accessed
|
|
17
16
|
*/
|
|
18
17
|
export declare function publicStaticMethod(name: string): MethodDecorator;
|
|
@@ -20,8 +19,8 @@ export declare function publicStaticMethod(name: string): MethodDecorator;
|
|
|
20
19
|
* Makes the method available for **renderer** and **preload** processes.
|
|
21
20
|
*
|
|
22
21
|
* _only for static_
|
|
23
|
-
*
|
|
24
22
|
* _experimental decorators_
|
|
23
|
+
*
|
|
25
24
|
* @param args - publish args
|
|
26
25
|
*/
|
|
27
26
|
export declare function publicStaticMethod(args: IPublishMethodArgs): MethodDecorator;
|
|
@@ -29,9 +28,7 @@ export declare function publicStaticMethod(args: IPublishMethodArgs): MethodDeco
|
|
|
29
28
|
* Makes the method available for **renderer** and **preload** processes.
|
|
30
29
|
*
|
|
31
30
|
* _only for non-static_
|
|
32
|
-
*
|
|
33
31
|
* _experimental decorators_
|
|
34
|
-
*
|
|
35
32
|
* _required `providePublic(classInstance)`_
|
|
36
33
|
*/
|
|
37
34
|
export declare function publicMethod(): MethodDecorator;
|
|
@@ -39,10 +36,9 @@ export declare function publicMethod(): MethodDecorator;
|
|
|
39
36
|
* Makes the method available for **renderer** and **preload** processes.
|
|
40
37
|
*
|
|
41
38
|
* _only for non-static_
|
|
42
|
-
*
|
|
43
39
|
* _experimental decorators_
|
|
44
|
-
*
|
|
45
40
|
* _required `providePublic(classInstance)`_
|
|
41
|
+
*
|
|
46
42
|
* @param name - name by which the method will be accessed
|
|
47
43
|
*/
|
|
48
44
|
export declare function publicMethod(name: string): MethodDecorator;
|
|
@@ -50,46 +46,17 @@ export declare function publicMethod(name: string): MethodDecorator;
|
|
|
50
46
|
* Makes the method available for **renderer** and **preload** processes.
|
|
51
47
|
*
|
|
52
48
|
* _only for non-static_
|
|
53
|
-
*
|
|
54
49
|
* _experimental decorators_
|
|
55
|
-
*
|
|
56
50
|
* _required `providePublic(classInstance)`_
|
|
57
|
-
* @param args - publish args
|
|
58
|
-
*/
|
|
59
|
-
export declare function publicMethod(args: IPublishMethodArgs): MethodDecorator;
|
|
60
|
-
/**
|
|
61
|
-
* Makes the event available for **renderer** and **preload** processes.
|
|
62
|
-
*
|
|
63
|
-
* _only for static_
|
|
64
|
-
*
|
|
65
|
-
* _experimental decorators_
|
|
66
|
-
*/
|
|
67
|
-
export declare function publicStaticMainEvent(): MethodDecorator;
|
|
68
|
-
/**
|
|
69
|
-
* Makes the event available for **renderer** and **preload** processes.
|
|
70
51
|
*
|
|
71
|
-
* _only for static_
|
|
72
|
-
*
|
|
73
|
-
* _experimental decorators_
|
|
74
|
-
* @param name - name by which the event will be accessed
|
|
75
|
-
*/
|
|
76
|
-
export declare function publicStaticMainEvent(name: string): MethodDecorator;
|
|
77
|
-
/**
|
|
78
|
-
* Makes the event available for **renderer** and **preload** processes.
|
|
79
|
-
*
|
|
80
|
-
* _only for static_
|
|
81
|
-
*
|
|
82
|
-
* _experimental decorators_
|
|
83
52
|
* @param args - publish args
|
|
84
53
|
*/
|
|
85
|
-
export declare function
|
|
54
|
+
export declare function publicMethod(args: IPublishMethodArgs): MethodDecorator;
|
|
86
55
|
/**
|
|
87
56
|
* Makes the event available for **renderer** and **preload** processes.
|
|
88
57
|
*
|
|
89
58
|
* _only for non-static_
|
|
90
|
-
*
|
|
91
59
|
* _experimental decorators_
|
|
92
|
-
*
|
|
93
60
|
* _required `providePublic(classInstance)`_
|
|
94
61
|
*/
|
|
95
62
|
export declare function publicClassMainEvent(): MethodDecorator;
|
|
@@ -97,10 +64,9 @@ export declare function publicClassMainEvent(): MethodDecorator;
|
|
|
97
64
|
* Makes the event available for **renderer** and **preload** processes.
|
|
98
65
|
*
|
|
99
66
|
* _only for non-static_
|
|
100
|
-
*
|
|
101
67
|
* _experimental decorators_
|
|
102
|
-
*
|
|
103
68
|
* _required `providePublic(classInstance)`_
|
|
69
|
+
*
|
|
104
70
|
* @param name - name by which the event will be accessed
|
|
105
71
|
*/
|
|
106
72
|
export declare function publicClassMainEvent(name: string): MethodDecorator;
|
|
@@ -108,72 +74,16 @@ export declare function publicClassMainEvent(name: string): MethodDecorator;
|
|
|
108
74
|
* Makes the event available for **renderer** and **preload** processes.
|
|
109
75
|
*
|
|
110
76
|
* _only for non-static_
|
|
111
|
-
*
|
|
112
77
|
* _experimental decorators_
|
|
113
|
-
*
|
|
114
78
|
* _required `providePublic(classInstance)`_
|
|
115
|
-
* @param args - publish args
|
|
116
|
-
*/
|
|
117
|
-
export declare function publicClassMainEvent(args: IPublishMainEventArgs): MethodDecorator;
|
|
118
|
-
/**
|
|
119
|
-
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
120
|
-
*
|
|
121
|
-
* _only for static_
|
|
122
79
|
*
|
|
123
|
-
* _experimental decorators_
|
|
124
|
-
*/
|
|
125
|
-
export declare function publicStaticRendererEvent(): PropertyDecorator;
|
|
126
|
-
/**
|
|
127
|
-
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
128
|
-
*
|
|
129
|
-
* _only for static_
|
|
130
|
-
*
|
|
131
|
-
* _experimental decorators_
|
|
132
|
-
* @param name - name by which the event will be accessed
|
|
133
|
-
*/
|
|
134
|
-
export declare function publicStaticRendererEvent(name: string): PropertyDecorator;
|
|
135
|
-
/**
|
|
136
|
-
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
137
|
-
*
|
|
138
|
-
* _only for static_
|
|
139
|
-
*
|
|
140
|
-
* _experimental decorators_
|
|
141
|
-
* @param receiver - linked receiver
|
|
142
|
-
*/
|
|
143
|
-
export declare function publicStaticRendererEvent(receiver: EventReceiver): PropertyDecorator;
|
|
144
|
-
/**
|
|
145
|
-
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
146
|
-
*
|
|
147
|
-
* _only for static_
|
|
148
|
-
*
|
|
149
|
-
* _experimental decorators_
|
|
150
|
-
* @param name - name by which the event will be accessed
|
|
151
|
-
* @param receiver - linked receiver
|
|
152
|
-
*/
|
|
153
|
-
export declare function publicStaticRendererEvent(name: string, receiver: EventReceiver): PropertyDecorator;
|
|
154
|
-
/**
|
|
155
|
-
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
156
|
-
*
|
|
157
|
-
* _only for static_
|
|
158
|
-
*
|
|
159
|
-
* _experimental decorators_
|
|
160
|
-
* @param args - publish args
|
|
161
|
-
*/
|
|
162
|
-
export declare function publicStaticRendererEvent(args: IPublishRendererEventArgs): PropertyDecorator;
|
|
163
|
-
/**
|
|
164
|
-
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
165
|
-
*
|
|
166
|
-
* _only for static_
|
|
167
|
-
*
|
|
168
|
-
* _experimental decorators_
|
|
169
80
|
* @param args - publish args
|
|
170
81
|
*/
|
|
171
|
-
export declare function
|
|
82
|
+
export declare function publicClassMainEvent(args: IPublishMainEventArgs): MethodDecorator;
|
|
172
83
|
/**
|
|
173
84
|
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
174
85
|
*
|
|
175
86
|
* _only for non-static_
|
|
176
|
-
*
|
|
177
87
|
* _experimental decorators_
|
|
178
88
|
*/
|
|
179
89
|
export declare function publicClassRendererEvent(): PropertyDecorator;
|
|
@@ -181,8 +91,8 @@ export declare function publicClassRendererEvent(): PropertyDecorator;
|
|
|
181
91
|
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
182
92
|
*
|
|
183
93
|
* _only for non-static_
|
|
184
|
-
*
|
|
185
94
|
* _experimental decorators_
|
|
95
|
+
*
|
|
186
96
|
* @param name - name by which the event will be accessed
|
|
187
97
|
*/
|
|
188
98
|
export declare function publicClassRendererEvent(name: string): PropertyDecorator;
|
|
@@ -190,8 +100,8 @@ export declare function publicClassRendererEvent(name: string): PropertyDecorato
|
|
|
190
100
|
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
191
101
|
*
|
|
192
102
|
* _only for non-static_
|
|
193
|
-
*
|
|
194
103
|
* _experimental decorators_
|
|
104
|
+
*
|
|
195
105
|
* @param receiver - linked receiver
|
|
196
106
|
*/
|
|
197
107
|
export declare function publicClassRendererEvent(receiver: EventReceiver): PropertyDecorator;
|
|
@@ -199,8 +109,8 @@ export declare function publicClassRendererEvent(receiver: EventReceiver): Prope
|
|
|
199
109
|
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
200
110
|
*
|
|
201
111
|
* _only for non-static_
|
|
202
|
-
*
|
|
203
112
|
* _experimental decorators_
|
|
113
|
+
*
|
|
204
114
|
* @param name - name by which the event will be accessed
|
|
205
115
|
* @param receiver - linked receiver
|
|
206
116
|
*/
|
|
@@ -209,17 +119,8 @@ export declare function publicClassRendererEvent(name: string, receiver: EventRe
|
|
|
209
119
|
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
210
120
|
*
|
|
211
121
|
* _only for non-static_
|
|
212
|
-
*
|
|
213
122
|
* _experimental decorators_
|
|
214
|
-
* @param args - publish args
|
|
215
|
-
*/
|
|
216
|
-
export declare function publicClassRendererEvent(args: IPublishRendererEventArgs): PropertyDecorator;
|
|
217
|
-
/**
|
|
218
|
-
* Makes the event from **renderer** and **preload** available for **main** process.
|
|
219
|
-
*
|
|
220
|
-
* _only for non-static_
|
|
221
123
|
*
|
|
222
|
-
* _experimental decorators_
|
|
223
124
|
* @param args - publish args
|
|
224
125
|
*/
|
|
225
126
|
export declare function publicClassRendererEvent(args: IPublishRendererEventArgs): PropertyDecorator;
|
|
@@ -227,7 +128,6 @@ export declare function publicClassRendererEvent(args: IPublishRendererEventArgs
|
|
|
227
128
|
* Makes the property available for **renderer** and **preload** processes.
|
|
228
129
|
*
|
|
229
130
|
* _only for static_
|
|
230
|
-
*
|
|
231
131
|
* _experimental decorators_
|
|
232
132
|
*/
|
|
233
133
|
export declare function publicStaticProperty(): PropertyDecorator;
|
|
@@ -235,8 +135,8 @@ export declare function publicStaticProperty(): PropertyDecorator;
|
|
|
235
135
|
* Makes the property available for **renderer** and **preload** processes.
|
|
236
136
|
*
|
|
237
137
|
* _only for static_
|
|
238
|
-
*
|
|
239
138
|
* _experimental decorators_
|
|
139
|
+
*
|
|
240
140
|
* @param name - name by which the property will be accessed
|
|
241
141
|
*/
|
|
242
142
|
export declare function publicStaticProperty(name: string): PropertyDecorator;
|
|
@@ -244,8 +144,8 @@ export declare function publicStaticProperty(name: string): PropertyDecorator;
|
|
|
244
144
|
* Makes the property available for **renderer** and **preload** processes.
|
|
245
145
|
*
|
|
246
146
|
* _only for static_
|
|
247
|
-
*
|
|
248
147
|
* _experimental decorators_
|
|
148
|
+
*
|
|
249
149
|
* @param args - publish args
|
|
250
150
|
*/
|
|
251
151
|
export declare function publicStaticProperty(args: IPublishPropertyArgs): PropertyDecorator;
|
|
@@ -253,9 +153,7 @@ export declare function publicStaticProperty(args: IPublishPropertyArgs): Proper
|
|
|
253
153
|
* Makes the property available for **renderer** and **preload** processes.
|
|
254
154
|
*
|
|
255
155
|
* _only for non-static_
|
|
256
|
-
*
|
|
257
156
|
* _experimental decorators_
|
|
258
|
-
*
|
|
259
157
|
* _required `providePublic(classInstance)`_
|
|
260
158
|
*/
|
|
261
159
|
export declare function publicProperty(): PropertyDecorator;
|
|
@@ -263,10 +161,9 @@ export declare function publicProperty(): PropertyDecorator;
|
|
|
263
161
|
* Makes the property available for **renderer** and **preload** processes.
|
|
264
162
|
*
|
|
265
163
|
* _only for non-static_
|
|
266
|
-
*
|
|
267
164
|
* _experimental decorators_
|
|
268
|
-
*
|
|
269
165
|
* _required `providePublic(classInstance)`_
|
|
166
|
+
*
|
|
270
167
|
* @param name - name by which the property will be accessed
|
|
271
168
|
*/
|
|
272
169
|
export declare function publicProperty(name: string): PropertyDecorator;
|
|
@@ -274,10 +171,9 @@ export declare function publicProperty(name: string): PropertyDecorator;
|
|
|
274
171
|
* Makes the property available for **renderer** and **preload** processes.
|
|
275
172
|
*
|
|
276
173
|
* _only for non-static_
|
|
277
|
-
*
|
|
278
174
|
* _experimental decorators_
|
|
279
|
-
*
|
|
280
175
|
* _required `providePublic(classInstance)`_
|
|
176
|
+
*
|
|
281
177
|
* @param args - publish args
|
|
282
178
|
*/
|
|
283
179
|
export declare function publicProperty(args: IPublishPropertyArgs): PropertyDecorator;
|