@proton-app/main 0.0.9 → 0.1.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/dist/communication.d.ts +2 -0
- package/dist/communication.js +6 -2
- package/package.json +1 -1
package/dist/communication.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export declare const APP_CHANNELS: {
|
|
|
30
30
|
readonly openLink: "app:open-link";
|
|
31
31
|
readonly getValue: "app:get-value";
|
|
32
32
|
readonly setValue: "app:set-value";
|
|
33
|
+
readonly syncAuth: "app:sync-auth";
|
|
33
34
|
};
|
|
34
35
|
export interface AppBridge {
|
|
35
36
|
minimize: () => void;
|
|
@@ -38,6 +39,7 @@ export interface AppBridge {
|
|
|
38
39
|
openLink: (url: string) => void;
|
|
39
40
|
getValue: <T>(key: string) => T;
|
|
40
41
|
setValue: <T>(key: string, value: T) => T;
|
|
42
|
+
syncAuth: (accessToken: string) => void;
|
|
41
43
|
}
|
|
42
44
|
type IpcClient = Pick<IpcRenderer, "send" | "invoke">;
|
|
43
45
|
/**
|
package/dist/communication.js
CHANGED
|
@@ -64,7 +64,8 @@ exports.APP_CHANNELS = {
|
|
|
64
64
|
choosePath: "app:choose-path",
|
|
65
65
|
openLink: "app:open-link",
|
|
66
66
|
getValue: "app:get-value",
|
|
67
|
-
setValue: "app:set-value"
|
|
67
|
+
setValue: "app:set-value",
|
|
68
|
+
syncAuth: "app:sync-auth"
|
|
68
69
|
};
|
|
69
70
|
/**
|
|
70
71
|
* Creates the standard application controls exposed by an Electron preload.
|
|
@@ -87,7 +88,10 @@ function createAppBridge(ipc) {
|
|
|
87
88
|
return ipc.invoke(exports.APP_CHANNELS.getValue, key);
|
|
88
89
|
},
|
|
89
90
|
setValue: (key, value) => {
|
|
90
|
-
return ipc.invoke(exports.APP_CHANNELS.setValue, key);
|
|
91
|
+
return ipc.invoke(exports.APP_CHANNELS.setValue, key, value);
|
|
92
|
+
},
|
|
93
|
+
syncAuth: (accessToken) => {
|
|
94
|
+
return ipc.send(exports.APP_CHANNELS.syncAuth, accessToken);
|
|
91
95
|
}
|
|
92
96
|
};
|
|
93
97
|
}
|