@itwin/core-electron 4.0.0-dev.1 → 4.0.0-dev.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +59 -1
  2. package/lib/cjs/ElectronBackend.d.ts +1 -1
  3. package/lib/cjs/ElectronBackend.js +21 -17
  4. package/lib/cjs/ElectronBackend.js.map +1 -1
  5. package/lib/cjs/ElectronFrontend.d.ts +1 -1
  6. package/lib/cjs/ElectronFrontend.js +21 -17
  7. package/lib/cjs/ElectronFrontend.js.map +1 -1
  8. package/lib/cjs/__DOC_ONLY__.d.ts +19 -3
  9. package/lib/cjs/__DOC_ONLY__.d.ts.map +1 -1
  10. package/lib/cjs/__DOC_ONLY__.js +42 -22
  11. package/lib/cjs/__DOC_ONLY__.js.map +1 -1
  12. package/lib/cjs/backend/ElectronHost.d.ts +107 -104
  13. package/lib/cjs/backend/ElectronHost.d.ts.map +1 -1
  14. package/lib/cjs/backend/ElectronHost.js +240 -243
  15. package/lib/cjs/backend/ElectronHost.js.map +1 -1
  16. package/lib/cjs/backend/ElectronPreload.d.ts +1 -1
  17. package/lib/cjs/backend/ElectronPreload.js +39 -39
  18. package/lib/cjs/backend/ElectronPreload.js.map +1 -1
  19. package/lib/cjs/common/ElectronIpcInterface.d.ts +10 -7
  20. package/lib/cjs/common/ElectronIpcInterface.d.ts.map +1 -1
  21. package/lib/cjs/common/ElectronIpcInterface.js +12 -5
  22. package/lib/cjs/common/ElectronIpcInterface.js.map +1 -1
  23. package/lib/cjs/common/ElectronIpcTransport.d.ts +44 -44
  24. package/lib/cjs/common/ElectronIpcTransport.js +186 -186
  25. package/lib/cjs/common/ElectronIpcTransport.js.map +1 -1
  26. package/lib/cjs/common/ElectronPush.d.ts +17 -20
  27. package/lib/cjs/common/ElectronPush.d.ts.map +1 -1
  28. package/lib/cjs/common/ElectronPush.js +45 -48
  29. package/lib/cjs/common/ElectronPush.js.map +1 -1
  30. package/lib/cjs/common/ElectronRpcManager.d.ts +23 -26
  31. package/lib/cjs/common/ElectronRpcManager.d.ts.map +1 -1
  32. package/lib/cjs/common/ElectronRpcManager.js +56 -65
  33. package/lib/cjs/common/ElectronRpcManager.js.map +1 -1
  34. package/lib/cjs/common/ElectronRpcProtocol.d.ts +34 -34
  35. package/lib/cjs/common/ElectronRpcProtocol.js +58 -58
  36. package/lib/cjs/common/ElectronRpcProtocol.js.map +1 -1
  37. package/lib/cjs/common/ElectronRpcRequest.d.ts +19 -19
  38. package/lib/cjs/common/ElectronRpcRequest.js +56 -56
  39. package/lib/cjs/common/ITwinElectronApi.d.ts +13 -10
  40. package/lib/cjs/common/ITwinElectronApi.d.ts.map +1 -1
  41. package/lib/cjs/common/ITwinElectronApi.js +6 -6
  42. package/lib/cjs/common/ITwinElectronApi.js.map +1 -1
  43. package/lib/cjs/frontend/ElectronApp.d.ts +38 -35
  44. package/lib/cjs/frontend/ElectronApp.d.ts.map +1 -1
  45. package/lib/cjs/frontend/ElectronApp.js +76 -75
  46. package/lib/cjs/frontend/ElectronApp.js.map +1 -1
  47. package/package.json +27 -29
  48. package/lib/cjs/common/ElectronManagerLoggerCategory.d.ts +0 -11
  49. package/lib/cjs/common/ElectronManagerLoggerCategory.d.ts.map +0 -1
  50. package/lib/cjs/common/ElectronManagerLoggerCategory.js +0 -19
  51. package/lib/cjs/common/ElectronManagerLoggerCategory.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,64 @@
1
1
  # Change Log - @itwin/core-electron
2
2
 
3
- This log was last generated on Thu, 26 Jan 2023 22:53:27 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 25 Apr 2023 17:50:35 GMT and should not be manually modified.
4
+
5
+ ## 3.7.4
6
+ Tue, 25 Apr 2023 17:50:35 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 3.7.3
11
+ Thu, 20 Apr 2023 13:19:29 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 3.7.2
16
+ Wed, 12 Apr 2023 13:12:42 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 3.7.1
21
+ Mon, 03 Apr 2023 15:15:37 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 3.7.0
26
+ Wed, 29 Mar 2023 15:02:27 GMT
27
+
28
+ ### Updates
29
+
30
+ - React to IModelApp.rpcInterfaces and BentleyCloudRpcManager changes.
31
+ - Add support for Electron 23.
32
+
33
+ ## 3.6.3
34
+ Mon, 27 Mar 2023 16:26:47 GMT
35
+
36
+ _Version update only_
37
+
38
+ ## 3.6.2
39
+ Fri, 17 Mar 2023 17:52:32 GMT
40
+
41
+ _Version update only_
42
+
43
+ ## 3.6.1
44
+ Fri, 24 Feb 2023 22:00:48 GMT
45
+
46
+ _Version update only_
47
+
48
+ ## 3.6.0
49
+ Wed, 08 Feb 2023 14:58:39 GMT
50
+
51
+ ### Updates
52
+
53
+ - Added ElectronHost.getWindowSizeAndPositionSetting to replace now deprecated ElectronHost.getWindowSizeSetting
54
+ - Add support for Electron 22.
55
+ - Use EmptyLocalization for localization in tests to increase test performance
56
+ - React to RPC deprecations.
57
+
58
+ ## 3.5.6
59
+ Fri, 24 Feb 2023 16:02:47 GMT
60
+
61
+ _Version update only_
4
62
 
5
63
  ## 3.5.5
6
64
  Thu, 26 Jan 2023 22:53:27 GMT
@@ -1,2 +1,2 @@
1
- export * from "./backend/ElectronHost";
1
+ export * from "./backend/ElectronHost";
2
2
  //# sourceMappingURL=ElectronBackend.d.ts.map
@@ -1,18 +1,22 @@
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
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./backend/ElectronHost"), exports);
18
22
  //# 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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./backend/ElectronHost\";\r\n"]}
1
+ {"version":3,"file":"ElectronBackend.js","sourceRoot":"","sources":["../../src/ElectronBackend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,yDAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./backend/ElectronHost\";\r\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,22 @@
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
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./frontend/ElectronApp"), exports);
18
22
  //# 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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./frontend/ElectronApp\";\r\n"]}
1
+ {"version":3,"file":"ElectronFrontend.js","sourceRoot":"","sources":["../../src/ElectronFrontend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,yDAAuC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nexport * from \"./frontend/ElectronApp\";\r\n"]}
@@ -1,4 +1,20 @@
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
+ /** @docs-package-description
5
+ *
6
+ * The core-electron package contains the electron utilities to write an iTwin.js application based on Electron.
7
+ */
8
+ /**
9
+ * @docs-group-description Renderer
10
+ * For use in the Electron renderer process
11
+ */
12
+ /**
13
+ * @docs-group-description Main
14
+ * For use in the Electron main process
15
+ */
16
+ /**
17
+ * @docs-group-description RpcInterface
18
+ * Functionality facilitate electron RPC
19
+ */
4
20
  //# sourceMappingURL=__DOC_ONLY__.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"__DOC_ONLY__.d.ts","sourceRoot":"","sources":["../../src/__DOC_ONLY__.ts"],"names":[],"mappings":"AASA,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"__DOC_ONLY__.d.ts","sourceRoot":"","sources":["../../src/__DOC_ONLY__.ts"],"names":[],"mappings":"AASA,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AAEvC;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG"}
@@ -1,23 +1,43 @@
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
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ // THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.
22
+ // It imports both frontend and backend code, which is not legal anywhere.
23
+ // Do not import it in real code!
24
+ __exportStar(require("./backend/ElectronHost"), exports);
25
+ __exportStar(require("./common/ElectronIpcInterface"), exports);
26
+ __exportStar(require("./frontend/ElectronApp"), exports);
27
+ /** @docs-package-description
28
+ *
29
+ * The core-electron package contains the electron utilities to write an iTwin.js application based on Electron.
30
+ */
31
+ /**
32
+ * @docs-group-description Renderer
33
+ * For use in the Electron renderer process
34
+ */
35
+ /**
36
+ * @docs-group-description Main
37
+ * For use in the Electron main process
38
+ */
39
+ /**
40
+ * @docs-group-description RpcInterface
41
+ * Functionality facilitate electron RPC
42
+ */
23
43
  //# 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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n// THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.\r\n// It imports both frontend and backend code, which is not legal anywhere.\r\n// Do not import it in real code!\r\n\r\nexport * from \"./backend/ElectronHost\";\r\nexport * from \"./common/ElectronIpcInterface\";\r\nexport * from \"./frontend/ElectronApp\";\r\n"]}
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;AAEvC;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n// THIS FILE EXISTS ONLY FOR DOCUMENTATION GENERATION.\r\n// It imports both frontend and backend code, which is not legal anywhere.\r\n// Do not import it in real code!\r\n\r\nexport * from \"./backend/ElectronHost\";\r\nexport * from \"./common/ElectronIpcInterface\";\r\nexport * from \"./frontend/ElectronApp\";\r\n\r\n/** @docs-package-description\r\n *\r\n * The core-electron package contains the electron utilities to write an iTwin.js application based on Electron.\r\n */\r\n\r\n/**\r\n * @docs-group-description Renderer\r\n * For use in the Electron renderer process\r\n */\r\n\r\n/**\r\n * @docs-group-description Main\r\n * For use in the Electron main process\r\n */\r\n\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Functionality facilitate electron RPC\r\n */\r\n"]}
@@ -1,105 +1,108 @@
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
+ /** @packageDocumentation
2
+ * @module Main
3
+ */
4
+ import type { BrowserWindow, BrowserWindowConstructorOptions } from "electron";
5
+ import type * as ElectronModule from "electron";
6
+ import { IpcHandler, NativeHostOpts } from "@itwin/core-backend";
7
+ import { RpcConfiguration, RpcInterfaceDefinition } from "@itwin/core-common";
8
+ /**
9
+ * Options for [[ElectronHost.startup]]
10
+ * @beta
11
+ */
12
+ export interface ElectronHostOptions {
13
+ /** the path to find web resources */
14
+ webResourcesPath?: string;
15
+ /** filename for the app's icon, relative to [[webResourcesPath]] */
16
+ iconName?: string;
17
+ /** name of frontend url to open. */
18
+ frontendURL?: string;
19
+ /** use a development server rather than the "electron" protocol for loading frontend (see https://www.electronjs.org/docs/api/protocol) */
20
+ developmentServer?: boolean;
21
+ /** port number for development server. Default is 3000 */
22
+ frontendPort?: number;
23
+ /** list of RPC interface definitions to register */
24
+ rpcInterfaces?: RpcInterfaceDefinition[];
25
+ /** list of [IpcHandler]($backend) classes to register */
26
+ ipcHandlers?: (typeof IpcHandler)[];
27
+ }
28
+ /** @beta */
29
+ export interface ElectronHostOpts extends NativeHostOpts {
30
+ electronHost?: ElectronHostOptions;
31
+ }
32
+ /** @beta */
33
+ export interface ElectronHostWindowOptions extends BrowserWindowConstructorOptions {
34
+ storeWindowName?: string;
35
+ /** The style of window title bar. Default is `default`. */
36
+ titleBarStyle?: ("default" | "hidden" | "hiddenInset" | "customButtonsOnHover");
37
+ }
38
+ /** the size and position of a window as stored in the settings file.
39
+ * @beta
40
+ */
41
+ export interface WindowSizeAndPositionProps {
42
+ width: number;
43
+ height: number;
44
+ x: number;
45
+ y: number;
46
+ }
47
+ /**
48
+ * The backend for Electron-based desktop applications
49
+ * @beta
50
+ */
51
+ export declare class ElectronHost {
52
+ private static readonly _deprecatedSizeAndPosStoreKey;
53
+ private static readonly _sizeAndPosStoreKey;
54
+ private static _ipc;
55
+ private static _developmentServer;
56
+ private static _electron;
57
+ private static _electronFrontend;
58
+ private static _mainWindow?;
59
+ static webResourcesPath: string;
60
+ static appIconPath: string;
61
+ static frontendURL: string;
62
+ static rpcConfig: RpcConfiguration;
63
+ static get ipcMain(): Electron.IpcMain;
64
+ static get app(): Electron.App;
65
+ static get electron(): typeof ElectronModule;
66
+ private constructor();
67
+ /**
68
+ * Converts an "electron://frontend/" URL to an absolute file path.
69
+ *
70
+ * We use this protocol in production builds because our frontend must be built with absolute URLs,
71
+ * however, since we're loading everything directly from the install directory, we cannot know the
72
+ * absolute path at build time.
73
+ */
74
+ private static parseElectronUrl;
75
+ private static _openWindow;
76
+ /** The "main" BrowserWindow for this application. */
77
+ static get mainWindow(): BrowserWindow | undefined;
78
+ /**
79
+ * Gets window size and position for a window, by name, from settings file, if present.
80
+ * @note Size and position values in the settings file will be updated differently depending on platform.
81
+ * On Linux values are only updated on window "unmaximize".
82
+ * On Windows and MacOS values are also updated on window manual resize or move.
83
+ * To get consistent behavior across different platforms, use [[ElectronHost.getWindowSizeAndPositionSetting]].
84
+ * @deprecated in 3.6. Use [[ElectronHost.getWindowSizeAndPositionSetting]].
85
+ */
86
+ static getWindowSizeSetting(windowName: string): WindowSizeAndPositionProps | undefined;
87
+ /**
88
+ * Gets window size and position for a window, by name, from settings file, if present.
89
+ */
90
+ static getWindowSizeAndPositionSetting(windowName: string): WindowSizeAndPositionProps | undefined;
91
+ /** Gets "window maximized" flag for a window, by name, from settings file if present */
92
+ static getWindowMaximizedSetting(windowName: string): boolean | undefined;
93
+ /**
94
+ * Open the main Window when the app is ready.
95
+ * @param windowOptions Options for constructing the main BrowserWindow. See: https://electronjs.org/docs/api/browser-window#new-browserwindowoptions
96
+ */
97
+ static openMainWindow(windowOptions?: ElectronHostWindowOptions): Promise<void>;
98
+ static get isValid(): boolean;
99
+ /**
100
+ * Initialize the backend of an Electron app.
101
+ * This method configures the backend for all of the inter-process communication (RPC and IPC) for an
102
+ * Electron app. It should be called from your Electron main function.
103
+ * @param opts Options that control aspects of your backend.
104
+ * @note This method must only be called from the backend of an Electron app (i.e. when [ProcessDetector.isElectronAppBackend]($bentley) is `true`).
105
+ */
106
+ static startup(opts?: ElectronHostOpts): Promise<void>;
107
+ }
105
108
  //# sourceMappingURL=ElectronHost.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ElectronHost.d.ts","sourceRoot":"","sources":["../../../src/backend/ElectronHost.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,+BAA+B,EAAkB,MAAM,UAAU,CAAC;AAC/F,OAAO,KAAK,KAAK,cAAc,MAAM,UAAU,CAAC;AAKhD,OAAO,EAAE,UAAU,EAAuB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACtF,OAAO,EAA8D,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAyB1I;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,sCAAsC;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2IAA2I;IAC3I,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,aAAa,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACzC,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,OAAO,UAAU,CAAC,EAAE,CAAC;CACrC;AAED,YAAY;AACZ,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,YAAY,CAAC,EAAE,mBAAmB,CAAC;CACpC;AAED,YAAY;AACZ,MAAM,WAAW,yBAA0B,SAAQ,+BAA+B;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,CAAC,SAAS,GAAG,QAAQ,GAAG,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