@itwin/core-electron 4.0.0-dev.24 → 4.0.0-dev.28
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/CHANGELOG.md +11 -6
- package/lib/cjs/ElectronBackend.d.ts +1 -1
- package/lib/cjs/ElectronBackend.js +17 -17
- package/lib/cjs/ElectronBackend.js.map +1 -1
- package/lib/cjs/ElectronFrontend.d.ts +1 -1
- package/lib/cjs/ElectronFrontend.js +17 -17
- package/lib/cjs/ElectronFrontend.js.map +1 -1
- package/lib/cjs/__DOC_ONLY__.d.ts +3 -3
- package/lib/cjs/__DOC_ONLY__.js +22 -22
- package/lib/cjs/__DOC_ONLY__.js.map +1 -1
- package/lib/cjs/backend/ElectronHost.d.ts +104 -104
- package/lib/cjs/backend/ElectronHost.js +240 -242
- package/lib/cjs/backend/ElectronHost.js.map +1 -1
- package/lib/cjs/backend/ElectronPreload.d.ts +1 -1
- package/lib/cjs/backend/ElectronPreload.js +39 -39
- package/lib/cjs/backend/ElectronPreload.js.map +1 -1
- package/lib/cjs/common/ElectronIpcInterface.d.ts +7 -7
- package/lib/cjs/common/ElectronIpcInterface.js +5 -5
- package/lib/cjs/common/ElectronIpcInterface.js.map +1 -1
- package/lib/cjs/common/ElectronIpcTransport.d.ts +44 -44
- package/lib/cjs/common/ElectronIpcTransport.js +186 -186
- package/lib/cjs/common/ElectronIpcTransport.js.map +1 -1
- package/lib/cjs/common/ElectronManagerLoggerCategory.d.ts +10 -10
- package/lib/cjs/common/ElectronManagerLoggerCategory.js +18 -18
- package/lib/cjs/common/ElectronManagerLoggerCategory.js.map +1 -1
- package/lib/cjs/common/ElectronPush.d.ts +20 -20
- package/lib/cjs/common/ElectronPush.js +48 -48
- package/lib/cjs/common/ElectronPush.js.map +1 -1
- package/lib/cjs/common/ElectronRpcManager.d.ts +26 -26
- package/lib/cjs/common/ElectronRpcManager.js +65 -65
- package/lib/cjs/common/ElectronRpcManager.js.map +1 -1
- package/lib/cjs/common/ElectronRpcProtocol.d.ts +34 -34
- package/lib/cjs/common/ElectronRpcProtocol.js +58 -58
- package/lib/cjs/common/ElectronRpcProtocol.js.map +1 -1
- package/lib/cjs/common/ElectronRpcRequest.d.ts +19 -19
- package/lib/cjs/common/ElectronRpcRequest.js +56 -56
- package/lib/cjs/common/ElectronRpcRequest.js.map +1 -1
- package/lib/cjs/common/ITwinElectronApi.d.ts +10 -10
- package/lib/cjs/common/ITwinElectronApi.js +6 -6
- package/lib/cjs/common/ITwinElectronApi.js.map +1 -1
- package/lib/cjs/frontend/ElectronApp.d.ts +35 -35
- package/lib/cjs/frontend/ElectronApp.js +73 -75
- package/lib/cjs/frontend/ElectronApp.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,11 @@ Wed, 08 Feb 2023 14:58:39 GMT
|
|
|
12
12
|
- Use EmptyLocalization for localization in tests to increase test performance
|
|
13
13
|
- React to RPC deprecations.
|
|
14
14
|
|
|
15
|
+
## 3.5.6
|
|
16
|
+
Fri, 24 Feb 2023 16:02:47 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
15
20
|
## 3.5.5
|
|
16
21
|
Thu, 26 Jan 2023 22:53:27 GMT
|
|
17
22
|
|
|
@@ -507,7 +512,7 @@ Fri, 30 Apr 2021 12:36:58 GMT
|
|
|
507
512
|
### Updates
|
|
508
513
|
|
|
509
514
|
- allow authConfig to be supplied from backend
|
|
510
|
-
- Fixes to desktop and iOS apps.
|
|
515
|
+
- Fixes to desktop and iOS apps.
|
|
511
516
|
- Saving & restoring Electron main window size, position & maximized state
|
|
512
517
|
|
|
513
518
|
## 2.14.4
|
|
@@ -714,7 +719,7 @@ Fri, 02 Oct 2020 18:03:32 GMT
|
|
|
714
719
|
|
|
715
720
|
### Updates
|
|
716
721
|
|
|
717
|
-
- Fixed desktop authorization after recent changes.
|
|
722
|
+
- Fixed desktop authorization after recent changes.
|
|
718
723
|
|
|
719
724
|
## 2.6.5
|
|
720
725
|
Sat, 26 Sep 2020 16:06:34 GMT
|
|
@@ -838,9 +843,9 @@ Wed, 06 May 2020 13:17:49 GMT
|
|
|
838
843
|
|
|
839
844
|
- Update to Electron 8
|
|
840
845
|
- react to changes in imodeljs-clients
|
|
841
|
-
- FrontendAuthorizationClient does not extend IDisposable.
|
|
846
|
+
- FrontendAuthorizationClient does not extend IDisposable.
|
|
842
847
|
- Update minimum Node version to 10.16.0
|
|
843
|
-
- Renamed OIDC constructs for consistency; Removed SAML support.
|
|
848
|
+
- Renamed OIDC constructs for consistency; Removed SAML support.
|
|
844
849
|
- order imports.
|
|
845
850
|
- Upgrade to Rush 5.23.2
|
|
846
851
|
- Update electron version to ^8.2.1
|
|
@@ -866,7 +871,7 @@ Wed, 12 Feb 2020 17:45:50 GMT
|
|
|
866
871
|
|
|
867
872
|
### Updates
|
|
868
873
|
|
|
869
|
-
- Setup oidc client for backend use in electron applications.
|
|
874
|
+
- Setup oidc client for backend use in electron applications.
|
|
870
875
|
|
|
871
876
|
## 1.11.0
|
|
872
877
|
Wed, 22 Jan 2020 19:24:12 GMT
|
|
@@ -948,7 +953,7 @@ Mon, 13 May 2019 15:52:05 GMT
|
|
|
948
953
|
|
|
949
954
|
- Adds parameter for api-extractor to validate missing release tags
|
|
950
955
|
- Fix broken links
|
|
951
|
-
- Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
|
|
956
|
+
- Setup a generic context for tracking client requests, and made various related enhancements to logging, usage tracking and authorization.
|
|
952
957
|
- Upgrade TypeDoc dependency to 0.14.2
|
|
953
958
|
|
|
954
959
|
## 0.190.0
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./backend/ElectronHost";
|
|
1
|
+
export * from "./backend/ElectronHost";
|
|
2
2
|
//# sourceMappingURL=ElectronBackend.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./backend/ElectronHost"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./backend/ElectronHost"), exports);
|
|
18
18
|
//# sourceMappingURL=ElectronBackend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronBackend.js","sourceRoot":"","sources":["../../src/ElectronBackend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,yDAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"ElectronBackend.js","sourceRoot":"","sources":["../../src/ElectronBackend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,yDAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport * from \"./backend/ElectronHost\";\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./frontend/ElectronApp";
|
|
1
|
+
export * from "./frontend/ElectronApp";
|
|
2
2
|
//# sourceMappingURL=ElectronFrontend.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./frontend/ElectronApp"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./frontend/ElectronApp"), exports);
|
|
18
18
|
//# sourceMappingURL=ElectronFrontend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronFrontend.js","sourceRoot":"","sources":["../../src/ElectronFrontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,yDAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"ElectronFrontend.js","sourceRoot":"","sources":["../../src/ElectronFrontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,yDAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport * from \"./frontend/ElectronApp\";\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./backend/ElectronHost";
|
|
2
|
-
export * from "./common/ElectronIpcInterface";
|
|
3
|
-
export * from "./frontend/ElectronApp";
|
|
1
|
+
export * from "./backend/ElectronHost";
|
|
2
|
+
export * from "./common/ElectronIpcInterface";
|
|
3
|
+
export * from "./frontend/ElectronApp";
|
|
4
4
|
//# sourceMappingURL=__DOC_ONLY__.d.ts.map
|
package/lib/cjs/__DOC_ONLY__.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.
|
|
18
|
-
// It imports both frontend and backend code, which is not legal anywhere.
|
|
19
|
-
// Do not import it in real code!
|
|
20
|
-
__exportStar(require("./backend/ElectronHost"), exports);
|
|
21
|
-
__exportStar(require("./common/ElectronIpcInterface"), exports);
|
|
22
|
-
__exportStar(require("./frontend/ElectronApp"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.
|
|
18
|
+
// It imports both frontend and backend code, which is not legal anywhere.
|
|
19
|
+
// Do not import it in real code!
|
|
20
|
+
__exportStar(require("./backend/ElectronHost"), exports);
|
|
21
|
+
__exportStar(require("./common/ElectronIpcInterface"), exports);
|
|
22
|
+
__exportStar(require("./frontend/ElectronApp"), exports);
|
|
23
23
|
//# sourceMappingURL=__DOC_ONLY__.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__DOC_ONLY__.js","sourceRoot":"","sources":["../../src/__DOC_ONLY__.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,sDAAsD;AACtD,0EAA0E;AAC1E,iCAAiC;AAEjC,yDAAuC;AACvC,gEAA8C;AAC9C,yDAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"__DOC_ONLY__.js","sourceRoot":"","sources":["../../src/__DOC_ONLY__.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;AAE/F,sDAAsD;AACtD,0EAA0E;AAC1E,iCAAiC;AAEjC,yDAAuC;AACvC,gEAA8C;AAC9C,yDAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n// THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.\n// It imports both frontend and backend code, which is not legal anywhere.\n// Do not import it in real code!\n\nexport * from \"./backend/ElectronHost\";\nexport * from \"./common/ElectronIpcInterface\";\nexport * from \"./frontend/ElectronApp\";\n"]}
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
import type { BrowserWindow, BrowserWindowConstructorOptions } from "electron";
|
|
2
|
-
import type * as ElectronModule from "electron";
|
|
3
|
-
import { IpcHandler, NativeHostOpts } from "@itwin/core-backend";
|
|
4
|
-
import { RpcConfiguration, RpcInterfaceDefinition } from "@itwin/core-common";
|
|
5
|
-
/**
|
|
6
|
-
* Options for [[ElectronHost.startup]]
|
|
7
|
-
* @beta
|
|
8
|
-
*/
|
|
9
|
-
export interface ElectronHostOptions {
|
|
10
|
-
/** the path to find web resources */
|
|
11
|
-
webResourcesPath?: string;
|
|
12
|
-
/** filename for the app's icon, relative to [[webResourcesPath]] */
|
|
13
|
-
iconName?: string;
|
|
14
|
-
/** name of frontend url to open. */
|
|
15
|
-
frontendURL?: string;
|
|
16
|
-
/** use a development server rather than the "electron" protocol for loading frontend (see https://www.electronjs.org/docs/api/protocol) */
|
|
17
|
-
developmentServer?: boolean;
|
|
18
|
-
/** port number for development server. Default is 3000 */
|
|
19
|
-
frontendPort?: number;
|
|
20
|
-
/** list of RPC interface definitions to register */
|
|
21
|
-
rpcInterfaces?: RpcInterfaceDefinition[];
|
|
22
|
-
/** list of [IpcHandler]($common) classes to register */
|
|
23
|
-
ipcHandlers?: (typeof IpcHandler)[];
|
|
24
|
-
}
|
|
25
|
-
/** @beta */
|
|
26
|
-
export interface ElectronHostOpts extends NativeHostOpts {
|
|
27
|
-
electronHost?: ElectronHostOptions;
|
|
28
|
-
}
|
|
29
|
-
/** @beta */
|
|
30
|
-
export interface ElectronHostWindowOptions extends BrowserWindowConstructorOptions {
|
|
31
|
-
storeWindowName?: string;
|
|
32
|
-
/** The style of window title bar. Default is `default`. */
|
|
33
|
-
titleBarStyle?: ("default" | "hidden" | "hiddenInset" | "customButtonsOnHover");
|
|
34
|
-
}
|
|
35
|
-
/** the size and position of a window as stored in the settings file.
|
|
36
|
-
* @beta
|
|
37
|
-
*/
|
|
38
|
-
export interface WindowSizeAndPositionProps {
|
|
39
|
-
width: number;
|
|
40
|
-
height: number;
|
|
41
|
-
x: number;
|
|
42
|
-
y: number;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* The backend for Electron-based desktop applications
|
|
46
|
-
* @beta
|
|
47
|
-
*/
|
|
48
|
-
export declare class ElectronHost {
|
|
49
|
-
private static readonly _deprecatedSizeAndPosStoreKey;
|
|
50
|
-
private static readonly _sizeAndPosStoreKey;
|
|
51
|
-
private static _ipc;
|
|
52
|
-
private static _developmentServer;
|
|
53
|
-
private static _electron;
|
|
54
|
-
private static _electronFrontend;
|
|
55
|
-
private static _mainWindow?;
|
|
56
|
-
static webResourcesPath: string;
|
|
57
|
-
static appIconPath: string;
|
|
58
|
-
static frontendURL: string;
|
|
59
|
-
static rpcConfig: RpcConfiguration;
|
|
60
|
-
static get ipcMain(): Electron.IpcMain;
|
|
61
|
-
static get app(): Electron.App;
|
|
62
|
-
static get electron(): typeof ElectronModule;
|
|
63
|
-
private constructor();
|
|
64
|
-
/**
|
|
65
|
-
* Converts an "electron://frontend/" URL to an absolute file path.
|
|
66
|
-
*
|
|
67
|
-
* We use this protocol in production builds because our frontend must be built with absolute URLs,
|
|
68
|
-
* however, since we're loading everything directly from the install directory, we cannot know the
|
|
69
|
-
* absolute path at build time.
|
|
70
|
-
*/
|
|
71
|
-
private static parseElectronUrl;
|
|
72
|
-
private static _openWindow;
|
|
73
|
-
/** The "main" BrowserWindow for this application. */
|
|
74
|
-
static get mainWindow(): BrowserWindow | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* Gets window size and position for a window, by name, from settings file, if present.
|
|
77
|
-
* @note Size and position values in the settings file will be updated differently depending on platform.
|
|
78
|
-
* On Linux values are only updated on window "unmaximize".
|
|
79
|
-
* On Windows and MacOS values are also updated on window manual resize or move.
|
|
80
|
-
* To get consistent behavior across different platforms, use [[ElectronHost.getWindowSizeAndPositionSetting]].
|
|
81
|
-
* @deprecated in 3.6. Use [[ElectronHost.getWindowSizeAndPositionSetting]].
|
|
82
|
-
*/
|
|
83
|
-
static getWindowSizeSetting(windowName: string): WindowSizeAndPositionProps | undefined;
|
|
84
|
-
/**
|
|
85
|
-
* Gets window size and position for a window, by name, from settings file, if present.
|
|
86
|
-
*/
|
|
87
|
-
static getWindowSizeAndPositionSetting(windowName: string): WindowSizeAndPositionProps | undefined;
|
|
88
|
-
/** Gets "window maximized" flag for a window, by name, from settings file if present */
|
|
89
|
-
static getWindowMaximizedSetting(windowName: string): boolean | undefined;
|
|
90
|
-
/**
|
|
91
|
-
* Open the main Window when the app is ready.
|
|
92
|
-
* @param windowOptions Options for constructing the main BrowserWindow. See: https://electronjs.org/docs/api/browser-window#new-browserwindowoptions
|
|
93
|
-
*/
|
|
94
|
-
static openMainWindow(windowOptions?: ElectronHostWindowOptions): Promise<void>;
|
|
95
|
-
static get isValid(): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Initialize the backend of an Electron app.
|
|
98
|
-
* This method configures the backend for all of the inter-process communication (RPC and IPC) for an
|
|
99
|
-
* Electron app. It should be called from your Electron main function.
|
|
100
|
-
* @param opts Options that control aspects of your backend.
|
|
101
|
-
* @note This method must only be called from the backend of an Electron app (i.e. when [ProcessDetector.isElectronAppBackend]($bentley) is `true`).
|
|
102
|
-
*/
|
|
103
|
-
static startup(opts?: ElectronHostOpts): Promise<void>;
|
|
104
|
-
}
|
|
1
|
+
import type { BrowserWindow, BrowserWindowConstructorOptions } from "electron";
|
|
2
|
+
import type * as ElectronModule from "electron";
|
|
3
|
+
import { IpcHandler, NativeHostOpts } from "@itwin/core-backend";
|
|
4
|
+
import { RpcConfiguration, RpcInterfaceDefinition } from "@itwin/core-common";
|
|
5
|
+
/**
|
|
6
|
+
* Options for [[ElectronHost.startup]]
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export interface ElectronHostOptions {
|
|
10
|
+
/** the path to find web resources */
|
|
11
|
+
webResourcesPath?: string;
|
|
12
|
+
/** filename for the app's icon, relative to [[webResourcesPath]] */
|
|
13
|
+
iconName?: string;
|
|
14
|
+
/** name of frontend url to open. */
|
|
15
|
+
frontendURL?: string;
|
|
16
|
+
/** use a development server rather than the "electron" protocol for loading frontend (see https://www.electronjs.org/docs/api/protocol) */
|
|
17
|
+
developmentServer?: boolean;
|
|
18
|
+
/** port number for development server. Default is 3000 */
|
|
19
|
+
frontendPort?: number;
|
|
20
|
+
/** list of RPC interface definitions to register */
|
|
21
|
+
rpcInterfaces?: RpcInterfaceDefinition[];
|
|
22
|
+
/** list of [IpcHandler]($common) classes to register */
|
|
23
|
+
ipcHandlers?: (typeof IpcHandler)[];
|
|
24
|
+
}
|
|
25
|
+
/** @beta */
|
|
26
|
+
export interface ElectronHostOpts extends NativeHostOpts {
|
|
27
|
+
electronHost?: ElectronHostOptions;
|
|
28
|
+
}
|
|
29
|
+
/** @beta */
|
|
30
|
+
export interface ElectronHostWindowOptions extends BrowserWindowConstructorOptions {
|
|
31
|
+
storeWindowName?: string;
|
|
32
|
+
/** The style of window title bar. Default is `default`. */
|
|
33
|
+
titleBarStyle?: ("default" | "hidden" | "hiddenInset" | "customButtonsOnHover");
|
|
34
|
+
}
|
|
35
|
+
/** the size and position of a window as stored in the settings file.
|
|
36
|
+
* @beta
|
|
37
|
+
*/
|
|
38
|
+
export interface WindowSizeAndPositionProps {
|
|
39
|
+
width: number;
|
|
40
|
+
height: number;
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The backend for Electron-based desktop applications
|
|
46
|
+
* @beta
|
|
47
|
+
*/
|
|
48
|
+
export declare class ElectronHost {
|
|
49
|
+
private static readonly _deprecatedSizeAndPosStoreKey;
|
|
50
|
+
private static readonly _sizeAndPosStoreKey;
|
|
51
|
+
private static _ipc;
|
|
52
|
+
private static _developmentServer;
|
|
53
|
+
private static _electron;
|
|
54
|
+
private static _electronFrontend;
|
|
55
|
+
private static _mainWindow?;
|
|
56
|
+
static webResourcesPath: string;
|
|
57
|
+
static appIconPath: string;
|
|
58
|
+
static frontendURL: string;
|
|
59
|
+
static rpcConfig: RpcConfiguration;
|
|
60
|
+
static get ipcMain(): Electron.IpcMain;
|
|
61
|
+
static get app(): Electron.App;
|
|
62
|
+
static get electron(): typeof ElectronModule;
|
|
63
|
+
private constructor();
|
|
64
|
+
/**
|
|
65
|
+
* Converts an "electron://frontend/" URL to an absolute file path.
|
|
66
|
+
*
|
|
67
|
+
* We use this protocol in production builds because our frontend must be built with absolute URLs,
|
|
68
|
+
* however, since we're loading everything directly from the install directory, we cannot know the
|
|
69
|
+
* absolute path at build time.
|
|
70
|
+
*/
|
|
71
|
+
private static parseElectronUrl;
|
|
72
|
+
private static _openWindow;
|
|
73
|
+
/** The "main" BrowserWindow for this application. */
|
|
74
|
+
static get mainWindow(): BrowserWindow | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Gets window size and position for a window, by name, from settings file, if present.
|
|
77
|
+
* @note Size and position values in the settings file will be updated differently depending on platform.
|
|
78
|
+
* On Linux values are only updated on window "unmaximize".
|
|
79
|
+
* On Windows and MacOS values are also updated on window manual resize or move.
|
|
80
|
+
* To get consistent behavior across different platforms, use [[ElectronHost.getWindowSizeAndPositionSetting]].
|
|
81
|
+
* @deprecated in 3.6. Use [[ElectronHost.getWindowSizeAndPositionSetting]].
|
|
82
|
+
*/
|
|
83
|
+
static getWindowSizeSetting(windowName: string): WindowSizeAndPositionProps | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Gets window size and position for a window, by name, from settings file, if present.
|
|
86
|
+
*/
|
|
87
|
+
static getWindowSizeAndPositionSetting(windowName: string): WindowSizeAndPositionProps | undefined;
|
|
88
|
+
/** Gets "window maximized" flag for a window, by name, from settings file if present */
|
|
89
|
+
static getWindowMaximizedSetting(windowName: string): boolean | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Open the main Window when the app is ready.
|
|
92
|
+
* @param windowOptions Options for constructing the main BrowserWindow. See: https://electronjs.org/docs/api/browser-window#new-browserwindowoptions
|
|
93
|
+
*/
|
|
94
|
+
static openMainWindow(windowOptions?: ElectronHostWindowOptions): Promise<void>;
|
|
95
|
+
static get isValid(): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Initialize the backend of an Electron app.
|
|
98
|
+
* This method configures the backend for all of the inter-process communication (RPC and IPC) for an
|
|
99
|
+
* Electron app. It should be called from your Electron main function.
|
|
100
|
+
* @param opts Options that control aspects of your backend.
|
|
101
|
+
* @note This method must only be called from the backend of an Electron app (i.e. when [ProcessDetector.isElectronAppBackend]($bentley) is `true`).
|
|
102
|
+
*/
|
|
103
|
+
static startup(opts?: ElectronHostOpts): Promise<void>;
|
|
104
|
+
}
|
|
105
105
|
//# sourceMappingURL=ElectronHost.d.ts.map
|