emr-bridge 1.3.0 → 1.4.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 +131 -108
- package/cjs/enums.d.ts +5 -4
- package/cjs/enums.js +4 -3
- package/cjs/exp.d.ts +3 -3
- package/cjs/exp.js +7 -4
- package/cjs/index.d.ts +3 -3
- package/cjs/index.js +5 -3
- package/cjs/scripts/Bridge.js +5 -2
- package/cjs/scripts/Main.js +17 -4
- package/cjs/scripts/newDecorators.d.ts +46 -4
- package/cjs/scripts/newDecorators.js +33 -8
- package/cjs/scripts/oldDecorators.d.ts +115 -7
- package/cjs/scripts/oldDecorators.js +40 -7
- package/cjs/scripts/preloadProvider.js +23 -6
- package/cjs/scripts/provider.js +22 -9
- package/cjs/scripts/publish.d.ts +10 -5
- package/cjs/scripts/publish.js +59 -23
- package/cjs/types.d.ts +14 -4
- package/esm/enums.d.ts +5 -4
- package/esm/enums.js +4 -3
- package/esm/exp.d.ts +3 -3
- package/esm/exp.js +2 -2
- package/esm/index.d.ts +3 -3
- package/esm/index.js +2 -2
- package/esm/scripts/Bridge.js +5 -2
- package/esm/scripts/Main.js +17 -4
- package/esm/scripts/newDecorators.d.ts +46 -4
- package/esm/scripts/newDecorators.js +31 -7
- package/esm/scripts/oldDecorators.d.ts +115 -7
- package/esm/scripts/oldDecorators.js +36 -5
- package/esm/scripts/preloadProvider.js +23 -6
- package/esm/scripts/provider.js +22 -9
- package/esm/scripts/publish.d.ts +10 -5
- package/esm/scripts/publish.js +56 -21
- package/esm/types.d.ts +14 -4
- package/package.json +1 -1
package/esm/types.d.ts
CHANGED
|
@@ -18,10 +18,15 @@ export interface IPublishMethodArgs {
|
|
|
18
18
|
name?: string;
|
|
19
19
|
scope?: Scope;
|
|
20
20
|
}
|
|
21
|
-
export interface
|
|
21
|
+
export interface IPublishMainEventArgs {
|
|
22
22
|
name?: string;
|
|
23
23
|
scope?: Scope;
|
|
24
24
|
}
|
|
25
|
+
export interface IPublishRendererEventArgs {
|
|
26
|
+
name?: string;
|
|
27
|
+
scope?: Scope;
|
|
28
|
+
receiver?: EventReceiver;
|
|
29
|
+
}
|
|
25
30
|
export interface IPublishPropertyArgs {
|
|
26
31
|
name?: string;
|
|
27
32
|
scope?: Scope;
|
|
@@ -30,7 +35,8 @@ export interface IPublishPropertyArgs {
|
|
|
30
35
|
export interface ICreateProviderArgs {
|
|
31
36
|
info: IInfo;
|
|
32
37
|
scope: Scope;
|
|
33
|
-
|
|
38
|
+
handleMainEvent(name: string, type: 'on' | 'once', handler: EventHandler<IIPCResult>): EventUnsubscriber;
|
|
39
|
+
emitRendererEvent(name: string, arg: any): void;
|
|
34
40
|
callFunction(name: string, ...args: any[]): IIPCResult;
|
|
35
41
|
getVariable(name: string): IIPCResult;
|
|
36
42
|
setVariable(name: string, value: any): IIPCResult | undefined;
|
|
@@ -38,8 +44,10 @@ export interface ICreateProviderArgs {
|
|
|
38
44
|
}
|
|
39
45
|
export type Scopes = Record<string, Set<Scope>>;
|
|
40
46
|
export type Accesses = Record<string, Set<Access>>;
|
|
47
|
+
export type RendererEvent<T = undefined> = (handler: EventHandler<T>, isOnce?: boolean) => EventUnsubscriber;
|
|
41
48
|
export type MainEvent<T = undefined> = (handler: EventHandler<T>) => EventUnsubscriber;
|
|
42
49
|
export type EventEmitter = (...args: any[]) => any;
|
|
50
|
+
export type EventReceiver<I = any, O = any> = (input: I) => O;
|
|
43
51
|
export type EventUnsubscriber = () => void;
|
|
44
52
|
export type EventHandler<T> = (result: T) => void;
|
|
45
53
|
export interface IRendererPublic {
|
|
@@ -50,7 +58,8 @@ export interface IProvider {
|
|
|
50
58
|
waitPromise(name: string, resolve: (value: any) => void, reject?: (reason?: any) => void): void;
|
|
51
59
|
provided: {
|
|
52
60
|
functions: Record<string, (...args: any[]) => IIPCResult>;
|
|
53
|
-
|
|
61
|
+
mainEvents: Record<string, (type: 'on' | 'once', handler: EventHandler<IIPCResult>) => EventUnsubscriber>;
|
|
62
|
+
rendererEvents: Record<string, (arg: any) => void>;
|
|
54
63
|
properties: Record<string, IIPCResult>;
|
|
55
64
|
};
|
|
56
65
|
}
|
|
@@ -62,7 +71,8 @@ export type PublicProperty = {
|
|
|
62
71
|
export interface IInfo {
|
|
63
72
|
properties: Set<string>;
|
|
64
73
|
functions: Set<string>;
|
|
65
|
-
|
|
74
|
+
mainEvents: Set<string>;
|
|
75
|
+
rendererEvents: Set<string>;
|
|
66
76
|
scopes: Scopes;
|
|
67
77
|
accesses: Accesses;
|
|
68
78
|
}
|