@openfin/core 30.73.5 → 30.73.7

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 (158) hide show
  1. package/OpenFin.d.ts +1 -1729
  2. package/fin.d.ts +3 -4
  3. package/package.json +1 -1
  4. package/src/GlobalOpenFin.d.ts +4 -0
  5. package/src/OpenFin.d.ts +2938 -0
  6. package/src/OpenFin.js +4 -0
  7. package/src/api/application/Factory.d.ts +2 -0
  8. package/src/api/application/Factory.js +4 -3
  9. package/src/api/application/Instance.d.ts +3 -1
  10. package/src/api/application/Instance.js +1 -0
  11. package/src/api/application/index.js +7 -3
  12. package/src/api/base.d.ts +19 -15
  13. package/src/api/base.js +20 -22
  14. package/src/api/clipboard/index.d.ts +2 -0
  15. package/src/api/clipboard/index.js +1 -0
  16. package/src/api/events/application.d.ts +66 -56
  17. package/src/api/events/base.d.ts +33 -15
  18. package/src/api/events/channel.d.ts +13 -8
  19. package/src/api/events/eventAggregator.js +1 -9
  20. package/src/api/events/externalApplication.d.ts +10 -5
  21. package/src/api/events/frame.d.ts +13 -7
  22. package/src/api/events/globalHotkey.d.ts +11 -10
  23. package/src/api/events/platform.d.ts +10 -16
  24. package/src/api/events/system.d.ts +48 -18
  25. package/src/api/events/typedEventEmitter.d.ts +20 -0
  26. package/src/api/events/typedEventEmitter.js +2 -0
  27. package/src/api/events/view.d.ts +38 -54
  28. package/src/api/events/webcontents.d.ts +55 -28
  29. package/src/api/events/window.d.ts +148 -134
  30. package/src/api/external-application/Factory.d.ts +1 -0
  31. package/src/api/external-application/Instance.d.ts +2 -1
  32. package/src/api/external-application/index.js +7 -3
  33. package/src/api/fin.d.ts +3 -1
  34. package/src/api/fin.js +2 -2
  35. package/src/api/frame/Factory.d.ts +1 -0
  36. package/src/api/frame/Factory.js +2 -2
  37. package/src/api/frame/Instance.d.ts +3 -1
  38. package/src/api/frame/index.js +7 -3
  39. package/src/api/global-hotkey/index.d.ts +2 -2
  40. package/src/api/global-hotkey/index.js +6 -0
  41. package/src/api/interappbus/channel/channel.d.ts +6 -4
  42. package/src/api/interappbus/channel/channels-docs.d.ts +22 -0
  43. package/src/api/interappbus/channel/channels-docs.js +22 -0
  44. package/src/api/interappbus/channel/client.d.ts +2 -1
  45. package/src/api/interappbus/channel/client.js +24 -26
  46. package/src/api/interappbus/channel/connection-manager.d.ts +1 -0
  47. package/src/api/interappbus/channel/connection-manager.js +30 -28
  48. package/src/api/interappbus/channel/index.d.ts +6 -4
  49. package/src/api/interappbus/channel/index.js +34 -19
  50. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +3 -1
  51. package/src/api/interappbus/channel/protocols/classic/strategy.js +21 -22
  52. package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
  53. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +1 -1
  54. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +3 -1
  55. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +25 -27
  56. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -1
  57. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +3 -1
  58. package/src/api/interappbus/channel/protocols/rtc/strategy.js +29 -31
  59. package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -1
  60. package/src/api/interappbus/channel/provider.d.ts +8 -4
  61. package/src/api/interappbus/channel/provider.js +140 -139
  62. package/src/api/interappbus/index.js +1 -1
  63. package/src/api/interop/Factory.d.ts +2 -0
  64. package/src/api/interop/Factory.js +20 -2
  65. package/src/api/interop/InteropBroker.d.ts +62 -39
  66. package/src/api/interop/InteropBroker.js +114 -55
  67. package/src/api/interop/InteropClient.d.ts +9 -0
  68. package/src/api/interop/InteropClient.js +46 -40
  69. package/src/api/interop/SessionContextGroupBroker.d.ts +1 -0
  70. package/src/api/interop/SessionContextGroupClient.d.ts +1 -0
  71. package/src/api/interop/SessionContextGroupClient.js +22 -24
  72. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +9 -7
  73. package/src/api/interop/fdc3/PrivateChannelClient.js +6 -6
  74. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +1 -0
  75. package/src/api/interop/fdc3/fdc3-1.2.d.ts +14 -13
  76. package/src/api/interop/fdc3/fdc3-1.2.js +3 -14
  77. package/src/api/interop/fdc3/fdc3-2.0.d.ts +24 -21
  78. package/src/api/interop/fdc3/fdc3-2.0.js +27 -27
  79. package/src/api/interop/fdc3/fdc3.d.ts +12 -0
  80. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  81. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  82. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +53 -0
  83. package/src/api/interop/fdc3/shapes/fdc3v1.js +4 -0
  84. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +75 -0
  85. package/src/api/interop/fdc3/shapes/fdc3v2.js +2 -0
  86. package/src/api/interop/fdc3/utils.d.ts +15 -5
  87. package/src/api/interop/fdc3/utils.js +29 -11
  88. package/src/api/interop/fdc3/versions.d.ts +1 -0
  89. package/src/api/interop/fdc3/versions.js +2 -0
  90. package/src/api/interop/index.js +7 -3
  91. package/src/api/interop/utils.d.ts +2 -0
  92. package/src/api/interop/utils.js +29 -15
  93. package/src/api/me.d.ts +3 -1
  94. package/src/api/platform/Factory.d.ts +6 -0
  95. package/src/api/platform/Factory.js +14 -5
  96. package/src/api/platform/Instance.d.ts +18 -3
  97. package/src/api/platform/Instance.js +30 -13
  98. package/src/api/platform/common-utils.d.ts +2 -1
  99. package/src/api/platform/index.js +7 -3
  100. package/src/api/platform/layout/Factory.d.ts +7 -1
  101. package/src/api/platform/layout/Factory.js +22 -20
  102. package/src/api/platform/layout/Instance.d.ts +6 -4
  103. package/src/api/platform/layout/Instance.js +2 -3
  104. package/src/api/platform/layout/controllers/splitter-controller.js +1 -1
  105. package/src/api/platform/layout/controllers/tab-drag-controller.d.ts +1 -0
  106. package/src/api/platform/layout/controllers/tab-drag-controller.js +1 -1
  107. package/src/api/platform/layout/index.js +7 -3
  108. package/src/api/platform/layout/shapes.d.ts +3 -1
  109. package/src/api/platform/layout/utils/bounds-observer.d.ts +1 -1
  110. package/src/api/platform/layout/utils/bounds-observer.js +7 -5
  111. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -0
  112. package/src/api/platform/provider.d.ts +162 -0
  113. package/src/api/platform/provider.js +2 -0
  114. package/src/api/snapshot-source/Factory.d.ts +2 -0
  115. package/src/api/snapshot-source/Factory.js +2 -1
  116. package/src/api/snapshot-source/Instance.d.ts +1 -0
  117. package/src/api/snapshot-source/Instance.js +33 -35
  118. package/src/api/snapshot-source/index.js +7 -3
  119. package/src/api/snapshot-source/utils.d.ts +1 -0
  120. package/src/api/snapshot-source/utils.js +2 -1
  121. package/src/api/system/index.d.ts +76 -16
  122. package/src/api/system/index.js +127 -3
  123. package/src/api/view/Factory.d.ts +1 -0
  124. package/src/api/view/Factory.js +2 -2
  125. package/src/api/view/Instance.d.ts +17 -3
  126. package/src/api/view/Instance.js +20 -0
  127. package/src/api/view/index.js +7 -3
  128. package/src/api/webcontents/main.d.ts +20 -5
  129. package/src/api/webcontents/main.js +10 -0
  130. package/src/api/window/Factory.d.ts +1 -0
  131. package/src/api/window/Factory.js +2 -2
  132. package/src/api/window/Instance.d.ts +26 -3
  133. package/src/api/window/Instance.js +26 -1
  134. package/src/api/window/index.js +7 -3
  135. package/src/browser.d.ts +4 -4
  136. package/src/environment/browser.d.ts +3 -1
  137. package/src/environment/environment.d.ts +3 -1
  138. package/src/environment/node-env.d.ts +3 -1
  139. package/src/environment/node-env.js +2 -2
  140. package/src/environment/openfin-env.d.ts +3 -1
  141. package/src/environment/openfin-env.js +15 -17
  142. package/src/fdc3.d.ts +3 -0
  143. package/src/fdc3.js +1 -1
  144. package/src/mock.d.ts +2 -2
  145. package/src/mock.js +3 -3
  146. package/src/namespaces.d.ts +21 -0
  147. package/src/namespaces.js +24 -0
  148. package/src/shapes/WebOptions.d.ts +1 -0
  149. package/src/shapes/WindowOptions.d.ts +1 -0
  150. package/src/shapes/protocol.d.ts +34 -26
  151. package/src/transport/transport.d.ts +6 -5
  152. package/src/transport/transport.js +26 -28
  153. package/src/transport/wire.d.ts +9 -7
  154. package/src/util/http.d.ts +1 -1
  155. package/src/util/http.js +16 -11
  156. package/src/util/inaccessibleObject.d.ts +2 -0
  157. package/src/util/inaccessibleObject.js +49 -0
  158. package/src/util/normalize-config.js +5 -5
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
- }
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  const Factory_1 = require("./Factory");
14
18
  exports.default = Factory_1.default;
@@ -1,3 +1,4 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  export declare const generateId: () => string;
2
3
  export declare const wrapInTryCatch: <T>(f: (...args: any[]) => T, prefix?: string) => (...args: any[]) => T;
3
4
  export declare const wrapContextHandler: (handler: OpenFin.ContextHandler, handlerId: string) => (context: OpenFin.Context) => Promise<void>;
@@ -15,3 +16,4 @@ export declare const BROKER_ERRORS: {
15
16
  fdc3GetInfo: string;
16
17
  };
17
18
  export declare const wrapIntentHandler: (handler: OpenFin.IntentHandler, handlerId: string) => (intent: OpenFin.Intent) => Promise<void>;
19
+ export declare const generateDefaultLoggingOptions: () => OpenFin.InteropLoggingOptions;
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wrapIntentHandler = exports.BROKER_ERRORS = exports.generateOverrideWarning = exports.generateOverrideError = exports.wrapContextHandler = exports.wrapInTryCatch = exports.generateId = void 0;
4
- exports.generateId = () => `${Math.random()}${Date.now()}`;
5
- exports.wrapInTryCatch = (f, prefix) => (...args) => {
3
+ exports.generateDefaultLoggingOptions = exports.wrapIntentHandler = exports.BROKER_ERRORS = exports.generateOverrideWarning = exports.generateOverrideError = exports.wrapContextHandler = exports.wrapInTryCatch = exports.generateId = void 0;
4
+ const generateId = () => `${Math.random()}${Date.now()}`;
5
+ exports.generateId = generateId;
6
+ const wrapInTryCatch = (f, prefix) => (...args) => {
6
7
  try {
7
8
  return f(...args);
8
9
  }
@@ -10,7 +11,8 @@ exports.wrapInTryCatch = (f, prefix) => (...args) => {
10
11
  throw new Error((prefix || '') + e);
11
12
  }
12
13
  };
13
- exports.wrapContextHandler = (handler, handlerId) => {
14
+ exports.wrapInTryCatch = wrapInTryCatch;
15
+ const wrapContextHandler = (handler, handlerId) => {
14
16
  return async (context) => {
15
17
  try {
16
18
  await handler(context);
@@ -21,28 +23,31 @@ exports.wrapContextHandler = (handler, handlerId) => {
21
23
  }
22
24
  };
23
25
  };
24
- exports.generateOverrideError = (clientApi, brokerApi) => {
26
+ exports.wrapContextHandler = wrapContextHandler;
27
+ const generateOverrideError = (clientApi, brokerApi) => {
25
28
  return `You have tried to to use ${clientApi} but ${brokerApi} has not been overridden in the Interop Broker. Please override this function. Refer to our documentation for more info.`;
26
29
  };
27
- exports.generateOverrideWarning = (fdc3ClientApi, brokerApi, identity, interopClientApi) => {
30
+ exports.generateOverrideError = generateOverrideError;
31
+ const generateOverrideWarning = (fdc3ClientApi, brokerApi, identity, interopClientApi) => {
28
32
  const { uuid, name } = identity;
29
33
  const message = interopClientApi
30
34
  ? `Entity with identity: ${uuid}/${name} has called ${interopClientApi} or ${fdc3ClientApi} but ${brokerApi} has not been overridden.`
31
35
  : `Entity with identity: ${uuid}/${name} has called ${fdc3ClientApi} but ${brokerApi} has not been overridden.`;
32
36
  return message;
33
37
  };
38
+ exports.generateOverrideWarning = generateOverrideWarning;
34
39
  exports.BROKER_ERRORS = {
35
- fireIntent: exports.generateOverrideError('fireIntent', 'handleFiredIntent'),
36
- fireIntentForContext: exports.generateOverrideError('fireIntentForContext', 'handleFiredIntentForContext'),
37
- getInfoForIntent: exports.generateOverrideError('getInfoForIntent', 'handleInfoForIntent'),
38
- getInfoForIntentsByContext: exports.generateOverrideError('getInfoForIntentsByContext', 'handleInfoForIntentsByContext'),
40
+ fireIntent: (0, exports.generateOverrideError)('fireIntent', 'handleFiredIntent'),
41
+ fireIntentForContext: (0, exports.generateOverrideError)('fireIntentForContext', 'handleFiredIntentForContext'),
42
+ getInfoForIntent: (0, exports.generateOverrideError)('getInfoForIntent', 'handleInfoForIntent'),
43
+ getInfoForIntentsByContext: (0, exports.generateOverrideError)('getInfoForIntentsByContext', 'handleInfoForIntentsByContext'),
39
44
  joinSessionContextGroupWithJoinContextGroup: 'The Context Group you have tried to join is a Session Context Group. Custom Context Groups can only be defined by the Interop Broker through code or manifest configuration. Please use joinSessionContextGroup.',
40
- fdc3Open: exports.generateOverrideError('fdc3.open', 'fdc3HandleOpen'),
41
- fdc3FindInstances: exports.generateOverrideError('fdc3.findInstances', 'fdc3HandleFindInstances'),
42
- fdc3GetAppMetadata: exports.generateOverrideError('fdc3.getAppMetadata', 'fdc3HandleGetAppMetadata'),
43
- fdc3GetInfo: exports.generateOverrideError('fdc3.getInfo', 'fdc3HandleGetInfo')
45
+ fdc3Open: (0, exports.generateOverrideError)('fdc3.open', 'fdc3HandleOpen'),
46
+ fdc3FindInstances: (0, exports.generateOverrideError)('fdc3.findInstances', 'fdc3HandleFindInstances'),
47
+ fdc3GetAppMetadata: (0, exports.generateOverrideError)('fdc3.getAppMetadata', 'fdc3HandleGetAppMetadata'),
48
+ fdc3GetInfo: (0, exports.generateOverrideError)('fdc3.getInfo', 'fdc3HandleGetInfo')
44
49
  };
45
- exports.wrapIntentHandler = (handler, handlerId) => {
50
+ const wrapIntentHandler = (handler, handlerId) => {
46
51
  return async (intent) => {
47
52
  try {
48
53
  return handler(intent);
@@ -53,3 +58,12 @@ exports.wrapIntentHandler = (handler, handlerId) => {
53
58
  }
54
59
  };
55
60
  };
61
+ exports.wrapIntentHandler = wrapIntentHandler;
62
+ const generateDefaultLoggingOptions = () => {
63
+ const loggingActions = ['beforeAction', 'afterAction'];
64
+ const options = loggingActions.reduce((accumulator, loggingOption) => {
65
+ return { ...accumulator, [loggingOption]: { enabled: true } };
66
+ }, {});
67
+ return options;
68
+ };
69
+ exports.generateDefaultLoggingOptions = generateDefaultLoggingOptions;
package/src/api/me.d.ts CHANGED
@@ -1,7 +1,8 @@
1
+ import type * as OpenFin from '../OpenFin';
1
2
  import type Transport from '../transport/transport';
2
3
  import type { InteropClient } from './interop';
3
4
  export declare const environmentUnsupportedMessage = "You are not running in OpenFin.";
4
- import EntityType = OpenFin.EntityType;
5
+ declare type EntityType = OpenFin.EntityType;
5
6
  export declare type EntityTypeHelpers<T extends EntityType> = T extends 'view' ? {
6
7
  isView: true;
7
8
  isWindow: false;
@@ -36,3 +37,4 @@ export declare type Me<MeType extends EntityType> = OpenFin.EntityInfo & (MeType
36
37
  isOpenFin: boolean;
37
38
  };
38
39
  export declare function getMe<MeType extends EntityType>(wire: Transport<MeType>): Me<MeType>;
40
+ export {};
@@ -1,19 +1,23 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  import { Base } from '../base';
2
3
  import { Channel } from '../interappbus/channel/index';
3
4
  import Transport from '../../transport/transport';
4
5
  import { LayoutModule } from './layout/index';
5
6
  /**
7
+ * @PORTED
6
8
  * InitPlatformOptions interface
7
9
  * @typedef { object } InitPlatformOptions
8
10
  * @property { OverrideCallback } [overrideCallback] a callback function that can be used to extend or replace default Provider behavior.
9
11
  */
10
12
  /**
13
+ * @PORTED
11
14
  * @typedef { same | different } ProcessAffinityStrategy
12
15
  * @summary Strategy to place views that share a domain into different process affinities or the same process affinity.
13
16
  * @property { string } same views in the same domain will have the same process affinity.
14
17
  * @property { string } different views in the same domain will have different process affinities.
15
18
  */
16
19
  /**
20
+ * @PORTED
17
21
  * @typedef { object } PlatformOptions
18
22
  * @summary The options object required by {@link Platform#start Platform.start}
19
23
  * Any {@link ApplicationOptions Application option} is also a valid platform option
@@ -24,6 +28,7 @@ import { LayoutModule } from './layout/index';
24
28
  * @property {ProcessAffinityStrategy} [viewProcessAffinityStrategy] 'same' | 'different'.
25
29
  */
26
30
  /**
31
+ * @PORTED
27
32
  * @typedef { object } DefaultWindowOptions
28
33
  * @summary Default window options apply to all platform windows.
29
34
  * Any {@link Window~options Window option} is also a valid Default Window option
@@ -35,6 +40,7 @@ import { LayoutModule } from './layout/index';
35
40
  * Windows with a specified url (Custom Windows) will not be affected by this option.
36
41
  */
37
42
  /**
43
+ * @DELETED
38
44
  * Snapshot interface
39
45
  * @typedef { object } Snapshot
40
46
  * @property { WindowOption[] } windows The array of window options objects
@@ -5,17 +5,20 @@ const base_1 = require("../base");
5
5
  const index_1 = require("./layout/index");
6
6
  const Instance_1 = require("./Instance");
7
7
  /**
8
+ * @PORTED
8
9
  * InitPlatformOptions interface
9
10
  * @typedef { object } InitPlatformOptions
10
11
  * @property { OverrideCallback } [overrideCallback] a callback function that can be used to extend or replace default Provider behavior.
11
12
  */
12
13
  /**
14
+ * @PORTED
13
15
  * @typedef { same | different } ProcessAffinityStrategy
14
16
  * @summary Strategy to place views that share a domain into different process affinities or the same process affinity.
15
17
  * @property { string } same views in the same domain will have the same process affinity.
16
18
  * @property { string } different views in the same domain will have different process affinities.
17
19
  */
18
20
  /**
21
+ * @PORTED
19
22
  * @typedef { object } PlatformOptions
20
23
  * @summary The options object required by {@link Platform#start Platform.start}
21
24
  * Any {@link ApplicationOptions Application option} is also a valid platform option
@@ -26,6 +29,7 @@ const Instance_1 = require("./Instance");
26
29
  * @property {ProcessAffinityStrategy} [viewProcessAffinityStrategy] 'same' | 'different'.
27
30
  */
28
31
  /**
32
+ * @PORTED
29
33
  * @typedef { object } DefaultWindowOptions
30
34
  * @summary Default window options apply to all platform windows.
31
35
  * Any {@link Window~options Window option} is also a valid Default Window option
@@ -37,6 +41,7 @@ const Instance_1 = require("./Instance");
37
41
  * Windows with a specified url (Custom Windows) will not be affected by this option.
38
42
  */
39
43
  /**
44
+ * @DELETED
40
45
  * Snapshot interface
41
46
  * @typedef { object } Snapshot
42
47
  * @property { WindowOption[] } windows The array of window options objects
@@ -71,7 +76,7 @@ class PlatformModule extends base_1.Base {
71
76
  async init(options) {
72
77
  const overrideCallback = options === null || options === void 0 ? void 0 : options.overrideCallback;
73
78
  const interopBroker = await this.fin.Interop.init(this.fin.me.uuid, options === null || options === void 0 ? void 0 : options.interopOverride);
74
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
79
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
75
80
  // @ts-ignore debugging purposes
76
81
  window.interopBroker = interopBroker;
77
82
  return this._initializer(overrideCallback, interopBroker);
@@ -142,11 +147,13 @@ class PlatformModule extends base_1.Base {
142
147
  return new Promise(async (resolve, reject) => {
143
148
  try {
144
149
  const { uuid } = platformOptions;
145
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
150
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
146
151
  // @ts-ignore using private variable.
147
152
  const app = await this.fin.Application._create({ ...platformOptions, isPlatformController: true });
153
+ // TODO: fix typing (internal)
154
+ // @ts-expect-error
148
155
  app.once('platform-api-ready', () => resolve(this.wrapSync({ uuid })));
149
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
156
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
150
157
  // @ts-ignore using private variable.
151
158
  app._run({ uuid });
152
159
  }
@@ -171,11 +178,13 @@ class PlatformModule extends base_1.Base {
171
178
  // eslint-disable-next-line no-async-promise-executor
172
179
  return new Promise(async (resolve, reject) => {
173
180
  try {
174
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
181
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
175
182
  // @ts-ignore using private variable.
176
183
  const app = await this.fin.Application._createFromManifest(manifestUrl);
184
+ // TODO: fix typing (internal)
185
+ // @ts-expect-error
177
186
  app.once('platform-api-ready', () => resolve(this.wrapSync({ uuid: app.identity.uuid })));
178
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
187
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
179
188
  // @ts-ignore using private method without warning.
180
189
  app._run(opts);
181
190
  }
@@ -1,16 +1,17 @@
1
+ import type * as OpenFin from '../../OpenFin';
1
2
  import { View } from '../view';
2
3
  import { EmitterBase } from '../base';
3
4
  import { Channel } from '../interappbus/channel/index';
4
5
  import ChannelClient from '../interappbus/channel/client';
5
6
  import { LayoutModule } from './layout';
6
- import PlatformEvents = OpenFin.PlatformEvents;
7
7
  /** Manages the life cycle of windows and views in the application.
8
8
  *
9
- * Enables taking snapshots of itself and applying them to restore a previous configuration
9
+ * Enables taking snapshots of itself and applyi
10
+ * ng them to restore a previous configuration
10
11
  * as well as listen to <a href="tutorial-Platform.EventEmitter.html">platform events</a>.
11
12
  * @namespace
12
13
  */
13
- export declare class Platform extends EmitterBase<PlatformEvents> {
14
+ export declare class Platform extends EmitterBase<OpenFin.PlatformEvent> {
14
15
  #private;
15
16
  Layout: LayoutModule;
16
17
  private _channel;
@@ -64,6 +65,20 @@ export declare class Platform extends EmitterBase<PlatformEvents> {
64
65
  * @tutorial Platform.getSnapshot
65
66
  */
66
67
  getSnapshot(): Promise<OpenFin.Snapshot>;
68
+ /**
69
+ * **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
70
+ *
71
+ * Returns a snapshot of a single view's options in its current state.
72
+ *
73
+ * Can be used to restore a view to a previous state.
74
+ *
75
+ * @param { Identity } viewIdentity View identity
76
+ * @returns { Promise<ViewState> }
77
+ * @internal
78
+ * @experimental
79
+ * @tutorial Platform.getViewSnapshot
80
+ */
81
+ getViewSnapshot(viewIdentity: OpenFin.Identity): Promise<OpenFin.ViewState>;
67
82
  /**
68
83
  * Adds a snapshot to a running Platform.
69
84
  * Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
3
- if (!privateMap.has(receiver)) {
4
- throw new TypeError("attempted to get private field on non-instance");
5
- }
6
- return privateMap.get(receiver);
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7
6
  };
8
- var _connectToProvider;
7
+ var _Platform_connectToProvider;
9
8
  Object.defineProperty(exports, "__esModule", { value: true });
10
9
  exports.Platform = void 0;
11
10
  const base_1 = require("../base");
@@ -14,7 +13,8 @@ const validate_1 = require("../../util/validate");
14
13
  const clientMap = new Map();
15
14
  /** Manages the life cycle of windows and views in the application.
16
15
  *
17
- * Enables taking snapshots of itself and applying them to restore a previous configuration
16
+ * Enables taking snapshots of itself and applyi
17
+ * ng them to restore a previous configuration
18
18
  * as well as listen to <a href="tutorial-Platform.EventEmitter.html">platform events</a>.
19
19
  * @namespace
20
20
  */
@@ -30,14 +30,14 @@ class Platform extends base_1.EmitterBase {
30
30
  const target = identity || this.identity;
31
31
  const { uuid } = target;
32
32
  if (!clientMap.has(uuid)) {
33
- const clientPromise = __classPrivateFieldGet(this, _connectToProvider).call(this, uuid);
33
+ const clientPromise = __classPrivateFieldGet(this, _Platform_connectToProvider, "f").call(this, uuid);
34
34
  clientMap.set(uuid, clientPromise);
35
35
  }
36
36
  // we set it above
37
37
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
38
38
  return clientMap.get(uuid);
39
39
  };
40
- _connectToProvider.set(this, async (uuid) => {
40
+ _Platform_connectToProvider.set(this, async (uuid) => {
41
41
  try {
42
42
  const channelName = `custom-frame-${uuid}`;
43
43
  const client = await this._channel.connect(channelName, { wait: false });
@@ -53,7 +53,7 @@ class Platform extends base_1.EmitterBase {
53
53
  });
54
54
  // Deprecated (renamed)
55
55
  this.launchLegacyManifest = this.launchContentManifest;
56
- const errorMsg = validate_1.validateIdentity(identity);
56
+ const errorMsg = (0, validate_1.validateIdentity)(identity);
57
57
  if (errorMsg) {
58
58
  throw new Error(errorMsg);
59
59
  }
@@ -80,7 +80,7 @@ class Platform extends base_1.EmitterBase {
80
80
  opts: viewOptions,
81
81
  targetView
82
82
  });
83
- if (!response || validate_1.validateIdentity(response.identity)) {
83
+ if (!response || (0, validate_1.validateIdentity)(response.identity)) {
84
84
  throw new Error(`When overwriting the createView call, please return an object that has a valid 'identity' property: ${JSON.stringify(response)}`);
85
85
  }
86
86
  return this.fin.View.wrapSync(response.identity);
@@ -100,7 +100,7 @@ class Platform extends base_1.EmitterBase {
100
100
  options.reason = 'api-call';
101
101
  }
102
102
  const response = await client.dispatch('create-view-container', options);
103
- if (!response || validate_1.validateIdentity(response.identity)) {
103
+ if (!response || (0, validate_1.validateIdentity)(response.identity)) {
104
104
  throw new Error(`When overwriting the createWindow call, please return an object that has a valid 'identity' property: ${JSON.stringify(response)}`);
105
105
  }
106
106
  const { identity } = response;
@@ -174,6 +174,23 @@ class Platform extends base_1.EmitterBase {
174
174
  const client = await this.getClient();
175
175
  return client.dispatch('get-snapshot');
176
176
  }
177
+ /**
178
+ * **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
179
+ *
180
+ * Returns a snapshot of a single view's options in its current state.
181
+ *
182
+ * Can be used to restore a view to a previous state.
183
+ *
184
+ * @param { Identity } viewIdentity View identity
185
+ * @returns { Promise<ViewState> }
186
+ * @internal
187
+ * @experimental
188
+ * @tutorial Platform.getViewSnapshot
189
+ */
190
+ async getViewSnapshot(viewIdentity) {
191
+ const client = await this.getClient();
192
+ return client.dispatch('get-view-snapshot', { viewIdentity });
193
+ }
177
194
  /**
178
195
  * Adds a snapshot to a running Platform.
179
196
  * Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.
@@ -311,4 +328,4 @@ class Platform extends base_1.EmitterBase {
311
328
  }
312
329
  }
313
330
  exports.Platform = Platform;
314
- _connectToProvider = new WeakMap();
331
+ _Platform_connectToProvider = new WeakMap();
@@ -1,4 +1,5 @@
1
- import LayoutPresetType = OpenFin.LayoutPresetType;
1
+ import type * as OpenFin from '../../OpenFin';
2
+ declare type LayoutPresetType = OpenFin.LayoutPresetType;
2
3
  export declare function isValidPresetType(type: LayoutPresetType): type is LayoutPresetType;
3
4
  declare const _default: {
4
5
  isValidPresetType: typeof isValidPresetType;
@@ -1,14 +1,18 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
11
- }
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
17
  const Factory_1 = require("./Factory");
14
18
  exports.default = Factory_1.default;
@@ -1,13 +1,16 @@
1
+ import type * as OpenFin from '../../../OpenFin';
1
2
  import { Layout } from './Instance';
2
3
  import { Base } from '../../base';
3
- import InitLayoutOptions = OpenFin.InitLayoutOptions;
4
+ declare type InitLayoutOptions = OpenFin.InitLayoutOptions;
4
5
  /**
6
+ * @PORTED
5
7
  * InitLayoutOptions interface
6
8
  * @typedef { object } InitLayoutOptions
7
9
  * @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
8
10
  * then an element with id `layout-container` is used. We recommend using a div element.
9
11
  */
10
12
  /**
13
+ * @PORTED
11
14
  * PresetLayoutOptions interface
12
15
  * @typedef { object } PresetLayoutOptions
13
16
  * @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
@@ -22,6 +25,7 @@ import InitLayoutOptions = OpenFin.InitLayoutOptions;
22
25
  * @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
23
26
  */
24
27
  /**
28
+ * @PORTED
25
29
  * LayoutItem Interface
26
30
  * @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
27
31
  * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
@@ -33,6 +37,7 @@ import InitLayoutOptions = OpenFin.InitLayoutOptions;
33
37
  * options of a given component.
34
38
  */
35
39
  /**
40
+ * @PORTED
36
41
  * LayoutSettings Interface
37
42
  * @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
38
43
  * @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
@@ -106,3 +111,4 @@ export declare class LayoutModule extends Base {
106
111
  */
107
112
  init: (options?: InitLayoutOptions) => Promise<OpenFin.Layout>;
108
113
  }
114
+ export {};
@@ -1,18 +1,16 @@
1
1
  "use strict";
2
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
3
- if (!privateMap.has(receiver)) {
4
- throw new TypeError("attempted to get private field on non-instance");
5
- }
6
- return privateMap.get(receiver);
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
7
6
  };
8
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
9
- if (!privateMap.has(receiver)) {
10
- throw new TypeError("attempted to set private field on non-instance");
11
- }
12
- privateMap.set(receiver, value);
13
- return value;
7
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
+ if (kind === "m") throw new TypeError("Private method is not writable");
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
14
12
  };
15
- var _layoutManager;
13
+ var _LayoutModule_layoutManager;
16
14
  Object.defineProperty(exports, "__esModule", { value: true });
17
15
  exports.LayoutModule = void 0;
18
16
  /* eslint-disable no-undef, import/prefer-default-export */
@@ -22,12 +20,14 @@ const base_1 = require("../../base");
22
20
  const splitter_controller_1 = require("./controllers/splitter-controller");
23
21
  const view_overlay_1 = require("./utils/view-overlay");
24
22
  /**
23
+ * @PORTED
25
24
  * InitLayoutOptions interface
26
25
  * @typedef { object } InitLayoutOptions
27
26
  * @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
28
27
  * then an element with id `layout-container` is used. We recommend using a div element.
29
28
  */
30
29
  /**
30
+ * @PORTED
31
31
  * PresetLayoutOptions interface
32
32
  * @typedef { object } PresetLayoutOptions
33
33
  * @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
@@ -42,6 +42,7 @@ const view_overlay_1 = require("./utils/view-overlay");
42
42
  * @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
43
43
  */
44
44
  /**
45
+ * @PORTED
45
46
  * LayoutItem Interface
46
47
  * @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
47
48
  * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
@@ -53,6 +54,7 @@ const view_overlay_1 = require("./utils/view-overlay");
53
54
  * options of a given component.
54
55
  */
55
56
  /**
57
+ * @PORTED
56
58
  * LayoutSettings Interface
57
59
  * @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
58
60
  * @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
@@ -84,7 +86,7 @@ const view_overlay_1 = require("./utils/view-overlay");
84
86
  class LayoutModule extends base_1.Base {
85
87
  constructor() {
86
88
  super(...arguments);
87
- _layoutManager.set(this, void 0);
89
+ _LayoutModule_layoutManager.set(this, void 0);
88
90
  /**
89
91
  * Initialize the window's Layout. Must be called from a custom window that has a 'layout' option set upon creation of that window.
90
92
  * If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
@@ -103,7 +105,7 @@ class LayoutModule extends base_1.Base {
103
105
  if (!this.fin.me.isWindow) {
104
106
  throw new Error('Layout.init can only be called from a Window context.');
105
107
  }
106
- else if (__classPrivateFieldGet(this, _layoutManager)) {
108
+ else if (__classPrivateFieldGet(this, _LayoutModule_layoutManager, "f")) {
107
109
  throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
108
110
  }
109
111
  // We need to go through environment to make sure it is only imported/bundled in OpenFin.
@@ -111,8 +113,8 @@ class LayoutModule extends base_1.Base {
111
113
  const viewOverlay = new view_overlay_1.ViewOverlay(this.wire);
112
114
  const splitterController = new splitter_controller_1.SplitterController(viewOverlay);
113
115
  const tabDragController = new tab_drag_controller_1.TabDragController(viewOverlay);
114
- __classPrivateFieldSet(this, _layoutManager, new ManagerConstructor(splitterController, tabDragController));
115
- // eslint-disable-next-line @typescript-eslint/ban-ts-ignore
116
+ __classPrivateFieldSet(this, _LayoutModule_layoutManager, new ManagerConstructor(splitterController, tabDragController), "f");
117
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
116
118
  // @ts-ignore - layout warning here for backwards compatibility, can remove layout check in .52
117
119
  let { layout, containerId } = options;
118
120
  if (layout) {
@@ -125,10 +127,10 @@ class LayoutModule extends base_1.Base {
125
127
  // Should we error here if there is no container? Getting a typescript complaint on createLayout
126
128
  // override here
127
129
  // pull createChannelConnection out of LayoutManager and setup channel connections here using layoutmanager instance methods?
128
- await __classPrivateFieldGet(this, _layoutManager).initManager();
129
- await __classPrivateFieldGet(this, _layoutManager).createLayout(layout, container);
130
+ await __classPrivateFieldGet(this, _LayoutModule_layoutManager, "f").initManager();
131
+ await __classPrivateFieldGet(this, _LayoutModule_layoutManager, "f").createLayout(layout, container);
130
132
  // Adding this to the returned instance undocumented/typed for Browser.
131
- return Object.assign(this.getCurrentSync(), { layoutManager: __classPrivateFieldGet(this, _layoutManager) });
133
+ return Object.assign(this.getCurrentSync(), { layoutManager: __classPrivateFieldGet(this, _LayoutModule_layoutManager, "f") });
132
134
  };
133
135
  }
134
136
  /**
@@ -193,4 +195,4 @@ class LayoutModule extends base_1.Base {
193
195
  }
194
196
  }
195
197
  exports.LayoutModule = LayoutModule;
196
- _layoutManager = new WeakMap();
198
+ _LayoutModule_layoutManager = new WeakMap();
@@ -1,8 +1,9 @@
1
+ import type * as OpenFin from '../../../OpenFin';
1
2
  import Transport from '../../../transport/transport';
2
3
  import { Base } from '../../base';
3
- import Identity = OpenFin.Identity;
4
- import InitLayoutOptions = OpenFin.InitLayoutOptions;
5
- import PresetLayoutOptions = OpenFin.PresetLayoutOptions;
4
+ declare type Identity = OpenFin.Identity;
5
+ declare type InitLayoutOptions = OpenFin.InitLayoutOptions;
6
+ declare type PresetLayoutOptions = OpenFin.PresetLayoutOptions;
6
7
  /**
7
8
  * @lends Platform#Layout
8
9
  */
@@ -26,7 +27,7 @@ export declare class Layout extends Base {
26
27
  * @return { Promise<void> }
27
28
  * @tutorial Layout.replace
28
29
  */
29
- replace: (layout: any) => Promise<void>;
30
+ replace: (layout: OpenFin.LayoutOptions) => Promise<void>;
30
31
  /**
31
32
  * Replaces the specified view with a view with the provided configuration.
32
33
  * The old view is stripped of its listeners and either closed or attached to the provider window
@@ -47,3 +48,4 @@ export declare class Layout extends Base {
47
48
  */
48
49
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
49
50
  }
51
+ export {};
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable no-undef, import/prefer-default-export */
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.Layout = void 0;
5
4
  const validate_1 = require("../../../util/validate");
@@ -63,7 +62,7 @@ class Layout extends base_1.Base {
63
62
  });
64
63
  const client = await this.platform.getClient();
65
64
  const { presetType } = options;
66
- if (!presetType || !common_utils_1.isValidPresetType(presetType)) {
65
+ if (!presetType || !(0, common_utils_1.isValidPresetType)(presetType)) {
67
66
  throw new Error('Cannot apply preset layout, please include an applicable presetType property in the PresetLayoutOptions.');
68
67
  }
69
68
  await client.dispatch('apply-preset-layout', {
@@ -71,7 +70,7 @@ class Layout extends base_1.Base {
71
70
  opts: { presetType }
72
71
  });
73
72
  };
74
- const errorMsg = validate_1.validateIdentity(identity);
73
+ const errorMsg = (0, validate_1.validateIdentity)(identity);
75
74
  if (errorMsg) {
76
75
  throw new Error(errorMsg);
77
76
  }
@@ -68,7 +68,7 @@ class SplitterController {
68
68
  this.viewOverlay.renderOverlay(offsetBounds);
69
69
  };
70
70
  await this.viewOverlay.setStyle({ backgroundColor });
71
- const teardownBoundsObserver = bounds_observer_1.observeBounds(splitterDiv, onBoundsChange);
71
+ const teardownBoundsObserver = (0, bounds_observer_1.observeBounds)(splitterDiv, onBoundsChange);
72
72
  this.teardown = () => {
73
73
  teardownBoundsObserver();
74
74
  splitterDiv.style.visibility = initialVisibility;
@@ -1,3 +1,4 @@
1
+ import type * as OpenFin from '../../../../OpenFin';
1
2
  import { ViewOverlay } from '../utils/view-overlay';
2
3
  import { View } from '../../../view';
3
4
  /**