@openfin/node-adapter 45.100.98 → 45.100.100
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/out/node-adapter.js +28 -1
- package/package.json +2 -2
package/out/node-adapter.js
CHANGED
|
@@ -853,6 +853,33 @@ class WebContents extends EmitterBase {
|
|
|
853
853
|
setZoomLevel(level) {
|
|
854
854
|
return this.wire.sendAction('set-zoom-level', { ...this.identity, level }).then(() => undefined);
|
|
855
855
|
}
|
|
856
|
+
/**
|
|
857
|
+
* Translates the WebContents from the source language to the target language.
|
|
858
|
+
*
|
|
859
|
+
* Translation requires a translation API key to be configured on the machine. If translation is
|
|
860
|
+
* unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
|
|
861
|
+
* the failure.
|
|
862
|
+
*
|
|
863
|
+
* @param options Source and target languages for the translation.
|
|
864
|
+
*/
|
|
865
|
+
async translatePage(options) {
|
|
866
|
+
await this.wire.sendAction('translate-page', { ...this.identity, ...options });
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Reverts a previously translated WebContents back to its original language.
|
|
870
|
+
*
|
|
871
|
+
* If the WebContents is not currently translated, this is a no-op and resolves successfully.
|
|
872
|
+
*/
|
|
873
|
+
async revertTranslation() {
|
|
874
|
+
await this.wire.sendAction('revert-translation', this.identity);
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Gets the current content-translation state of the WebContents.
|
|
878
|
+
*/
|
|
879
|
+
async getTranslationState() {
|
|
880
|
+
const { payload } = await this.wire.sendAction('get-translation-state', this.identity);
|
|
881
|
+
return payload.data;
|
|
882
|
+
}
|
|
856
883
|
/**
|
|
857
884
|
* Navigates the WebContents to a specified URL.
|
|
858
885
|
*
|
|
@@ -17414,7 +17441,7 @@ class NodeEnvironment extends BaseEnvironment {
|
|
|
17414
17441
|
};
|
|
17415
17442
|
}
|
|
17416
17443
|
getAdapterVersionSync() {
|
|
17417
|
-
return "45.100.
|
|
17444
|
+
return "45.100.100";
|
|
17418
17445
|
}
|
|
17419
17446
|
observeBounds(element, onChange) {
|
|
17420
17447
|
throw new Error('Method not implemented.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfin/node-adapter",
|
|
3
|
-
"version": "45.100.
|
|
3
|
+
"version": "45.100.100",
|
|
4
4
|
"description": "See README.md",
|
|
5
5
|
"main": "out/node-adapter.js",
|
|
6
6
|
"types": "out/node-adapter.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"es-toolkit": "^1.39.3",
|
|
21
21
|
"ws": "^7.5.10",
|
|
22
22
|
"tslib": "2.8.1",
|
|
23
|
-
"@openfin/core": "45.100.
|
|
23
|
+
"@openfin/core": "45.100.100"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"prebuild": "rimraf ./out",
|