@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,653 +0,0 @@
1
- import type * as OpenFin from '../../OpenFin';
2
- import { EmitterBase } from '../base';
3
- type View = OpenFin.View;
4
- type Channel = OpenFin.Fin['InterApplicationBus']['Channel'];
5
- type ChannelClient = OpenFin.ChannelClient;
6
- type LayoutModule = OpenFin.Fin['Platform']['Layout'];
7
- /** Manages the life cycle of windows and views in the application.
8
- *
9
- * Enables taking snapshots of itself and applyi
10
- * ng them to restore a previous configuration
11
- * as well as listen to {@link OpenFin.PlatformEvents platform events}.
12
- *
13
- */
14
- export declare class Platform extends EmitterBase<OpenFin.PlatformEvent> {
15
- #private;
16
- Layout: LayoutModule;
17
- private _channel;
18
- Application: OpenFin.Application;
19
- identity: OpenFin.ApplicationIdentity;
20
- /**
21
- * @internal
22
- */
23
- constructor(identity: OpenFin.ApplicationIdentity, channel: Channel);
24
- getClient: (identity?: OpenFin.ApplicationIdentity) => Promise<ChannelClient>;
25
- /**
26
- * Creates a new view and attaches it to a specified target window.
27
- * @param viewOptions View creation options
28
- * @param target The window to which the new view is to be attached. If no target, create a view in a new window.
29
- * @param targetView If provided, the new view will be added to the same tabstrip as targetView.
30
- *
31
- * @remarks If the view already exists, will reparent the view to the new target. You do not need to set a name for a View.
32
- * Views that are not passed a name get a randomly generated one.
33
- *
34
- * @example
35
- * ```js
36
- * let windowIdentity;
37
- * if (fin.me.isWindow) {
38
- * windowIdentity = fin.me.identity;
39
- * } else if (fin.me.isView) {
40
- * windowIdentity = (await fin.me.getCurrentWindow()).identity;
41
- * } else {
42
- * throw new Error('Not running in a platform View or Window');
43
- * }
44
- *
45
- * const platform = fin.Platform.getCurrentSync();
46
- *
47
- * platform.createView({
48
- * name: 'test_view',
49
- * url: 'https://developers.openfin.co/docs/platform-api'
50
- * }, windowIdentity).then(console.log);
51
- * ```
52
- *
53
- * Reparenting a view:
54
- * ```js
55
- * let windowIdentity;
56
- * if (fin.me.isWindow) {
57
- * windowIdentity = fin.me.identity;
58
- * } else if (fin.me.isView) {
59
- * windowIdentity = (await fin.me.getCurrentWindow()).identity;
60
- * } else {
61
- * throw new Error('Not running in a platform View or Window');
62
- * }
63
- *
64
- * let platform = fin.Platform.getCurrentSync();
65
- * let viewOptions = {
66
- * name: 'example_view',
67
- * url: 'https://example.com'
68
- * };
69
- * // a new view will now show in the current window
70
- * await platform.createView(viewOptions, windowIdentity);
71
- *
72
- * const view = fin.View.wrapSync({ uuid: windowIdentity.uuid, name: 'yahoo_view' });
73
- * // reparent `example_view` when a view in the new window is shown
74
- * view.on('shown', async () => {
75
- * let viewIdentity = { uuid: windowIdentity.uuid, name: 'example_view'};
76
- * let target = {uuid: windowIdentity.uuid, name: 'test_win'};
77
- * platform.createView(viewOptions, target);
78
- * });
79
- *
80
- * // create a new window
81
- * await platform.createWindow({
82
- * name: "test_win",
83
- * layout: {
84
- * content: [
85
- * {
86
- * type: 'stack',
87
- * content: [
88
- * {
89
- * type: 'component',
90
- * componentName: 'view',
91
- * componentState: {
92
- * name: 'yahoo_view',
93
- * url: 'https://yahoo.com'
94
- * }
95
- * }
96
- * ]
97
- * }
98
- * ]
99
- * }
100
- * }).then(console.log);
101
- * ```
102
- */
103
- createView(viewOptions: OpenFin.PlatformViewCreationOptions, target?: OpenFin.CreateViewTarget, targetView?: OpenFin.Identity): Promise<View>;
104
- /**
105
- * Creates a new Window.
106
- * @param options Window creation options
107
- *
108
- * @remarks There are two Window types at your disposal while using OpenFin Platforms - Default Window and Custom Window.
109
- *
110
- * The Default Window uses the standard OpenFin Window UI. It contains the standard close, maximize and minimize buttons,
111
- * and will automatically render the Window's layout if one is specified.
112
- *
113
- * For deeper customization, you can bring your own Window code into a Platform. This is called a Custom Window.
114
- *
115
- * @example
116
- *
117
- *
118
- * The example below will create a Default Window which uses OpenFin default Window UI.<br>
119
- * The Window contains two Views in a stack Layout:
120
- *
121
- * ```js
122
- * const platform = fin.Platform.getCurrentSync();
123
- * platform.createWindow({
124
- * layout: {
125
- * content: [
126
- * {
127
- * type: 'stack',
128
- * content: [
129
- * {
130
- * type: 'component',
131
- * componentName: 'view',
132
- * componentState: {
133
- * name: 'test_view_1',
134
- * url: 'https://cdn.openfin.co/docs/javascript/canary/Platform.html'
135
- * }
136
- * },
137
- * {
138
- * type: 'component',
139
- * componentName: 'view',
140
- * componentState: {
141
- * name: 'test_view_2',
142
- * url: 'https://cdn.openfin.co/docs/javascript/canary/Platform.html'
143
- * }
144
- * }
145
- * ]
146
- * }
147
- * ]
148
- * }
149
- * }).then(console.log);
150
- * ```
151
- * The Default Window's design can be customized by specifying the `stylesheetUrl` property in the manifest:
152
- *
153
- * ```json
154
- * {
155
- * platform: {
156
- * defaultWindowOptions: {
157
- * stylesheetUrl: 'some-url.css',
158
- * ...
159
- * }
160
- * }
161
- * }
162
- * ```
163
- * For a list of common Layout CSS classes you can override in your custom stylesheet, see <a href="tutorial-layoutStyles.html">Useful Layout CSS Classes</a>
164
- **
165
- * To specify a Platform Custom Window, provide a `url` property when creating a Window.
166
- * If you intend to render a Layout in your Custom Window, you must also specify an `HTMLElement` that the Layout will inject into and set its `id` property to `"layout-container"`.
167
- *
168
- * The example below will create a Platform Custom Window:
169
- *
170
- * ```js
171
- * // in an OpenFin app:
172
- * const platform = fin.Platform.getCurrentSync();
173
- * const windowConfig =
174
- * {
175
- * url: "https://www.my-domain.com/my-custom-window.html", // here we point to where the Custom Frame is hosted.
176
- * layout: {
177
- * content: [
178
- * {
179
- * type: "stack",
180
- * content: [
181
- * {
182
- * type: "component",
183
- * componentName: "view",
184
- * componentState: {
185
- * name: "app #1",
186
- * url: "https://cdn.openfin.co/docs/javascript/canary/Platform.html"
187
- * }
188
- * },
189
- * {
190
- * type: "component",
191
- * componentName: "view",
192
- * componentState: {
193
- * name: "app #2",
194
- * url: "https://cdn.openfin.co/docs/javascript/canary/Platform.html"
195
- * }
196
- * }
197
- * ]
198
- * }
199
- * ]
200
- * }
201
- * };
202
- * platform.createWindow(windowConfig);
203
- * ```
204
- *
205
- * Here's an example of a minimalist Custom Platform Window implementation:
206
- * ```html
207
- * <html>
208
- * <head>
209
- * <meta charset="utf-8">
210
- * <meta name="viewport" content="width=device-width, initial-scale=1">
211
- * <link rel="stylesheet" type="text/css" href="./styles.css">
212
- * </head>
213
- * <body>
214
- * <div id="of-frame-main">
215
- * <div id="title-bar">
216
- * <div class="title-bar-draggable">
217
- * <div id="title"> This is a custom frame! </div>
218
- * </div>
219
- * <div id="buttons-wrapper">
220
- * <div class="button" id="minimize-button"></div>
221
- * <div class="button" id="expand-button"></div>
222
- * <div class="button" id="close-button"></div>
223
- * </div>
224
- * </div>
225
- * <div id="layout-container"></div> <!-- OpenFin layout would be injected here -->
226
- * <script src="./custom-frame.js"></script>
227
- * </div>
228
- * </body>
229
- * </html>
230
- * ```
231
- * Your Custom Window can use in-domain resources for further customization (such as CSS, scripts, etc.).<br>
232
- * For a list of common Layout CSS classes you can override in your stylesheet, see <a href="tutorial-layoutStyles.html">Useful Layout CSS Classes</a>
233
- *
234
- * The example above will require the `body` element to have `height: 100%;` set in order to render the layout correctly.
235
- */
236
- createWindow(options: OpenFin.PlatformWindowCreationOptions): Promise<OpenFin.Window & OpenFin.Identity>;
237
- /**
238
- * Closes current platform, all its windows, and their views.
239
- *
240
- * @example
241
- * ```js
242
- * const platform = await fin.Platform.getCurrent();
243
- * platform.quit();
244
- * // All windows/views in current layout platform will close and platform will shut down
245
- * ```
246
- */
247
- quit(): Promise<void>;
248
- /**
249
- * Closes a specified view in a target window.
250
- * @param viewIdentity View identity
251
- *
252
- * @example
253
- * ```js
254
- * let windowIdentity;
255
- * if (fin.me.isWindow) {
256
- * windowIdentity = fin.me.identity;
257
- * } else if (fin.me.isView) {
258
- * windowIdentity = (await fin.me.getCurrentWindow()).identity;
259
- * } else {
260
- * throw new Error('Not running in a platform View or Window');
261
- * }
262
- *
263
- * const viewOptions = {
264
- * name: 'test_view',
265
- * url: 'https://example.com'
266
- * };
267
- *
268
- * function sleep(ms) {
269
- * return new Promise(resolve => setTimeout(resolve, ms));
270
- * }
271
- *
272
- * const platform = await fin.Platform.getCurrent();
273
- *
274
- * await platform.createView(viewOptions, windowIdentity);
275
- * // a new view will now show in the current window
276
- *
277
- * await sleep(5000);
278
- *
279
- * const viewIdentity = { uuid: windowIdentity.uuid, name: 'test_view'};
280
- * platform.closeView(viewIdentity);
281
- * // the view will now close
282
- * ```
283
- */
284
- closeView(viewIdentity: OpenFin.Identity): Promise<void>;
285
- /**
286
- * ***DEPRECATED - please use Platform.createView.***
287
- * Reparents a specified view in a new target window.
288
- * @param viewIdentity View identity
289
- * @param target new owner window identity
290
- *
291
- * @tutorial Platform.createView
292
- */
293
- reparentView(viewIdentity: OpenFin.Identity, target: OpenFin.Identity): Promise<View>;
294
- /**
295
- * Returns a snapshot of the platform in its current state. You can pass the returning object to
296
- * [Platform.applySnapshot]{@link Platform#applySnapshot} to launch it.
297
- *
298
- * @remarks The snapshot will include details such as an [ISO format](https://en.wikipedia.org/wiki/ISO_8601)
299
- * timestamp of when the snapshot was taken, OpenFin runtime version the platform is running on, monitor information
300
- * and the list of currently running windows.
301
- *
302
- * @example
303
- * ```js
304
- * const platform = await fin.Platform.getCurrent();
305
- * const snapshot = await platform.getSnapshot();
306
- * ```
307
- */
308
- getSnapshot(): Promise<OpenFin.Snapshot>;
309
- /**
310
- * **NOTE**: Internal use only. It is not recommended to manage the state of individual views.
311
- *
312
- * Returns a snapshot of a single view's options in its current state.
313
- *
314
- * Can be used to restore a view to a previous state.
315
- *
316
- * @param viewIdentity View identity
317
- *
318
- * @internal
319
- * @experimental
320
- * @remarks This slice of snapshot state is equivalent to what is stored as `componentState` for views
321
- * when capturing platform state using [Platform.getSnapshot]{@link Platform#getSnapshot}.
322
- *
323
- * @example
324
- * ```js
325
- * const platform = await fin.Platform.getCurrent();
326
- * const url = 'https://google.com';
327
- * const view = await fin.View.create({ name: 'my-view', target: fin.me.identity, url });
328
- *
329
- * await view.navigate(url);
330
- *
331
- * const viewState = await platform.getViewSnapshot(view.identity);
332
- *
333
- * console.log(viewState);
334
- * ```
335
- */
336
- getViewSnapshot(viewIdentity: OpenFin.Identity): Promise<OpenFin.ViewState>;
337
- /**
338
- * Adds a snapshot to a running Platform.
339
- * Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.
340
- *
341
- * Can optionally close existing windows and overwrite current platform state with that of a snapshot.
342
- *
343
- * The function accepts either a snapshot taken using {@link Platform#getSnapshot getSnapshot},
344
- * or a url or filepath to a snapshot JSON object.
345
- * @param requestedSnapshot Snapshot to apply, or a url or filepath.
346
- * @param options Optional parameters to specify whether existing windows should be closed.
347
- *
348
- * @remarks Will create any windows and views that are not running but are passed in the snapshot object. Any View
349
- * specified in the snapshot is assigned a randomly generated name to avoid collisions.
350
- *
351
- * @example
352
- * ```js
353
- * // Get a wrapped layout platform instance
354
- * const platform = await fin.Platform.getCurrent();
355
- *
356
- * const snapshot = {
357
- * windows: [
358
- * {
359
- * layout: {
360
- * content: [
361
- * {
362
- * type: 'stack',
363
- * content: [
364
- * {
365
- * type: 'component',
366
- * componentName: 'view',
367
- * componentState: {
368
- * name: 'component_X',
369
- * url: 'https://www.openfin.co'
370
- * }
371
- * },
372
- * {
373
- * type: 'component',
374
- * componentName: 'view',
375
- * componentState: {
376
- * name: 'component_Y',
377
- * url: 'https://cdn.openfin.co/embed-web/chart.html'
378
- * }
379
- * }
380
- * ]
381
- * }
382
- * ]
383
- * }
384
- * }
385
- * ]
386
- * }
387
- *
388
- * platform.applySnapshot(snapshot);
389
- * ```
390
- *
391
- * In place of a snapshot object, `applySnapshot` can take a url or filepath and to retrieve a JSON snapshot.
392
- *
393
- * ```js
394
- * const platform = await fin.Platform.getCurrent();
395
- * platform.applySnapshot('https://api.jsonbin.io/b/5e6f903ef4331e681fc1231d/1');
396
- * ```
397
- *
398
- * Optionally, `applySnapshot` can close existing windows and restore a Platform to a previously saved state.
399
- * This is accomplished by providing `{ closeExistingWindows: true }` as an option.
400
- *
401
- * ```js
402
- * // Get a wrapped layout platform instance
403
- * const platform = await fin.Platform.getCurrent();
404
- *
405
- * async function addViewToWindow(winId) {
406
- * return await platform.createView({
407
- * name: 'test_view_3',
408
- * url: 'https://openfin.co'
409
- * }, winId);
410
- * }
411
- *
412
- * async function createWindowWithTwoViews() {
413
- * const platform = await fin.Platform.getCurrent();
414
- *
415
- * return platform.createWindow({
416
- * layout: {
417
- * content: [
418
- * {
419
- * type: 'stack',
420
- * content: [
421
- * {
422
- * type: 'component',
423
- * componentName: 'view',
424
- * componentState: {
425
- * name: 'test_view_1',
426
- * url: 'https://example.com'
427
- * }
428
- * },
429
- * {
430
- * type: 'component',
431
- * componentName: 'view',
432
- * componentState: {
433
- * name: 'test_view_2',
434
- * url: 'https://yahoo.com'
435
- * }
436
- * }
437
- * ]
438
- * }
439
- * ]
440
- * }
441
- * });
442
- * }
443
- *
444
- * const win = await createWindowWithTwoViews();
445
- * // ... you will now see a new window with two views in it
446
- *
447
- * // we take a snapshot of the current state of the app, before changing it
448
- * const snapshotOfInitialAppState = await platform.getSnapshot();
449
- *
450
- * // now let's change the state of the app:
451
- * await addViewToWindow(win.identity);
452
- * // ... the window now has three views in it
453
- *
454
- * await platform.applySnapshot(snapshotOfInitialAppState, { closeExistingWindows: true });
455
- * // ... the window will revert to previous state, with just two views
456
- *
457
- * ```
458
- */
459
- applySnapshot(requestedSnapshot: OpenFin.Snapshot | string, options?: OpenFin.ApplySnapshotOptions): Promise<Platform>;
460
- /**
461
- * Fetches a JSON manifest using the browser process and returns a Javascript object.
462
- * Can be overwritten using {@link Platform.PlatformModule.init Platform.init}.
463
- * @param manifestUrl The URL of the manifest to fetch.
464
- *
465
- * @remarks Can be overwritten using {@link Platform#init Platform.init}.
466
- *
467
- * @example
468
- *
469
- * ```js
470
- * const platform = fin.Platform.getCurrentSync();
471
- * const manifest = await platform.fetchManifest('https://www.path-to-manifest.com/app.json');
472
- * console.log(manifest);
473
- * ```
474
- */
475
- fetchManifest(manifestUrl: string): Promise<any>;
476
- /**
477
- * @deprecated (renamed)
478
- * @ignore
479
- */
480
- launchLegacyManifest: (manifestUrl: string) => Promise<Platform>;
481
- /**
482
- * Retrieves a manifest by url and launches a legacy application manifest or snapshot into the platform. Returns a promise that
483
- * resolves to the wrapped Platform.
484
- * @param manifestUrl - The URL of the manifest that will be launched into the platform. If this app manifest
485
- * contains a snapshot, that will be launched into the platform. If not, the application described in startup_app options
486
- * will be launched into the platform. The applicable startup_app options will become {@link OpenFin.ViewCreationOptions View Options}.
487
- *
488
- * @remarks If the app manifest contains a snapshot, that will be launched into the platform. If not, the
489
- * application described in startup_app options will be launched into the platform as a window with a single view.
490
- * The applicable startup_app options will become View Options.
491
- *
492
- * @example
493
- * ```js
494
- * try {
495
- * const platform = fin.Platform.getCurrentSync();
496
- * await platform.launchContentManifest('http://localhost:5555/app.json');
497
- * console.log(`content launched successfully into platform`);
498
- * } catch(e) {
499
- * console.error(e);
500
- * }
501
- * // For a local manifest file:
502
- * try {
503
- * const platform = fin.Platform.getCurrentSync();
504
- * platform.launchContentManifest('file:///C:/somefolder/app.json');
505
- * console.log(`content launched successfully into platform`);
506
- * } catch(e) {
507
- * console.error(e);
508
- * }
509
- * ```
510
- * @experimental
511
- */
512
- launchContentManifest(manifestUrl: string): Promise<Platform>;
513
- /**
514
- * Set the context of a host window. The context will be available to the window itself, and to its child Views. It will be saved in any platform snapshots.
515
- * It can be retrieved using {@link Platform#getWindowContext getWindowContext}.
516
- * @param context - A field where serializable context data can be stored to be saved in platform snapshots.
517
- * @param target - A target window or view may optionally be provided. If no target is provided, the update will be applied
518
- * to the current window (if called from a Window) or the current host window (if called from a View).
519
- *
520
- * @remarks The context data must be serializable. This can only be called from a window or view that has been launched into a
521
- * platform.
522
- * This method can be called from the window itself, or from any child view. Context data is shared by all
523
- * entities within a window.
524
- *
525
- * @example
526
- * Setting own context:
527
- * ```js
528
- * const platform = fin.Platform.getCurrentSync();
529
- * const contextData = {
530
- * security: 'STOCK',
531
- * currentView: 'detailed'
532
- * }
533
- *
534
- * await platform.setWindowContext(contextData);
535
- * // Context of current window is now set to `contextData`
536
- * ```
537
- *
538
- * Setting the context of another window or view:
539
- * ```js
540
- * const platform = fin.Platform.getCurrentSync();
541
- * const contextData = {
542
- * security: 'STOCK',
543
- * currentView: 'detailed'
544
- * }
545
- *
546
- * const windowOrViewIdentity = { uuid: fin.me.uuid, name: 'nameOfWindowOrView' };
547
- * await platform.setWindowContext(contextData, windowOrViewIdentity);
548
- * // Context of the target window or view is now set to `contextData`
549
- * ```
550
- *
551
- * A view can listen to changes to its host window's context by listening to the `host-context-changed` event.
552
- * This event will fire when a host window's context is updated or when the view is reparented to a new window:
553
- *
554
- * ```js
555
- * // From a view
556
- * const contextChangeHandler = ({ context }) => {
557
- * console.log('Host window\'s context has changed. New context data:', context);
558
- * // react to new context data here
559
- * }
560
- * await fin.me.on('host-context-changed', contextChangeHandler);
561
- *
562
- * const platform = await fin.Platform.getCurrentSync();
563
- * const contextData = {
564
- * security: 'STOCK',
565
- * currentView: 'detailed'
566
- * }
567
- * platform.setWindowContext(contextData) // contextChangeHandler will log the new context
568
- * ```
569
- *
570
- * To listen to a window's context updates, use the `context-changed` event:
571
- * ```js
572
- * // From a window
573
- * const contextChangeHandler = ({ context }) => {
574
- * console.log('This window\'s context has changed. New context data:', context);
575
- * // react to new context data here
576
- * }
577
- * await fin.me.on('context-changed', contextChangeHandler);
578
- *
579
- * const platform = await fin.Platform.getCurrentSync();
580
- * const contextData = {
581
- * security: 'STOCK',
582
- * currentView: 'detailed'
583
- * }
584
- * platform.setWindowContext(contextData) // contextChangeHandler will log the new context
585
- * ```
586
- * @experimental
587
- */
588
- setWindowContext(context?: any, target?: OpenFin.Identity): Promise<void>;
589
- /**
590
- * Get the context context of a host window that was previously set using {@link Platform#setWindowContext setWindowContext}.
591
- * The context will be saved in any platform snapshots. Returns a promise that resolves to the context.
592
- * @param target - A target window or view may optionally be provided. If no target is provided, target will be
593
- * the current window (if called from a Window) or the current host window (if called from a View).
594
- *
595
- * @remarks This method can be called from the window itself, or from any child view. Context data is shared
596
- * by all entities within a window.
597
- *
598
- * @example
599
- *
600
- * Retrieving context from current window:
601
- * ```js
602
- * const platform = fin.Platform.getCurrentSync();
603
- * const customContext = { answer: 42 };
604
- * await platform.setWindowContext(customContext);
605
- *
606
- * const myContext = await platform.getWindowContext();
607
- * console.log(myContext); // { answer: 42 }
608
- * ```
609
- *
610
- * Retrieving the context of another window or view:
611
- * ```js
612
- * const platform = fin.Platform.getCurrentSync();
613
- *
614
- * const windowOrViewIdentity = { uuid: fin.me.uuid, name: 'nameOfWindowOrView' };
615
- *
616
- * const targetWindowContext = await platform.getWindowContext(windowOrViewIdentity);
617
- * console.log(targetWindowContext); // context of target window
618
- * ```
619
- * @experimental
620
- */
621
- getWindowContext(target?: OpenFin.Identity): Promise<any>;
622
- /**
623
- * Closes a window. If enableBeforeUnload is enabled in the Platform options, any beforeunload handler set on Views will fire
624
- * This behavior can be disabled by setting skipBeforeUnload to false in the options parameter.
625
- * @param winId
626
- * @param options
627
- *
628
- * @remarks This method works by setting a `close-requested` handler on the Platform Window. If you have your own `close-requested` handler set on the Platform Window as well,
629
- * it is recommended to move that logic over to the [PlatformProvider.closeWindow]{@link PlatformProvider#closeWindow} override to ensure it runs when the Window closes.
630
- *
631
- * @example
632
- *
633
- * ```js
634
- * // Close the current Window inside a Window context
635
- * const platform = await fin.Platform.getCurrent();
636
- * platform.closeWindow(fin.me.identity);
637
- *
638
- * // Close the Window from inside a View context
639
- * const platform = await fin.Platform.getCurrent();
640
- * const parentWindow = await fin.me.getCurrentWindow();
641
- * platform.closeWindow(parentWindow.identity);
642
- *
643
- * // Close the Window and do not fire the before unload handler on Views
644
- * const platform = await fin.Platform.getCurrent();
645
- * platform.closeWindow(fin.me.identity, { skipBeforeUnload: true });
646
- * ```
647
- * @experimental
648
- */
649
- closeWindow(windowId: OpenFin.Identity, options?: {
650
- skipBeforeUnload: boolean;
651
- }): Promise<void>;
652
- }
653
- export {};