@openfin/core 25.68.26

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 (227) hide show
  1. package/LICENSE +13 -0
  2. package/NOTICE +16 -0
  3. package/OpenFin.d.ts +1340 -0
  4. package/README.md +41 -0
  5. package/docs.README(OLD).md +82 -0
  6. package/fin.d.ts +4 -0
  7. package/package.json +33 -0
  8. package/resources/win/OpenFinRVM.exe +0 -0
  9. package/src/api/application/Factory.d.ts +145 -0
  10. package/src/api/application/Factory.js +229 -0
  11. package/src/api/application/Instance.d.ts +302 -0
  12. package/src/api/application/Instance.js +412 -0
  13. package/src/api/application/index.d.ts +3 -0
  14. package/src/api/application/index.js +15 -0
  15. package/src/api/base.d.ts +43 -0
  16. package/src/api/base.js +177 -0
  17. package/src/api/clipboard/index.d.ts +69 -0
  18. package/src/api/clipboard/index.js +88 -0
  19. package/src/api/events/application.d.ts +69 -0
  20. package/src/api/events/application.js +2 -0
  21. package/src/api/events/base.d.ts +17 -0
  22. package/src/api/events/base.js +2 -0
  23. package/src/api/events/channel.d.ts +10 -0
  24. package/src/api/events/channel.js +2 -0
  25. package/src/api/events/emitterMap.d.ts +11 -0
  26. package/src/api/events/emitterMap.js +35 -0
  27. package/src/api/events/eventAggregator.d.ts +5 -0
  28. package/src/api/events/eventAggregator.js +43 -0
  29. package/src/api/events/externalApplication.d.ts +5 -0
  30. package/src/api/events/externalApplication.js +2 -0
  31. package/src/api/events/frame.d.ts +9 -0
  32. package/src/api/events/frame.js +2 -0
  33. package/src/api/events/globalHotkey.d.ts +10 -0
  34. package/src/api/events/globalHotkey.js +2 -0
  35. package/src/api/events/platform.d.ts +18 -0
  36. package/src/api/events/platform.js +2 -0
  37. package/src/api/events/system.d.ts +22 -0
  38. package/src/api/events/system.js +2 -0
  39. package/src/api/events/view.d.ts +56 -0
  40. package/src/api/events/view.js +2 -0
  41. package/src/api/events/webcontents.d.ts +48 -0
  42. package/src/api/events/webcontents.js +2 -0
  43. package/src/api/events/window.d.ts +169 -0
  44. package/src/api/events/window.js +2 -0
  45. package/src/api/external-application/Factory.d.ts +26 -0
  46. package/src/api/external-application/Factory.js +40 -0
  47. package/src/api/external-application/Instance.d.ts +102 -0
  48. package/src/api/external-application/Instance.js +109 -0
  49. package/src/api/external-application/index.d.ts +3 -0
  50. package/src/api/external-application/index.js +15 -0
  51. package/src/api/fin.d.ts +49 -0
  52. package/src/api/fin.js +43 -0
  53. package/src/api/frame/Factory.d.ts +36 -0
  54. package/src/api/frame/Factory.js +69 -0
  55. package/src/api/frame/Instance.d.ts +121 -0
  56. package/src/api/frame/Instance.js +130 -0
  57. package/src/api/frame/index.d.ts +3 -0
  58. package/src/api/frame/index.js +15 -0
  59. package/src/api/global-hotkey/index.d.ts +38 -0
  60. package/src/api/global-hotkey/index.js +58 -0
  61. package/src/api/interappbus/channel/channel.d.ts +26 -0
  62. package/src/api/interappbus/channel/channel.js +77 -0
  63. package/src/api/interappbus/channel/channels-docs.d.ts +318 -0
  64. package/src/api/interappbus/channel/channels-docs.js +376 -0
  65. package/src/api/interappbus/channel/client.d.ts +22 -0
  66. package/src/api/interappbus/channel/client.js +84 -0
  67. package/src/api/interappbus/channel/connection-manager.d.ts +28 -0
  68. package/src/api/interappbus/channel/connection-manager.js +244 -0
  69. package/src/api/interappbus/channel/index.d.ts +22 -0
  70. package/src/api/interappbus/channel/index.js +121 -0
  71. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +13 -0
  72. package/src/api/interappbus/channel/protocols/classic/message-receiver.js +73 -0
  73. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +22 -0
  74. package/src/api/interappbus/channel/protocols/classic/strategy.js +84 -0
  75. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +20 -0
  76. package/src/api/interappbus/channel/protocols/combined/strategy.js +58 -0
  77. package/src/api/interappbus/channel/protocols/index.d.ts +44 -0
  78. package/src/api/interappbus/channel/protocols/index.js +2 -0
  79. package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +10 -0
  80. package/src/api/interappbus/channel/protocols/protocol-manager.js +43 -0
  81. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +23 -0
  82. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +135 -0
  83. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +30 -0
  84. package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +131 -0
  85. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +22 -0
  86. package/src/api/interappbus/channel/protocols/rtc/strategy.js +87 -0
  87. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +13 -0
  88. package/src/api/interappbus/channel/protocols/strategy-types.js +2 -0
  89. package/src/api/interappbus/channel/protocols/strategy.d.ts +15 -0
  90. package/src/api/interappbus/channel/protocols/strategy.js +2 -0
  91. package/src/api/interappbus/channel/provider.d.ts +31 -0
  92. package/src/api/interappbus/channel/provider.js +165 -0
  93. package/src/api/interappbus/index.d.ts +85 -0
  94. package/src/api/interappbus/index.js +175 -0
  95. package/src/api/interop/Factory.d.ts +37 -0
  96. package/src/api/interop/Factory.js +54 -0
  97. package/src/api/interop/InteropBroker.d.ts +363 -0
  98. package/src/api/interop/InteropBroker.js +914 -0
  99. package/src/api/interop/InteropClient.d.ts +268 -0
  100. package/src/api/interop/InteropClient.js +450 -0
  101. package/src/api/interop/SessionContextGroupBroker.d.ts +26 -0
  102. package/src/api/interop/SessionContextGroupBroker.js +107 -0
  103. package/src/api/interop/SessionContextGroupClient.d.ts +20 -0
  104. package/src/api/interop/SessionContextGroupClient.js +85 -0
  105. package/src/api/interop/fdc3/fdc3-1.2.d.ts +187 -0
  106. package/src/api/interop/fdc3/fdc3-1.2.js +385 -0
  107. package/src/api/interop/fdc3/fdc3.js +17 -0
  108. package/src/api/interop/fdc3/utils.d.ts +6 -0
  109. package/src/api/interop/fdc3/utils.js +17 -0
  110. package/src/api/interop/index.d.ts +4 -0
  111. package/src/api/interop/index.js +16 -0
  112. package/src/api/interop/utils.d.ts +11 -0
  113. package/src/api/interop/utils.js +36 -0
  114. package/src/api/me.d.ts +35 -0
  115. package/src/api/me.js +60 -0
  116. package/src/api/platform/Factory.d.ts +109 -0
  117. package/src/api/platform/Factory.js +188 -0
  118. package/src/api/platform/Instance.d.ts +122 -0
  119. package/src/api/platform/Instance.js +299 -0
  120. package/src/api/platform/common-utils.d.ts +6 -0
  121. package/src/api/platform/common-utils.js +16 -0
  122. package/src/api/platform/index.d.ts +3 -0
  123. package/src/api/platform/index.js +15 -0
  124. package/src/api/platform/layout/Factory.d.ts +108 -0
  125. package/src/api/platform/layout/Factory.js +189 -0
  126. package/src/api/platform/layout/Instance.d.ts +48 -0
  127. package/src/api/platform/layout/Instance.js +99 -0
  128. package/src/api/platform/layout/index.d.ts +3 -0
  129. package/src/api/platform/layout/index.js +15 -0
  130. package/src/api/platform/layout/shapes.d.ts +11 -0
  131. package/src/api/platform/layout/shapes.js +2 -0
  132. package/src/api/snapshot-source/Factory.d.ts +36 -0
  133. package/src/api/snapshot-source/Factory.js +65 -0
  134. package/src/api/snapshot-source/Instance.d.ts +30 -0
  135. package/src/api/snapshot-source/Instance.js +134 -0
  136. package/src/api/snapshot-source/index.d.ts +3 -0
  137. package/src/api/snapshot-source/index.js +15 -0
  138. package/src/api/snapshot-source/utils.d.ts +1 -0
  139. package/src/api/snapshot-source/utils.js +5 -0
  140. package/src/api/system/application.d.ts +6 -0
  141. package/src/api/system/application.js +2 -0
  142. package/src/api/system/entity.d.ts +11 -0
  143. package/src/api/system/entity.js +2 -0
  144. package/src/api/system/index.d.ts +957 -0
  145. package/src/api/system/index.js +1241 -0
  146. package/src/api/system/installedApps.d.ts +6 -0
  147. package/src/api/system/installedApps.js +2 -0
  148. package/src/api/system/log.d.ts +11 -0
  149. package/src/api/system/log.js +2 -0
  150. package/src/api/system/process.d.ts +15 -0
  151. package/src/api/system/process.js +2 -0
  152. package/src/api/system/proxy.d.ts +15 -0
  153. package/src/api/system/proxy.js +2 -0
  154. package/src/api/system/queryPermissionTypes.d.ts +1 -0
  155. package/src/api/system/queryPermissionTypes.js +2 -0
  156. package/src/api/system/registry-info.d.ts +7 -0
  157. package/src/api/system/registry-info.js +2 -0
  158. package/src/api/system/window.d.ts +16 -0
  159. package/src/api/system/window.js +2 -0
  160. package/src/api/view/Factory.d.ts +49 -0
  161. package/src/api/view/Factory.js +103 -0
  162. package/src/api/view/Instance.d.ts +379 -0
  163. package/src/api/view/Instance.js +415 -0
  164. package/src/api/view/index.d.ts +3 -0
  165. package/src/api/view/index.js +15 -0
  166. package/src/api/webcontents/main.d.ts +36 -0
  167. package/src/api/webcontents/main.js +82 -0
  168. package/src/api/window/Factory.d.ts +44 -0
  169. package/src/api/window/Factory.js +91 -0
  170. package/src/api/window/Instance.d.ts +966 -0
  171. package/src/api/window/Instance.js +1202 -0
  172. package/src/api/window/bounds-changed.d.ts +10 -0
  173. package/src/api/window/bounds-changed.js +6 -0
  174. package/src/api/window/index.d.ts +5 -0
  175. package/src/api/window/index.js +17 -0
  176. package/src/api/window/shapes.d.ts +13 -0
  177. package/src/api/window/shapes.js +2 -0
  178. package/src/environment/environment.d.ts +28 -0
  179. package/src/environment/environment.js +4 -0
  180. package/src/environment/node-env.d.ts +25 -0
  181. package/src/environment/node-env.js +64 -0
  182. package/src/environment/openfin-env.d.ts +29 -0
  183. package/src/environment/openfin-env.js +105 -0
  184. package/src/mock.d.ts +4 -0
  185. package/src/mock.js +91 -0
  186. package/src/shapes/ERROR_BOX_TYPES.d.ts +6 -0
  187. package/src/shapes/ERROR_BOX_TYPES.js +10 -0
  188. package/src/shapes/EntityType.d.ts +1 -0
  189. package/src/shapes/EntityType.js +2 -0
  190. package/src/shapes/LayoutPresetType.d.ts +1 -0
  191. package/src/shapes/LayoutPresetType.js +2 -0
  192. package/src/shapes/Platform.d.ts +112 -0
  193. package/src/shapes/Platform.js +16 -0
  194. package/src/shapes/WebOptions.d.ts +12 -0
  195. package/src/shapes/WebOptions.js +2 -0
  196. package/src/shapes/WindowOptions.d.ts +42 -0
  197. package/src/shapes/WindowOptions.js +2 -0
  198. package/src/shapes/protocol.d.ts +178 -0
  199. package/src/shapes/protocol.js +2 -0
  200. package/src/transport/fin_store.d.ts +4 -0
  201. package/src/transport/fin_store.js +16 -0
  202. package/src/transport/transport-errors.d.ts +17 -0
  203. package/src/transport/transport-errors.js +39 -0
  204. package/src/transport/transport.d.ts +57 -0
  205. package/src/transport/transport.js +195 -0
  206. package/src/transport/wire.d.ts +76 -0
  207. package/src/transport/wire.js +39 -0
  208. package/src/util/asyncFilter.d.ts +1 -0
  209. package/src/util/asyncFilter.js +7 -0
  210. package/src/util/errors.d.ts +9 -0
  211. package/src/util/errors.js +14 -0
  212. package/src/util/exhaustive.d.ts +1 -0
  213. package/src/util/exhaustive.js +7 -0
  214. package/src/util/http.d.ts +11 -0
  215. package/src/util/http.js +83 -0
  216. package/src/util/normalize-config.d.ts +3 -0
  217. package/src/util/normalize-config.js +47 -0
  218. package/src/util/promises.d.ts +5 -0
  219. package/src/util/promises.js +27 -0
  220. package/src/util/ref-counter.d.ts +7 -0
  221. package/src/util/ref-counter.js +51 -0
  222. package/src/util/runtimeVersioning.d.ts +3 -0
  223. package/src/util/runtimeVersioning.js +25 -0
  224. package/src/util/utilTypes.d.ts +8 -0
  225. package/src/util/utilTypes.js +2 -0
  226. package/src/util/validate.d.ts +3 -0
  227. package/src/util/validate.js +11 -0
@@ -0,0 +1,69 @@
1
+ import { Base } from '../base';
2
+ /**
3
+ * WriteRequestType interface
4
+ * @typedef { object } WriteRequestType
5
+ * @property { string } data Data to be written
6
+ * @property { string } [type] Clipboard Type
7
+ */
8
+ /**
9
+ * The Clipboard API allows reading and writing to the clipboard in multiple formats.
10
+ * @namespace
11
+ */
12
+ export default class Clipboard extends Base {
13
+ /**
14
+ * Writes data into the clipboard as plain text
15
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typeof
16
+ * @return {Promise.<void>}
17
+ * @tutorial Clipboard.writeText
18
+ */
19
+ writeText(writeObj: OpenFin.WriteRequestType): Promise<void>;
20
+ /**
21
+ * Read the content of the clipboard as plain text
22
+ * @param { string } type Clipboard Type
23
+ * @return {Promise.<string>}
24
+ * @tutorial Clipboard.readText
25
+ */
26
+ readText(type?: string): Promise<string>;
27
+ /**
28
+ * Writes data into the clipboard as Html
29
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typedef
30
+ * @return {Promise.<void>}
31
+ * @tutorial Clipboard.writeHtml
32
+ */
33
+ writeHtml(writeObj: OpenFin.WriteRequestType): Promise<void>;
34
+ /**
35
+ * Read the content of the clipboard as Html
36
+ * @param { string } type Clipboard Type
37
+ * @return {Promise.<string>}
38
+ * @tutorial Clipboard.readHtml
39
+ */
40
+ readHtml(type?: string): Promise<string>;
41
+ /**
42
+ * Writes data into the clipboard as Rtf
43
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typedef
44
+ * @return {Promise.<void>}
45
+ * @tutorial Clipboard.writeRtf
46
+ */
47
+ writeRtf(writeObj: OpenFin.WriteRequestType): Promise<void>;
48
+ /**
49
+ * Read the content of the clipboard as Rtf
50
+ * @param { string } type Clipboard Type
51
+ * @return {Promise.<string>}
52
+ * @tutorial Clipboard.readRtf
53
+ */
54
+ readRtf(type?: string): Promise<string>;
55
+ /**
56
+ * Writes data into the clipboard
57
+ * @param { WriteAnyRequestType } writeObj This object is described in the WriteAnyRequestType typedef
58
+ * @return {Promise.<void>}
59
+ * @tutorial Clipboard.write
60
+ */
61
+ write(writeObj: OpenFin.WriteAnyRequestType): Promise<void>;
62
+ /**
63
+ * Reads available formats for the clipboard type
64
+ * @param { string } type Clipboard Type
65
+ * @return {Promise.Array.<string>}
66
+ * @tutorial Clipboard.getAvailableFormats
67
+ */
68
+ getAvailableFormats(type?: string): Promise<Array<string>>;
69
+ }
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const base_1 = require("../base");
4
+ /**
5
+ * WriteRequestType interface
6
+ * @typedef { object } WriteRequestType
7
+ * @property { string } data Data to be written
8
+ * @property { string } [type] Clipboard Type
9
+ */
10
+ /**
11
+ * The Clipboard API allows reading and writing to the clipboard in multiple formats.
12
+ * @namespace
13
+ */
14
+ class Clipboard extends base_1.Base {
15
+ /**
16
+ * Writes data into the clipboard as plain text
17
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typeof
18
+ * @return {Promise.<void>}
19
+ * @tutorial Clipboard.writeText
20
+ */
21
+ writeText(writeObj) {
22
+ return this.wire.sendAction('clipboard-write-text', writeObj).then(() => undefined);
23
+ }
24
+ /**
25
+ * Read the content of the clipboard as plain text
26
+ * @param { string } type Clipboard Type
27
+ * @return {Promise.<string>}
28
+ * @tutorial Clipboard.readText
29
+ */
30
+ readText(type) {
31
+ return this.wire.sendAction('clipboard-read-text', type).then(({ payload }) => payload.data);
32
+ }
33
+ /**
34
+ * Writes data into the clipboard as Html
35
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typedef
36
+ * @return {Promise.<void>}
37
+ * @tutorial Clipboard.writeHtml
38
+ */
39
+ writeHtml(writeObj) {
40
+ return this.wire.sendAction('clipboard-write-html', writeObj).then(() => undefined);
41
+ }
42
+ /**
43
+ * Read the content of the clipboard as Html
44
+ * @param { string } type Clipboard Type
45
+ * @return {Promise.<string>}
46
+ * @tutorial Clipboard.readHtml
47
+ */
48
+ readHtml(type) {
49
+ return this.wire.sendAction('clipboard-read-html', type).then(({ payload }) => payload.data);
50
+ }
51
+ /**
52
+ * Writes data into the clipboard as Rtf
53
+ * @param { WriteRequestType } writeObj This object is described in the WriteRequestType typedef
54
+ * @return {Promise.<void>}
55
+ * @tutorial Clipboard.writeRtf
56
+ */
57
+ writeRtf(writeObj) {
58
+ return this.wire.sendAction('clipboard-write-rtf', writeObj).then(() => undefined);
59
+ }
60
+ /**
61
+ * Read the content of the clipboard as Rtf
62
+ * @param { string } type Clipboard Type
63
+ * @return {Promise.<string>}
64
+ * @tutorial Clipboard.readRtf
65
+ */
66
+ readRtf(type) {
67
+ return this.wire.sendAction('clipboard-read-rtf', type).then(({ payload }) => payload.data);
68
+ }
69
+ /**
70
+ * Writes data into the clipboard
71
+ * @param { WriteAnyRequestType } writeObj This object is described in the WriteAnyRequestType typedef
72
+ * @return {Promise.<void>}
73
+ * @tutorial Clipboard.write
74
+ */
75
+ write(writeObj) {
76
+ return this.wire.sendAction('clipboard-write', writeObj).then(() => undefined);
77
+ }
78
+ /**
79
+ * Reads available formats for the clipboard type
80
+ * @param { string } type Clipboard Type
81
+ * @return {Promise.Array.<string>}
82
+ * @tutorial Clipboard.getAvailableFormats
83
+ */
84
+ getAvailableFormats(type) {
85
+ return this.wire.sendAction('clipboard-read-formats', type).then(({ payload }) => payload.data);
86
+ }
87
+ }
88
+ exports.default = Clipboard;
@@ -0,0 +1,69 @@
1
+ import { WindowEvent, BaseEventMap, ApplicationEvent } from './base';
2
+ import { WindowAlertRequestedEvent, WindowAuthRequestedEvent, WindowEndLoadEvent, PropagatedWindowEvents, WindowPerformanceReport } from './window';
3
+ import { PropagatedViewEvents } from './view';
4
+ export interface CrashedEvent {
5
+ reason: 'normal-termination' | 'abnormal-termination' | 'killed' | 'crashed' | 'still-running' | 'launch-failed' | 'out-of-memory' | 'integrity-failure';
6
+ exitCode: number;
7
+ details: {
8
+ reason: string;
9
+ exitCode: number;
10
+ };
11
+ }
12
+ export interface RunRequestedEvent<Topic, Type> extends ApplicationEvent<Topic, Type> {
13
+ userAppConfigArgs: any;
14
+ manifest: OpenFin.ManifestInfo;
15
+ }
16
+ export interface TrayIconClicked<Topic, Type> extends ApplicationEvent<Topic, Type> {
17
+ button: 0 | 1 | 2;
18
+ bounds: OpenFin.Rectangle;
19
+ x: number;
20
+ y: number;
21
+ monitorInfo: any;
22
+ }
23
+ export interface ApplicationEventMapping<Topic = string, Type = string> extends BaseEventMap {
24
+ 'closed': ApplicationEvent<Topic, Type>;
25
+ 'connected': ApplicationEvent<Topic, Type>;
26
+ 'crashed': CrashedEvent & ApplicationEvent<Topic, Type>;
27
+ 'initialized': ApplicationEvent<Topic, Type>;
28
+ 'manifest-changed': ApplicationEvent<Topic, Type>;
29
+ 'not-responding': ApplicationEvent<Topic, Type>;
30
+ 'responding': ApplicationEvent<Topic, Type>;
31
+ 'run-requested': RunRequestedEvent<Topic, Type>;
32
+ 'started': ApplicationEvent<Topic, Type>;
33
+ 'tray-icon-clicked': TrayIconClicked<Topic, Type>;
34
+ 'window-alert-requested': WindowAlertRequestedEvent<Topic, Type>;
35
+ 'window-auth-requested': WindowAuthRequestedEvent<Topic, Type>;
36
+ 'window-created': WindowEvent<Topic, Type>;
37
+ 'window-end-load': WindowEndLoadEvent<Topic, Type>;
38
+ 'window-not-responding': WindowEvent<Topic, Type>;
39
+ 'window-performance-report': WindowPerformanceReport<Topic, Type>;
40
+ 'window-responding': WindowEvent<Topic, Type>;
41
+ 'window-show-requested': WindowEvent<Topic, Type>;
42
+ 'window-start-load': WindowEvent<Topic, Type>;
43
+ }
44
+ export interface PropagatedApplicationEventMapping<Topic = string, Type = string> {
45
+ 'application-closed': ApplicationEvent<Topic, Type>;
46
+ 'application-connected': ApplicationEvent<Topic, Type>;
47
+ 'application-crashed': CrashedEvent & ApplicationEvent<Topic, Type>;
48
+ 'application-initialized': ApplicationEvent<Topic, Type>;
49
+ 'application-manifest-changed': ApplicationEvent<Topic, Type>;
50
+ 'application-not-responding': ApplicationEvent<Topic, Type>;
51
+ 'application-responding': ApplicationEvent<Topic, Type>;
52
+ 'application-started': ApplicationEvent<Topic, Type>;
53
+ 'application-tray-icon-clicked': TrayIconClicked<Topic, Type>;
54
+ 'window-created': WindowEvent<Topic, Type>;
55
+ 'window-did-change-theme-color': WindowEvent<Topic, Type>;
56
+ 'window-end-load': WindowEndLoadEvent<Topic, Type>;
57
+ 'window-not-responding': WindowEvent<Topic, Type>;
58
+ 'window-page-favicon-updated': WindowEvent<Topic, Type>;
59
+ 'window-page-title-updated': WindowEvent<Topic, Type>;
60
+ 'window-performance-report': WindowPerformanceReport<Topic, Type>;
61
+ 'window-responding': WindowEvent<Topic, Type>;
62
+ 'window-start-load': WindowEvent<Topic, Type>;
63
+ }
64
+ export declare type ApplicationEvents = PropagatedWindowEvents<'application'> & PropagatedViewEvents<'application'> & {
65
+ [Type in keyof ApplicationEventMapping]: ApplicationEventMapping<'application', Type>[Type];
66
+ };
67
+ export declare type PropagatedApplicationEvents<Topic> = {
68
+ [Type in keyof PropagatedApplicationEventMapping]: PropagatedApplicationEventMapping<Topic, Type>[Type];
69
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { FrameEvent } from './frame';
2
+ export declare type RuntimeEvent<Topic = string, Type = string> = Topic extends 'window' | 'view' ? WindowEvent<Topic, Type> : Topic extends 'frame' ? FrameEvent<Type> : Topic extends 'application' ? ApplicationEvent<Topic, Type> : BaseEvent<Topic, Type>;
3
+ export interface BaseEvent<Topic, Type> {
4
+ topic: Topic;
5
+ type: Type;
6
+ }
7
+ export interface ApplicationEvent<Topic, Type> extends BaseEvent<Topic, Type> {
8
+ uuid: string;
9
+ }
10
+ export interface WindowEvent<Topic, Type> extends ApplicationEvent<Topic, Type> {
11
+ name: string;
12
+ }
13
+ export interface BaseEventMap {
14
+ [name: string]: any;
15
+ newListener: string;
16
+ listenerRemoved: string;
17
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { BaseEventMap, ApplicationEvent } from './base';
2
+ export interface ChannelEvent<Type> extends ApplicationEvent<'channel', Type> {
3
+ channelName: string;
4
+ channelId: string;
5
+ name: string;
6
+ }
7
+ export interface ChannelEvents extends BaseEventMap {
8
+ connected: ChannelEvent<'connected'>;
9
+ disconnected: ChannelEvent<'disconnected'>;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ export declare class EmitterMap {
4
+ private storage;
5
+ constructor();
6
+ private hashKeys;
7
+ getOrCreate(keys: EmitterAccessor): EventEmitter;
8
+ has(keys: EmitterAccessor): boolean;
9
+ delete(keys: EmitterAccessor): boolean;
10
+ }
11
+ export declare type EmitterAccessor = string[];
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmitterMap = void 0;
4
+ const events_1 = require("events");
5
+ class EmitterMap {
6
+ constructor() {
7
+ this.storage = new Map();
8
+ }
9
+ // eslint-disable-next-line class-methods-use-this
10
+ hashKeys(keys) {
11
+ const hashed = keys.map(normalizeString);
12
+ return hashed.join('/');
13
+ }
14
+ getOrCreate(keys) {
15
+ const hash = this.hashKeys(keys);
16
+ if (!this.storage.has(hash)) {
17
+ this.storage.set(hash, new events_1.EventEmitter());
18
+ }
19
+ // We set it above
20
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
21
+ return this.storage.get(hash);
22
+ }
23
+ has(keys) {
24
+ return this.storage.has(this.hashKeys(keys));
25
+ }
26
+ delete(keys) {
27
+ const hash = this.hashKeys(keys);
28
+ return this.storage.delete(hash);
29
+ }
30
+ }
31
+ exports.EmitterMap = EmitterMap;
32
+ function normalizeString(s) {
33
+ const b = Buffer.from(s);
34
+ return b.toString('base64');
35
+ }
@@ -0,0 +1,5 @@
1
+ import { Message } from '../../transport/transport';
2
+ import { EmitterMap } from './emitterMap';
3
+ export default class EventAggregator extends EmitterMap {
4
+ dispatchEvent: (message: Message<any>) => boolean;
5
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const emitterMap_1 = require("./emitterMap");
4
+ function isEventMessage(message) {
5
+ return message.action === 'process-desktop-event';
6
+ }
7
+ function mapKeyFromEvent(event) {
8
+ const { topic } = event;
9
+ if (topic === 'frame') {
10
+ const { uuid, name } = event;
11
+ return [topic, uuid, name];
12
+ }
13
+ if (topic === 'window') {
14
+ const { uuid, name } = event;
15
+ return [topic, uuid, name];
16
+ }
17
+ if (topic === 'application') {
18
+ const { uuid } = event;
19
+ return [topic, uuid];
20
+ }
21
+ if (topic === 'view') {
22
+ const { uuid, name } = event;
23
+ return [topic, uuid, name];
24
+ }
25
+ return [topic];
26
+ }
27
+ class EventAggregator extends emitterMap_1.EmitterMap {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.dispatchEvent = (message) => {
31
+ if (isEventMessage(message)) {
32
+ const { payload } = message;
33
+ const accessor = mapKeyFromEvent(payload);
34
+ if (this.has(accessor)) {
35
+ this.getOrCreate(accessor).emit(payload.type, payload);
36
+ return true;
37
+ }
38
+ }
39
+ return false;
40
+ };
41
+ }
42
+ }
43
+ exports.default = EventAggregator;
@@ -0,0 +1,5 @@
1
+ import { RuntimeEvent, BaseEventMap } from './base';
2
+ export interface ExternalApplicationEvents extends BaseEventMap {
3
+ connected: RuntimeEvent<'externalapplication', 'connected'>;
4
+ disconnected: RuntimeEvent<'externalapplication', 'disconnected'>;
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import { BaseEventMap, WindowEvent } from './base';
2
+ export interface FrameEvent<Type> extends WindowEvent<'frame', Type> {
3
+ entityType: 'iframe';
4
+ frameName: string;
5
+ }
6
+ export interface FrameEvents extends BaseEventMap {
7
+ connected: FrameEvent<'connected'>;
8
+ disconnected: FrameEvent<'disconnected'>;
9
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { RuntimeEvent, BaseEventMap } from './base';
2
+ import Identity = OpenFin.Identity;
3
+ export interface GlobalHotkeyEvent<Type> extends RuntimeEvent<'global-hotkey', Type> {
4
+ identity: Identity;
5
+ hotkey: string;
6
+ }
7
+ export interface GlobalHotkeyEvents extends BaseEventMap {
8
+ registered: GlobalHotkeyEvent<'registered'>;
9
+ unregistered: GlobalHotkeyEvent<'unregistered'>;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { ApplicationEvent } from './base';
2
+ import { PropagatedWindowEvents } from './window';
3
+ import { PropagatedViewEvents } from './view';
4
+ import { ApplicationEventMapping, PropagatedApplicationEventMapping } from './application';
5
+ export interface PlatformEventMapping<Topic = string, Type = string> extends ApplicationEventMapping {
6
+ 'platform-api-ready': ApplicationEvent<Topic, Type>;
7
+ 'platform-snapshot-applied': ApplicationEvent<Topic, Type>;
8
+ }
9
+ export interface PropagatedPlatformEventMapping<Topic = string, Type = string> extends PropagatedApplicationEventMapping {
10
+ 'platform-api-ready': ApplicationEvent<Topic, Type>;
11
+ 'platform-snapshot-applied': ApplicationEvent<Topic, Type>;
12
+ }
13
+ export declare type PlatformEvents = PropagatedWindowEvents<'application'> & PropagatedViewEvents<'application'> & {
14
+ [Type in keyof PlatformEventMapping]: PlatformEventMapping<'application', Type>[Type];
15
+ };
16
+ export declare type PropagatedPlatformEvents<Topic> = {
17
+ [Type in keyof PropagatedPlatformEventMapping]: PropagatedPlatformEventMapping<Topic, Type>[Type];
18
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { BaseEvent, ApplicationEvent, BaseEventMap } from './base';
2
+ import { PropagatedWindowEvents } from './window';
3
+ import { PropagatedApplicationEvents } from './application';
4
+ import { PropagatedViewEvents } from './view';
5
+ export interface IdleEvent<Topic, Type> extends BaseEvent<Topic, Type> {
6
+ elapsedTime: number;
7
+ isIdle: boolean;
8
+ }
9
+ export declare type MonitorEvent<Topic, Type> = OpenFin.MonitorInfo & BaseEvent<Topic, Type>;
10
+ export interface SessionChangedEvent<Topic, Type> extends BaseEvent<Topic, Type> {
11
+ reason: 'lock' | 'unlock' | 'remote-connect' | 'remote-disconnect' | 'unknown';
12
+ }
13
+ export interface SystemEventMapping<Topic = string, Type = string> extends BaseEventMap {
14
+ 'application-created': ApplicationEvent<Topic, Type>;
15
+ 'desktop-icon-clicked': ApplicationEvent<Topic, Type>;
16
+ 'idle-state-changed': IdleEvent<Topic, Type>;
17
+ 'monitor-info-changed': MonitorEvent<Topic, Type>;
18
+ 'session-changed': SessionChangedEvent<Topic, Type>;
19
+ }
20
+ export declare type SystemEvents = PropagatedWindowEvents<'system'> & PropagatedApplicationEvents<'system'> & PropagatedViewEvents<'system'> & {
21
+ [Type in keyof SystemEventMapping]: SystemEventMapping<'system', Type>[Type];
22
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,56 @@
1
+ import { WebContentsEventMapping, WindowResourceLoadFailedEvent, WindowResourceResponseReceivedEvent, CertificateSelectionShownEvent } from './webcontents';
2
+ import { WindowEvent, BaseEventMap } from './base';
3
+ import { WindowNavigationRejectedEvent } from './window';
4
+ import { CrashedEvent } from './application';
5
+ export interface ViewEventMapping<Topic = string, Type = string> extends WebContentsEventMapping {
6
+ 'attached': WindowEvent<Topic, Type>;
7
+ 'created': WindowEvent<Topic, Type>;
8
+ 'destroyed': WindowEvent<Topic, Type>;
9
+ 'hidden': WindowEvent<Topic, Type>;
10
+ 'hotkey': InputEvent & WindowEvent<Topic, Type>;
11
+ 'shown': WindowEvent<Topic, Type>;
12
+ 'target-changed': TargetChangedEvent<Topic, Type>;
13
+ }
14
+ interface PropagatedViewIdentity {
15
+ viewIdentity: OpenFin.Identity;
16
+ }
17
+ export interface PropagatedViewEventMapping<Topic = string, Type = string> extends BaseEventMap {
18
+ 'view-blurred': WindowEvent<Topic, Type> & PropagatedViewIdentity;
19
+ 'view-certificate-selection-shown': CertificateSelectionShownEvent<Topic, Type> & PropagatedViewIdentity;
20
+ 'view-crashed': CrashedEvent & WindowEvent<Topic, Type> & PropagatedViewIdentity;
21
+ 'view-created': CrashedEvent & WindowEvent<Topic, Type> & PropagatedViewIdentity;
22
+ 'view-destroyed': WindowEvent<Topic, Type> & PropagatedViewIdentity;
23
+ 'view-did-change-theme-color': WindowEvent<Topic, Type> & PropagatedViewIdentity;
24
+ 'view-focused': WindowEvent<Topic, Type> & PropagatedViewIdentity;
25
+ 'view-hidden': WindowEvent<Topic, Type> & PropagatedViewIdentity;
26
+ 'view-hotkey': InputEvent & WindowEvent<Topic, Type> & PropagatedViewIdentity;
27
+ 'view-navigation-rejected': WindowNavigationRejectedEvent<Topic, Type> & PropagatedViewIdentity;
28
+ 'view-page-favicon-updated': WindowEvent<Topic, Type> & PropagatedViewIdentity;
29
+ 'view-page-title-updated': WindowEvent<Topic, Type> & PropagatedViewIdentity;
30
+ 'view-resource-load-failed': WindowResourceLoadFailedEvent<Topic, Type> & PropagatedViewIdentity;
31
+ 'view-resource-response-received': WindowResourceResponseReceivedEvent<Topic, Type> & PropagatedViewIdentity;
32
+ 'view-shown': WindowEvent<Topic, Type> & PropagatedViewIdentity;
33
+ 'view-target-changed': TargetChangedEvent<Topic, Type> & PropagatedViewIdentity;
34
+ }
35
+ export declare type ViewEvents = {
36
+ [Type in keyof ViewEventMapping]: ViewEventMapping<'view', Type>[Type];
37
+ };
38
+ export declare type PropagatedViewEvents<Topic> = {
39
+ [Type in keyof PropagatedViewEventMapping]: PropagatedViewEventMapping<Topic, Type>[Type];
40
+ };
41
+ export interface InputEvent {
42
+ inputType: 'keyUp' | 'keyDown';
43
+ ctrlKey: boolean;
44
+ shiftKey: boolean;
45
+ altKey: boolean;
46
+ metaKey: boolean;
47
+ key: string;
48
+ code: string;
49
+ repeat: boolean;
50
+ command?: string;
51
+ }
52
+ export interface TargetChangedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
53
+ previousTarget: OpenFin.Identity;
54
+ target: OpenFin.Identity;
55
+ }
56
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,48 @@
1
+ import { BaseEventMap, WindowEvent } from './base';
2
+ import { CrashedEvent } from './application';
3
+ import { WindowNavigationRejectedEvent } from './window';
4
+ export interface WindowResourceLoadFailedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
5
+ errorCode: number;
6
+ errorDescription: string;
7
+ validatedURL: string;
8
+ isMainFrame: boolean;
9
+ }
10
+ export interface WindowResourceResponseReceivedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
11
+ status: boolean;
12
+ newUrl: string;
13
+ originalUrl: string;
14
+ httpResponseCode: number;
15
+ requestMethod: string;
16
+ referrer: string;
17
+ headers: any;
18
+ resourceType: 'mainFrame' | 'subFrame' | 'styleSheet' | 'script' | 'image' | 'object' | 'xhr' | 'other';
19
+ }
20
+ export interface PageTitleUpdatedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
21
+ title: string;
22
+ }
23
+ export interface CertificateErrorEvent<Topic, Type> extends WindowEvent<Topic, Type> {
24
+ error: string;
25
+ url: string;
26
+ certificate: OpenFin.Certificate;
27
+ }
28
+ export interface CertificateSelectionShownEvent<Topic, Type> extends WindowEvent<Topic, Type> {
29
+ url: string;
30
+ certificates: OpenFin.Certificate[];
31
+ }
32
+ export interface FaviconUpdatedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
33
+ favicons: string[];
34
+ }
35
+ export interface WebContentsEventMapping<Topic = string, Type = string> extends BaseEventMap {
36
+ 'blurred': WindowEvent<Topic, Type>;
37
+ 'certificate-error': CertificateErrorEvent<Topic, Type>;
38
+ 'certificate-selection-shown': CertificateSelectionShownEvent<Topic, Type>;
39
+ 'crashed': CrashedEvent & WindowEvent<Topic, Type>;
40
+ 'did-change-theme-color': WindowEvent<Topic, Type>;
41
+ 'focused': WindowEvent<Topic, Type>;
42
+ 'found-in-page': WindowEvent<Topic, Type>;
43
+ 'navigation-rejected': WindowNavigationRejectedEvent<Topic, Type>;
44
+ 'page-favicon-updated': FaviconUpdatedEvent<Topic, Type>;
45
+ 'page-title-updated': PageTitleUpdatedEvent<Topic, Type>;
46
+ 'resource-load-failed': WindowResourceLoadFailedEvent<Topic, Type>;
47
+ 'resource-response-received': WindowResourceResponseReceivedEvent<Topic, Type>;
48
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });