@openfin/core 33.76.36 → 33.76.38

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 (271) hide show
  1. package/OpenFin.d.ts +1 -1
  2. package/README.md +29 -4
  3. package/fin.d.ts +2 -2
  4. package/{src → out}/GlobalOpenFin.d.ts +1 -1
  5. package/out/mock-alpha.d.ts +16112 -0
  6. package/out/mock-beta.d.ts +16112 -0
  7. package/out/mock-public.d.ts +16112 -0
  8. package/out/mock.d.ts +16797 -0
  9. package/out/mock.js +17104 -0
  10. package/package.json +30 -23
  11. package/LICENSE +0 -13
  12. package/NOTICE +0 -16
  13. package/openfin-core-33.76.36.tgz +0 -0
  14. package/src/OpenFin.d.ts +0 -3091
  15. package/src/OpenFin.js +0 -2
  16. package/src/api/api-exposer/api-consumer.d.ts +0 -28
  17. package/src/api/api-exposer/api-consumer.js +0 -28
  18. package/src/api/api-exposer/api-exposer.d.ts +0 -35
  19. package/src/api/api-exposer/api-exposer.js +0 -38
  20. package/src/api/api-exposer/decorators.d.ts +0 -10
  21. package/src/api/api-exposer/decorators.js +0 -18
  22. package/src/api/api-exposer/index.d.ts +0 -4
  23. package/src/api/api-exposer/index.js +0 -20
  24. package/src/api/api-exposer/strategies/index.d.ts +0 -1
  25. package/src/api/api-exposer/strategies/index.js +0 -17
  26. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +0 -14
  27. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +0 -20
  28. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +0 -20
  29. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +0 -23
  30. package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +0 -2
  31. package/src/api/api-exposer/strategies/openfin-channels/index.js +0 -18
  32. package/src/api/application/Factory.d.ts +0 -196
  33. package/src/api/application/Factory.js +0 -278
  34. package/src/api/application/Instance.d.ts +0 -692
  35. package/src/api/application/Instance.js +0 -821
  36. package/src/api/application/index.d.ts +0 -12
  37. package/src/api/application/index.js +0 -28
  38. package/src/api/base.d.ts +0 -117
  39. package/src/api/base.js +0 -246
  40. package/src/api/clipboard/index.d.ts +0 -172
  41. package/src/api/clipboard/index.js +0 -200
  42. package/src/api/events/application.d.ts +0 -158
  43. package/src/api/events/application.js +0 -14
  44. package/src/api/events/base.d.ts +0 -42
  45. package/src/api/events/base.js +0 -2
  46. package/src/api/events/channel.d.ts +0 -35
  47. package/src/api/events/channel.js +0 -7
  48. package/src/api/events/emitterMap.d.ts +0 -11
  49. package/src/api/events/emitterMap.js +0 -35
  50. package/src/api/events/eventAggregator.d.ts +0 -5
  51. package/src/api/events/eventAggregator.js +0 -35
  52. package/src/api/events/externalApplication.d.ts +0 -24
  53. package/src/api/events/externalApplication.js +0 -7
  54. package/src/api/events/frame.d.ts +0 -35
  55. package/src/api/events/frame.js +0 -2
  56. package/src/api/events/globalHotkey.d.ts +0 -25
  57. package/src/api/events/globalHotkey.js +0 -2
  58. package/src/api/events/platform.d.ts +0 -34
  59. package/src/api/events/platform.js +0 -10
  60. package/src/api/events/system.d.ts +0 -126
  61. package/src/api/events/system.js +0 -15
  62. package/src/api/events/typedEventEmitter.d.ts +0 -20
  63. package/src/api/events/typedEventEmitter.js +0 -2
  64. package/src/api/events/view.d.ts +0 -92
  65. package/src/api/events/view.js +0 -12
  66. package/src/api/events/webcontents.d.ts +0 -277
  67. package/src/api/events/webcontents.js +0 -13
  68. package/src/api/events/window.d.ts +0 -421
  69. package/src/api/events/window.js +0 -12
  70. package/src/api/external-application/Factory.d.ts +0 -34
  71. package/src/api/external-application/Factory.js +0 -47
  72. package/src/api/external-application/Instance.d.ts +0 -110
  73. package/src/api/external-application/Instance.js +0 -117
  74. package/src/api/external-application/index.d.ts +0 -12
  75. package/src/api/external-application/index.js +0 -28
  76. package/src/api/fin.d.ts +0 -54
  77. package/src/api/fin.js +0 -45
  78. package/src/api/frame/Factory.d.ts +0 -54
  79. package/src/api/frame/Factory.js +0 -86
  80. package/src/api/frame/Instance.d.ts +0 -136
  81. package/src/api/frame/Instance.js +0 -143
  82. package/src/api/frame/index.d.ts +0 -14
  83. package/src/api/frame/index.js +0 -30
  84. package/src/api/global-hotkey/index.d.ts +0 -106
  85. package/src/api/global-hotkey/index.js +0 -132
  86. package/src/api/interappbus/channel/channel.d.ts +0 -285
  87. package/src/api/interappbus/channel/channel.js +0 -334
  88. package/src/api/interappbus/channel/channels-docs.d.ts +0 -342
  89. package/src/api/interappbus/channel/channels-docs.js +0 -401
  90. package/src/api/interappbus/channel/client.d.ts +0 -117
  91. package/src/api/interappbus/channel/client.js +0 -181
  92. package/src/api/interappbus/channel/connection-manager.d.ts +0 -29
  93. package/src/api/interappbus/channel/connection-manager.js +0 -246
  94. package/src/api/interappbus/channel/index.d.ts +0 -189
  95. package/src/api/interappbus/channel/index.js +0 -333
  96. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +0 -13
  97. package/src/api/interappbus/channel/protocols/classic/message-receiver.js +0 -73
  98. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +0 -24
  99. package/src/api/interappbus/channel/protocols/classic/strategy.js +0 -101
  100. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +0 -20
  101. package/src/api/interappbus/channel/protocols/combined/strategy.js +0 -58
  102. package/src/api/interappbus/channel/protocols/index.d.ts +0 -47
  103. package/src/api/interappbus/channel/protocols/index.js +0 -2
  104. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +0 -10
  105. package/src/api/interappbus/channel/protocols/protocol-manager.js +0 -43
  106. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +0 -25
  107. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +0 -141
  108. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +0 -30
  109. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +0 -130
  110. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +0 -24
  111. package/src/api/interappbus/channel/protocols/rtc/strategy.js +0 -85
  112. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +0 -13
  113. package/src/api/interappbus/channel/protocols/strategy-types.js +0 -2
  114. package/src/api/interappbus/channel/protocols/strategy.d.ts +0 -17
  115. package/src/api/interappbus/channel/protocols/strategy.js +0 -2
  116. package/src/api/interappbus/channel/provider.d.ts +0 -206
  117. package/src/api/interappbus/channel/provider.js +0 -338
  118. package/src/api/interappbus/index.d.ts +0 -120
  119. package/src/api/interappbus/index.js +0 -210
  120. package/src/api/interop/Factory.d.ts +0 -57
  121. package/src/api/interop/Factory.js +0 -96
  122. package/src/api/interop/InteropBroker.d.ts +0 -665
  123. package/src/api/interop/InteropBroker.js +0 -1313
  124. package/src/api/interop/InteropClient.d.ts +0 -502
  125. package/src/api/interop/InteropClient.js +0 -683
  126. package/src/api/interop/SessionContextGroupBroker.d.ts +0 -27
  127. package/src/api/interop/SessionContextGroupBroker.js +0 -108
  128. package/src/api/interop/SessionContextGroupClient.d.ts +0 -21
  129. package/src/api/interop/SessionContextGroupClient.js +0 -86
  130. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +0 -20
  131. package/src/api/interop/fdc3/PrivateChannelClient.js +0 -90
  132. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +0 -55
  133. package/src/api/interop/fdc3/PrivateChannelProvider.js +0 -276
  134. package/src/api/interop/fdc3/documentationStub.d.ts +0 -14
  135. package/src/api/interop/fdc3/documentationStub.js +0 -17
  136. package/src/api/interop/fdc3/fdc3-1.2.d.ts +0 -205
  137. package/src/api/interop/fdc3/fdc3-1.2.js +0 -435
  138. package/src/api/interop/fdc3/fdc3-2.0.d.ts +0 -298
  139. package/src/api/interop/fdc3/fdc3-2.0.js +0 -479
  140. package/src/api/interop/fdc3/fdc3.d.ts +0 -12
  141. package/src/api/interop/fdc3/fdc3.js +0 -35
  142. package/src/api/interop/fdc3/overrideCheck.d.ts +0 -4
  143. package/src/api/interop/fdc3/overrideCheck.js +0 -32
  144. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +0 -53
  145. package/src/api/interop/fdc3/shapes/fdc3v1.js +0 -4
  146. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +0 -75
  147. package/src/api/interop/fdc3/shapes/fdc3v2.js +0 -2
  148. package/src/api/interop/fdc3/utils.d.ts +0 -45
  149. package/src/api/interop/fdc3/utils.js +0 -239
  150. package/src/api/interop/fdc3/versions.d.ts +0 -1
  151. package/src/api/interop/fdc3/versions.js +0 -2
  152. package/src/api/interop/index.d.ts +0 -12
  153. package/src/api/interop/index.js +0 -28
  154. package/src/api/interop/utils.d.ts +0 -18
  155. package/src/api/interop/utils.js +0 -61
  156. package/src/api/me.d.ts +0 -40
  157. package/src/api/me.js +0 -134
  158. package/src/api/platform/Factory.d.ts +0 -171
  159. package/src/api/platform/Factory.js +0 -240
  160. package/src/api/platform/Instance.d.ts +0 -653
  161. package/src/api/platform/Instance.js +0 -834
  162. package/src/api/platform/common-utils.d.ts +0 -7
  163. package/src/api/platform/common-utils.js +0 -16
  164. package/src/api/platform/index.d.ts +0 -12
  165. package/src/api/platform/index.js +0 -28
  166. package/src/api/platform/layout/Factory.d.ts +0 -91
  167. package/src/api/platform/layout/Factory.js +0 -151
  168. package/src/api/platform/layout/Instance.d.ts +0 -192
  169. package/src/api/platform/layout/Instance.js +0 -224
  170. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +0 -9
  171. package/src/api/platform/layout/controllers/layout-content-cache.js +0 -54
  172. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +0 -119
  173. package/src/api/platform/layout/controllers/layout-entities-controller.js +0 -287
  174. package/src/api/platform/layout/entities/layout-entities.d.ts +0 -427
  175. package/src/api/platform/layout/entities/layout-entities.js +0 -504
  176. package/src/api/platform/layout/entities/shapes.d.ts +0 -6
  177. package/src/api/platform/layout/entities/shapes.js +0 -2
  178. package/src/api/platform/layout/index.d.ts +0 -11
  179. package/src/api/platform/layout/index.js +0 -27
  180. package/src/api/platform/layout/layout.constants.d.ts +0 -1
  181. package/src/api/platform/layout/layout.constants.js +0 -4
  182. package/src/api/platform/layout/shapes.d.ts +0 -16
  183. package/src/api/platform/layout/shapes.js +0 -2
  184. package/src/api/platform/layout/utils/layout-traversal.d.ts +0 -4
  185. package/src/api/platform/layout/utils/layout-traversal.js +0 -65
  186. package/src/api/platform/provider.d.ts +0 -510
  187. package/src/api/platform/provider.js +0 -2
  188. package/src/api/snapshot-source/Factory.d.ts +0 -53
  189. package/src/api/snapshot-source/Factory.js +0 -81
  190. package/src/api/snapshot-source/Instance.d.ts +0 -53
  191. package/src/api/snapshot-source/Instance.js +0 -154
  192. package/src/api/snapshot-source/index.d.ts +0 -12
  193. package/src/api/snapshot-source/index.js +0 -28
  194. package/src/api/snapshot-source/utils.d.ts +0 -2
  195. package/src/api/snapshot-source/utils.js +0 -6
  196. package/src/api/system/index.d.ts +0 -1468
  197. package/src/api/system/index.js +0 -1851
  198. package/src/api/view/Factory.d.ts +0 -88
  199. package/src/api/view/Factory.js +0 -141
  200. package/src/api/view/Instance.d.ts +0 -601
  201. package/src/api/view/Instance.js +0 -671
  202. package/src/api/view/index.d.ts +0 -12
  203. package/src/api/view/index.js +0 -28
  204. package/src/api/webcontents/main.d.ts +0 -922
  205. package/src/api/webcontents/main.js +0 -1046
  206. package/src/api/window/Factory.d.ts +0 -96
  207. package/src/api/window/Factory.js +0 -142
  208. package/src/api/window/Instance.d.ts +0 -1598
  209. package/src/api/window/Instance.js +0 -1851
  210. package/src/api/window/index.d.ts +0 -14
  211. package/src/api/window/index.js +0 -30
  212. package/src/browser.d.ts +0 -10
  213. package/src/browser.js +0 -36
  214. package/src/environment/browser.d.ts +0 -29
  215. package/src/environment/browser.js +0 -60
  216. package/src/environment/environment.d.ts +0 -33
  217. package/src/environment/environment.js +0 -4
  218. package/src/environment/mockEnvironment.d.ts +0 -27
  219. package/src/environment/mockEnvironment.js +0 -61
  220. package/src/environment/node-env.d.ts +0 -29
  221. package/src/environment/node-env.js +0 -72
  222. package/src/fdc3.d.ts +0 -3
  223. package/src/fdc3.js +0 -9
  224. package/src/mock.d.ts +0 -3
  225. package/src/mock.js +0 -18
  226. package/src/namespaces.d.ts +0 -22
  227. package/src/namespaces.js +0 -26
  228. package/src/shapes/ERROR_BOX_TYPES.d.ts +0 -1
  229. package/src/shapes/ERROR_BOX_TYPES.js +0 -2
  230. package/src/shapes/WebOptions.d.ts +0 -13
  231. package/src/shapes/WebOptions.js +0 -2
  232. package/src/shapes/WindowOptions.d.ts +0 -43
  233. package/src/shapes/WindowOptions.js +0 -2
  234. package/src/shapes/protocol.d.ts +0 -204
  235. package/src/shapes/protocol.js +0 -2
  236. package/src/transport/mockWire.d.ts +0 -11
  237. package/src/transport/mockWire.js +0 -26
  238. package/src/transport/transport-errors.d.ts +0 -31
  239. package/src/transport/transport-errors.js +0 -79
  240. package/src/transport/transport.d.ts +0 -73
  241. package/src/transport/transport.js +0 -219
  242. package/src/transport/wire.d.ts +0 -77
  243. package/src/transport/wire.js +0 -36
  244. package/src/util/asyncFilter.d.ts +0 -1
  245. package/src/util/asyncFilter.js +0 -7
  246. package/src/util/channel-api-relay.d.ts +0 -13
  247. package/src/util/channel-api-relay.js +0 -47
  248. package/src/util/errors.d.ts +0 -10
  249. package/src/util/errors.js +0 -12
  250. package/src/util/exhaustive.d.ts +0 -1
  251. package/src/util/exhaustive.js +0 -7
  252. package/src/util/http.d.ts +0 -11
  253. package/src/util/http.js +0 -90
  254. package/src/util/inaccessibleObject.d.ts +0 -2
  255. package/src/util/inaccessibleObject.js +0 -49
  256. package/src/util/lazy.d.ts +0 -34
  257. package/src/util/lazy.js +0 -54
  258. package/src/util/normalize-config.d.ts +0 -3
  259. package/src/util/normalize-config.js +0 -52
  260. package/src/util/promises.d.ts +0 -5
  261. package/src/util/promises.js +0 -27
  262. package/src/util/ref-counter.d.ts +0 -7
  263. package/src/util/ref-counter.js +0 -52
  264. package/src/util/reversible-map.d.ts +0 -11
  265. package/src/util/reversible-map.js +0 -49
  266. package/src/util/runtimeVersioning.d.ts +0 -3
  267. package/src/util/runtimeVersioning.js +0 -25
  268. package/src/util/utilTypes.d.ts +0 -8
  269. package/src/util/utilTypes.js +0 -2
  270. package/src/util/validate.d.ts +0 -3
  271. package/src/util/validate.js +0 -11
@@ -1,224 +0,0 @@
1
- "use strict";
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);
6
- };
7
- var _Layout_layoutClient;
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.Layout = void 0;
10
- const lazy_1 = require("../../../util/lazy");
11
- const validate_1 = require("../../../util/validate");
12
- const base_1 = require("../../base");
13
- const common_utils_1 = require("../common-utils");
14
- const layout_entities_1 = require("./entities/layout-entities");
15
- const layout_constants_1 = require("./layout.constants");
16
- class Layout extends base_1.Base {
17
- /**
18
- * @internal
19
- */
20
- // eslint-disable-next-line no-shadow
21
- constructor(identity, wire) {
22
- super(wire);
23
- /**
24
- * @internal
25
- * Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
26
- * The client is for {@link LayoutEntitiesController}
27
- */
28
- _Layout_layoutClient.set(this, new lazy_1.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1.LAYOUT_CONTROLLER_ID, this.identity)));
29
- /**
30
- * Replaces a Platform window's layout with a new layout.
31
- *
32
- * @remarks Any views that were in the old layout but not the new layout will be destroyed. Views will be assigned a randomly generated name to avoid collisions.
33
- * @example
34
- * ```js
35
- * let windowIdentity;
36
- * if (fin.me.isWindow) {
37
- * windowIdentity = fin.me.identity;
38
- * } else if (fin.me.isView) {
39
- * windowIdentity = (await fin.me.getCurrentWindow()).identity;
40
- * } else {
41
- * throw new Error('Not running in a platform View or Window');
42
- * }
43
- *
44
- * const layout = fin.Platform.Layout.wrapSync(windowIdentity);
45
- *
46
- * const newLayout = {
47
- * content: [
48
- * {
49
- * type: 'stack',
50
- * content: [
51
- * {
52
- * type: 'component',
53
- * componentName: 'view',
54
- * componentState: {
55
- * name: 'new_component_A1',
56
- * processAffinity: 'ps_1',
57
- * url: 'https://www.example.com'
58
- * }
59
- * },
60
- * {
61
- * type: 'component',
62
- * componentName: 'view',
63
- * componentState: {
64
- * name: 'new_component_A2',
65
- * url: 'https://cdn.openfin.co/embed-web/chart.html'
66
- * }
67
- * }
68
- * ]
69
- * }
70
- * ]
71
- * };
72
- *
73
- * layout.replace(newLayout);
74
- * ```
75
- */
76
- this.replace = async (layout) => {
77
- this.wire.sendAction('layout-replace').catch((e) => {
78
- // don't expose
79
- });
80
- const client = await this.platform.getClient();
81
- await client.dispatch('replace-layout', {
82
- target: this.identity,
83
- opts: { layout }
84
- });
85
- };
86
- /**
87
- * Replaces the specified view with a view with the provided configuration.
88
- *
89
- * @remarks The old view is stripped of its listeners and either closed or attached to the provider window
90
- * depending on `detachOnClose` view option.
91
- *
92
- * @param viewToReplace Identity of the view to be replaced
93
- * @param newView Creation options of the new view.
94
- *
95
- * @example
96
- * ```js
97
- * let currentWindow;
98
- * if (fin.me.isWindow) {
99
- * currentWindow = fin.me;
100
- * } else if (fin.me.isView) {
101
- * currentWindow = await fin.me.getCurrentWindow();
102
- * } else {
103
- * throw new Error('Not running in a platform View or Window');
104
- * }
105
- *
106
- * const layout = fin.Platform.Layout.wrapSync(currentWindow.identity);
107
- * const viewToReplace = (await currentWindow.getCurrentViews())[0];
108
- * const newViewConfig = {url: 'https://example.com'};
109
- * await layout.replaceView(viewToReplace.identity, newViewConfig);
110
- * ```
111
- */
112
- this.replaceView = async (viewToReplace, newView) => {
113
- this.wire.sendAction('layout-replace-view').catch((e) => {
114
- // don't expose
115
- });
116
- const client = await this.platform.getClient();
117
- await client.dispatch('replace-view', {
118
- target: this.identity,
119
- opts: { viewToReplace, newView }
120
- });
121
- };
122
- /**
123
- * Replaces a Platform window's layout with a preset layout arrangement using the existing Views attached to the window.
124
- * The preset options are `columns`, `grid`, `rows`, and `tabs`.
125
- * @param options Mandatory object with `presetType` property that sets which preset layout arrangement to use.
126
- * The preset options are `columns`, `grid`, `rows`, and `tabs`.
127
- *
128
- * @example
129
- * ```js
130
- * let windowIdentity;
131
- * if (fin.me.isWindow) {
132
- * windowIdentity = fin.me.identity;
133
- * } else if (fin.me.isView) {
134
- * windowIdentity = (await fin.me.getCurrentWindow()).identity;
135
- * } else {
136
- * throw new Error('Not running in a platform View or Window');
137
- * }
138
- *
139
- * const layout = fin.Platform.Layout.wrapSync(windowIdentity);
140
- * await layout.applyPreset({ presetType: 'grid' });
141
- *
142
- * // wait 5 seconds until you change the layout from grid to tabs
143
- * await new Promise (res => setTimeout(res, 5000));
144
- * await layout.applyPreset({ presetType: 'tabs' });
145
- * ```
146
- */
147
- this.applyPreset = async (options) => {
148
- this.wire.sendAction('layout-apply-preset').catch((e) => {
149
- // don't expose
150
- });
151
- const client = await this.platform.getClient();
152
- const { presetType } = options;
153
- if (!presetType || !(0, common_utils_1.isValidPresetType)(presetType)) {
154
- throw new Error('Cannot apply preset layout, please include an applicable presetType property in the PresetLayoutOptions.');
155
- }
156
- await client.dispatch('apply-preset-layout', {
157
- target: this.identity,
158
- opts: { presetType }
159
- });
160
- };
161
- const errorMsg = (0, validate_1.validateIdentity)(identity);
162
- if (errorMsg) {
163
- throw new Error(errorMsg);
164
- }
165
- this.identity = identity;
166
- this.platform = this.fin.Platform.wrapSync({ uuid: identity.uuid });
167
- if (identity.uuid === this.fin.me.uuid && identity.name === this.fin.me.name) {
168
- this.init = this.fin.Platform.Layout.init;
169
- }
170
- }
171
- /**
172
- * Returns the configuration of the window's layout. Returns the same information that is returned for all windows in getSnapshot.
173
- *
174
- * @remarks Cannot be called from a View.
175
- *
176
- *
177
- * @example
178
- * ```js
179
- * const layout = fin.Platform.Layout.getCurrentSync();
180
- * // Use wrapped instance to get the layout configuration of the current window's Layout:
181
- * const layoutConfig = await layout.getConfig();
182
- * ```
183
- */
184
- async getConfig() {
185
- this.wire.sendAction('layout-get-config').catch((e) => {
186
- // don't expose
187
- });
188
- const client = await this.platform.getClient();
189
- return client.dispatch('get-frame-snapshot', {
190
- target: this.identity
191
- });
192
- }
193
- /**
194
- * Retrieves the top level content item of the layout.
195
- *
196
- * @remarks Cannot be called from a view.
197
- *
198
- *
199
- *
200
- * @example
201
- * ```js
202
- * if (!fin.me.isWindow) {
203
- * throw new Error('Not running in a platform View.');
204
- * }
205
- *
206
- * // From the layout window
207
- * const layout = fin.Platform.Layout.getCurrentSync();
208
- * // Retrieves the ColumnOrRow instance
209
- * const rootItem = await layout.getRootItem();
210
- * const content = await rootItem.getContent();
211
- * console.log(`The root ColumnOrRow instance has ${content.length} item(s)`);
212
- * ```
213
- */
214
- async getRootItem() {
215
- this.wire.sendAction('layout-get-root-item').catch(() => {
216
- // don't expose
217
- });
218
- const client = await __classPrivateFieldGet(this, _Layout_layoutClient, "f").getValue();
219
- const root = await client.getRoot();
220
- return layout_entities_1.LayoutNode.getEntity(root, client);
221
- }
222
- }
223
- exports.Layout = Layout;
224
- _Layout_layoutClient = new WeakMap();
@@ -1,9 +0,0 @@
1
- export declare class LayoutContentCache {
2
- private contentItemCache;
3
- private contentItemCacheId;
4
- private createCacheKey;
5
- hasKey: (id: string) => boolean;
6
- getItemOrUndefined: (id: string) => GoldenLayout.ContentItem | undefined;
7
- getContentItemOrThrow: (id: string, expectedType?: string[]) => GoldenLayout.ContentItem;
8
- getOrCreateEntityId: (contentItem: GoldenLayout.ContentItem) => string;
9
- }
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LayoutContentCache = void 0;
4
- const reversible_map_1 = require("../../../../util/reversible-map");
5
- class LayoutContentCache {
6
- constructor() {
7
- // ContentItems currently do not have a unique id, this helps us to lookup items by value
8
- this.contentItemCache = new reversible_map_1.ReversibleMap();
9
- this.contentItemCacheId = 0;
10
- this.createCacheKey = () => {
11
- const key = `entity-${this.contentItemCacheId.toString()}`;
12
- this.contentItemCacheId += 1;
13
- return key;
14
- };
15
- this.hasKey = (id) => {
16
- return this.contentItemCache.hasKey(id);
17
- };
18
- this.getItemOrUndefined = (id) => {
19
- try {
20
- return this.getContentItemOrThrow(id);
21
- }
22
- catch (error) {
23
- return undefined;
24
- }
25
- };
26
- this.getContentItemOrThrow = (id, expectedType) => {
27
- if (!this.contentItemCache.hasKey(id)) {
28
- throw new Error('Layout component has been destroyed or detached from the current layout.');
29
- }
30
- const contentItem = this.contentItemCache.getValue(id);
31
- if (expectedType && !expectedType.includes(contentItem.type)) {
32
- throw new Error(`Layout item is not the expected type. Expected ${expectedType.join(', ')}, got ${contentItem.type}.`);
33
- }
34
- return contentItem;
35
- };
36
- this.getOrCreateEntityId = (contentItem) => {
37
- if (this.contentItemCache.hasValue(contentItem)) {
38
- return this.contentItemCache.getKey(contentItem);
39
- }
40
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
41
- const onItemDestroyed = ({ origin, ...rest }) => {
42
- if (origin === contentItem) {
43
- this.contentItemCache.deleteValue(contentItem);
44
- contentItem.unbind('itemDestroyed', onItemDestroyed);
45
- }
46
- };
47
- contentItem.on('itemDestroyed', onItemDestroyed);
48
- const key = this.createCacheKey();
49
- this.contentItemCache.setUnique(key, contentItem);
50
- return key;
51
- };
52
- }
53
- }
54
- exports.LayoutContentCache = LayoutContentCache;
@@ -1,119 +0,0 @@
1
- import type * as OpenFin from '../../../../OpenFin';
2
- import type { LayoutContentCache } from './layout-content-cache';
3
- type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
4
- /**
5
- * @internal
6
- * Controller for the layout entities apis, allowing alterations to be applied
7
- * to an instance of layout manager in a structured manner.
8
- */
9
- export declare class LayoutEntitiesController {
10
- private layoutManager;
11
- private layoutContentCache;
12
- private wire;
13
- constructor(layoutManager: any, layoutContentCache: LayoutContentCache);
14
- private analytics;
15
- /**
16
- * @internal
17
- * @returns the root contentItem of the layout.
18
- */
19
- getRoot: () => OpenFin.LayoutEntityDefinition;
20
- /**
21
- * @internal
22
- * Retrieves the containing stack of a given view identity.
23
- * @param view Identity of the view to retrieve the stack of.
24
- * @returns Stack containing the given view.
25
- * @throws If the view does not belong to a stack within the layout manager.
26
- */
27
- getStackByView: (view: OpenFin.Identity) => Promise<OpenFin.LayoutEntityDefinition | undefined>;
28
- /**
29
- * @internal
30
- * Returns all views belonging to a given stack
31
- *
32
- * NOTE: Due to (TODO: ticket) Golden Layouts has an issue which changes the order of tabs
33
- * when the amount of new views to add overflows the width of the container. This results
34
- * in tabs being re-ordered in the UI, while the underlying content item array remains in the
35
- * original order specified. So calling getStackViews() will return this underlying array order,
36
- * with indexes that will not match up to the render-order of the tabs.
37
- *
38
- * @param id - Entity id of the stack.
39
- * @returns A list of view identities in order of appearance.
40
- * @throws if the content item associated with the entity id does not exist or is not a stack.
41
- */
42
- getStackViews: (id: string) => OpenFin.Identity[];
43
- /**
44
- * @internal
45
- * Retrieves the content of a column or row and adds each to the
46
- * entity cache to allow them to be addressed externally.
47
- * @param id Entity id of the Column Or Row to retrieve the content of.
48
- * @returns Array of layout entity definitions
49
- * @throws if the entity associated with {@link id} is not in the entity cache, does not belogn to a layout, or is not a column/row.
50
- */
51
- getContent(id: string): OpenFin.LayoutEntityDefinition[];
52
- /**
53
- * @internal
54
- * Retrieves the parent content item of the given entity, and adds it to the entity cache
55
- * so it can be addressed externally.
56
- * @param id Entity id associated with a layout content item.
57
- * @returns An entity definition for the given entity's parent, or undefined if the entity is the top level
58
- * content item or has been removed from the layout entirely.
59
- */
60
- getParent(id: string): OpenFin.LayoutEntityDefinition | undefined;
61
- /**
62
- * @internal
63
- * @param id Entity id associated with a layout content item.
64
- * @returns true if the given entity is the root content item, false otherwise.
65
- */
66
- isRoot: (id: string) => boolean;
67
- /**
68
- * @internal
69
- * Checks whether the given entity exists.
70
- * @param entityId Id of a content item within the layout
71
- * @returns True if the content item exists and belongs to the layout.
72
- */
73
- exists: (entityId: string) => boolean;
74
- /**
75
- * @internal
76
- * Adds an existing view to the stack, or creates and adds a view to the given stack.
77
- *
78
- * NOTE: Due to (TODO: ticket) Golden Layouts has an issue which changes the order of tabs
79
- * when the amount of new views to add overflows the width of the container. This results
80
- * in tabs being re-ordered in the UI, while the underlying content item array remains in the
81
- * original order specified. So calling getStackViews() will return this underlying array order,
82
- * with indexes that will not match up to the render-order of the tabs.
83
- *
84
- * @param stackEntityId Entity id of the stack content item within the layout.
85
- * @param viewCreationOrReference View identity or creation options
86
- * @param options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
87
- * @returns Promise resolving with the identity of the newly added view.
88
- * @throws If the view does not exist, fails to create, or the stack does not exist.
89
- */
90
- addViewToStack: (stackEntityId: string, viewCreationOrReference: ViewCreationOrReference, { index }?: OpenFin.AddViewToStackOptions) => Promise<OpenFin.Identity>;
91
- private findViewInStack;
92
- /**
93
- * @internal
94
- * Removes a view from the given stack. If it's the only view, the stack will be destroyed, unless window creation
95
- * option closeOnLastViewRemoved is set to false.
96
- *
97
- * @param stackEntityId Entity id of a stack content item to remove the view from.
98
- * @param view Identity of the view to remove.
99
- * @throws If the stack does not exist or the view does not exist or belong to the stack.
100
- */
101
- removeViewFromStack: (stackEntityId: string, view: OpenFin.Identity) => Promise<void>;
102
- /**
103
- * @internal
104
- * Creates a new adjacent 'stack' and adds the views to it at the specified position
105
- * @param targetId Entity id of the content item to add a stack adjacent to it
106
- * @param views List of identities or view creation options of the views to include in the stack
107
- * @param options Creation options, defaults to { position: 'right' }
108
- * @returns the Entity Id of the new stack
109
- */
110
- createAdjacentStack: (targetId: string, views: ViewCreationOrReference[], { position }?: {
111
- position?: OpenFin.LayoutPosition;
112
- }) => Promise<string>;
113
- getAdjacentStacks: ({ targetId, edge }: {
114
- targetId: string;
115
- edge: OpenFin.LayoutPosition;
116
- }) => Promise<Pick<OpenFin.LayoutEntityDefinition, 'entityId'>[]>;
117
- setStackActiveView: (stackEntityId: string, viewIdentity: OpenFin.Identity) => Promise<void>;
118
- }
119
- export {};