@openfin/core 33.76.36 → 33.77.1

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 +17111 -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,14 +0,0 @@
1
- /**
2
- * Entry point for the OpenFin Frame namespace.
3
- *
4
- * Because TypeDoc does not currently support multiple modules with the same name, the module alias "FrameModule" is used for
5
- * the module containing static members of the `Frame` namespace (available under `fin.Frame`), while `Frame` documents
6
- * instances of the OpenFin `Frame` class.
7
- *
8
- * Because the `Frame` name aliases a DOM entity, the documentation pipeline prefixes the name with an underscore.
9
- *
10
- * @packageDocumentation
11
- */
12
- import _FrameModule from './Factory';
13
- export default _FrameModule;
14
- export * from './Instance';
@@ -1,30 +0,0 @@
1
- "use strict";
2
- /**
3
- * Entry point for the OpenFin Frame namespace.
4
- *
5
- * Because TypeDoc does not currently support multiple modules with the same name, the module alias "FrameModule" is used for
6
- * the module containing static members of the `Frame` namespace (available under `fin.Frame`), while `Frame` documents
7
- * instances of the OpenFin `Frame` class.
8
- *
9
- * Because the `Frame` name aliases a DOM entity, the documentation pipeline prefixes the name with an underscore.
10
- *
11
- * @packageDocumentation
12
- */
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- const Factory_1 = require("./Factory");
29
- exports.default = Factory_1.default;
30
- __exportStar(require("./Instance"), exports);
@@ -1,106 +0,0 @@
1
- import type * as OpenFin from '../../OpenFin';
2
- import { EmitterBase } from '../base';
3
- import { Transport } from '../../transport/transport';
4
- /**
5
- * The GlobalHotkey module can register/unregister a global hotkeys.
6
- *
7
- */
8
- export default class GlobalHotkey extends EmitterBase<OpenFin.GlobalHotkeyEvent> {
9
- /**
10
- * @internal
11
- */
12
- constructor(wire: Transport);
13
- /**
14
- * Registers a global hotkey with the operating system.
15
- * @param hotkey a hotkey string
16
- * @param listener called when the registered hotkey is pressed by the user.
17
- *
18
- * @remarks The `hotkey` parameter expects an electron compatible [accelerator](https://github.com/electron/electron/blob/master/docs/api/accelerator.md) and the `listener` will be called if the `hotkey` is pressed by the user.
19
- * If successfull, the hotkey will be 'claimed' by the application, meaning that this register call can be called multiple times from within the same application but will fail if another application has registered the hotkey.
20
- * <br>The register call will fail if given any of these reserved Hotkeys:
21
- * * `CommandOrControl+0`
22
- * * `CommandOrControl+=`
23
- * * `CommandOrControl+Plus`
24
- * * `CommandOrControl+-`
25
- * * `CommandOrControl+_`
26
- * * `CommandOrControl+Shift+I`
27
- * * `F5`
28
- * * `CommandOrControl+R`
29
- * * `Shift+F5`
30
- * * `CommandOrControl+Shift+R`
31
- *
32
- * Raises the `registered` event.
33
- *
34
- * @example
35
- * ```js
36
- * const hotkey = 'CommandOrControl+X';
37
- *
38
- * fin.GlobalHotkey.register(hotkey, () => {
39
- * console.log(`${hotkey} pressed`);
40
- * })
41
- * .then(() => {
42
- * console.log('Success');
43
- * })
44
- * .catch(err => {
45
- * console.log('Error registering the hotkey', err);
46
- * });
47
- * ```
48
- */
49
- register(hotkey: string, listener: (...args: any[]) => void): Promise<void>;
50
- /**
51
- * Unregisters a global hotkey with the operating system.
52
- * @param hotkey a hotkey string
53
- *
54
- * @remarks This method will unregister all existing registrations of the hotkey within the application.
55
- * Raises the `unregistered` event.
56
- *
57
- * @example
58
- * ```js
59
- * const hotkey = 'CommandOrControl+X';
60
- *
61
- * fin.GlobalHotkey.unregister(hotkey)
62
- * .then(() => {
63
- * console.log('Success');
64
- * })
65
- * .catch(err => {
66
- * console.log('Error unregistering the hotkey', err);
67
- * });
68
- * ```
69
- */
70
- unregister(hotkey: string): Promise<void>;
71
- /**
72
- * Unregisters all global hotkeys for the current application.
73
- *
74
- * @remarks Raises the `unregistered` event for each hotkey unregistered.
75
- *
76
- * @example
77
- * ```js
78
- * fin.GlobalHotkey.unregisterAll()
79
- * .then(() => {
80
- * console.log('Success');
81
- * })
82
- * .catch(err => {
83
- * console.log('Error unregistering all hotkeys for this application', err);
84
- * });
85
- * ```
86
- */
87
- unregisterAll(): Promise<void>;
88
- /**
89
- * Checks if a given hotkey has been registered
90
- * @param hotkey a hotkey string
91
- *
92
- * @example
93
- * ```js
94
- * const hotkey = 'CommandOrControl+X';
95
- *
96
- * fin.GlobalHotkey.isRegistered(hotkey)
97
- * .then((registered) => {
98
- * console.log(`hotkey ${hotkey} is registered ? ${registered}`);
99
- * })
100
- * .catch(err => {
101
- * console.log('Error unregistering the hotkey', err);
102
- * });
103
- * ```
104
- */
105
- isRegistered(hotkey: string): Promise<boolean>;
106
- }
@@ -1,132 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const base_1 = require("../base");
4
- /**
5
- * The GlobalHotkey module can register/unregister a global hotkeys.
6
- *
7
- */
8
- class GlobalHotkey extends base_1.EmitterBase {
9
- /**
10
- * @internal
11
- */
12
- constructor(wire) {
13
- super(wire, 'global-hotkey');
14
- }
15
- /**
16
- * Registers a global hotkey with the operating system.
17
- * @param hotkey a hotkey string
18
- * @param listener called when the registered hotkey is pressed by the user.
19
- *
20
- * @remarks The `hotkey` parameter expects an electron compatible [accelerator](https://github.com/electron/electron/blob/master/docs/api/accelerator.md) and the `listener` will be called if the `hotkey` is pressed by the user.
21
- * If successfull, the hotkey will be 'claimed' by the application, meaning that this register call can be called multiple times from within the same application but will fail if another application has registered the hotkey.
22
- * <br>The register call will fail if given any of these reserved Hotkeys:
23
- * * `CommandOrControl+0`
24
- * * `CommandOrControl+=`
25
- * * `CommandOrControl+Plus`
26
- * * `CommandOrControl+-`
27
- * * `CommandOrControl+_`
28
- * * `CommandOrControl+Shift+I`
29
- * * `F5`
30
- * * `CommandOrControl+R`
31
- * * `Shift+F5`
32
- * * `CommandOrControl+Shift+R`
33
- *
34
- * Raises the `registered` event.
35
- *
36
- * @example
37
- * ```js
38
- * const hotkey = 'CommandOrControl+X';
39
- *
40
- * fin.GlobalHotkey.register(hotkey, () => {
41
- * console.log(`${hotkey} pressed`);
42
- * })
43
- * .then(() => {
44
- * console.log('Success');
45
- * })
46
- * .catch(err => {
47
- * console.log('Error registering the hotkey', err);
48
- * });
49
- * ```
50
- */
51
- async register(hotkey, listener) {
52
- // TODO: fix typing (hotkey events are not typed)
53
- // @ts-expect-error
54
- await this.on(hotkey, listener);
55
- await this.wire.sendAction('global-hotkey-register', { hotkey });
56
- return undefined;
57
- }
58
- /**
59
- * Unregisters a global hotkey with the operating system.
60
- * @param hotkey a hotkey string
61
- *
62
- * @remarks This method will unregister all existing registrations of the hotkey within the application.
63
- * Raises the `unregistered` event.
64
- *
65
- * @example
66
- * ```js
67
- * const hotkey = 'CommandOrControl+X';
68
- *
69
- * fin.GlobalHotkey.unregister(hotkey)
70
- * .then(() => {
71
- * console.log('Success');
72
- * })
73
- * .catch(err => {
74
- * console.log('Error unregistering the hotkey', err);
75
- * });
76
- * ```
77
- */
78
- async unregister(hotkey) {
79
- // TODO: fix typing (hotkey events are not typed)
80
- // @ts-expect-error
81
- await this.removeAllListeners(hotkey);
82
- await this.wire.sendAction('global-hotkey-unregister', { hotkey });
83
- return undefined;
84
- }
85
- /**
86
- * Unregisters all global hotkeys for the current application.
87
- *
88
- * @remarks Raises the `unregistered` event for each hotkey unregistered.
89
- *
90
- * @example
91
- * ```js
92
- * fin.GlobalHotkey.unregisterAll()
93
- * .then(() => {
94
- * console.log('Success');
95
- * })
96
- * .catch(err => {
97
- * console.log('Error unregistering all hotkeys for this application', err);
98
- * });
99
- * ```
100
- */
101
- async unregisterAll() {
102
- await Promise.all(this.eventNames()
103
- .filter((name) => !(name === 'registered' || name === 'unregistered'))
104
- // TODO: fix typing (hotkey events are not typed)
105
- // @ts-expect-error
106
- .map((name) => this.removeAllListeners(name)));
107
- await this.wire.sendAction('global-hotkey-unregister-all', {});
108
- return undefined;
109
- }
110
- /**
111
- * Checks if a given hotkey has been registered
112
- * @param hotkey a hotkey string
113
- *
114
- * @example
115
- * ```js
116
- * const hotkey = 'CommandOrControl+X';
117
- *
118
- * fin.GlobalHotkey.isRegistered(hotkey)
119
- * .then((registered) => {
120
- * console.log(`hotkey ${hotkey} is registered ? ${registered}`);
121
- * })
122
- * .catch(err => {
123
- * console.log('Error unregistering the hotkey', err);
124
- * });
125
- * ```
126
- */
127
- async isRegistered(hotkey) {
128
- const { payload: { data } } = await this.wire.sendAction('global-hotkey-is-registered', { hotkey });
129
- return data;
130
- }
131
- }
132
- exports.default = GlobalHotkey;
@@ -1,285 +0,0 @@
1
- import type * as OpenFin from '../../../OpenFin';
2
- import { Transport } from '../../../transport/transport';
3
- type ProviderIdentity = OpenFin.ProviderIdentity;
4
- type ChannelMiddleware = OpenFin.ChannelMiddleware;
5
- type ErrorMiddleware = OpenFin.ErrorMiddleware;
6
- type ChannelAction = OpenFin.ChannelAction;
7
- export declare class ProtectedItems {
8
- providerIdentity: ProviderIdentity;
9
- wire: Transport;
10
- /**
11
- * @internal
12
- */
13
- constructor(providerIdentity: ProviderIdentity, wire: Transport);
14
- }
15
- export declare class ChannelBase {
16
- protected subscriptions: Map<string, ChannelAction>;
17
- private defaultAction?;
18
- private preAction?;
19
- private postAction?;
20
- private errorMiddleware?;
21
- private static defaultAction;
22
- constructor();
23
- protected processAction(topic: string, payload: unknown, senderIdentity: ProviderIdentity | OpenFin.ClientIdentity): Promise<unknown>;
24
- /**
25
- * Register middleware that fires before the action.
26
- *
27
- * @param func
28
- *
29
- * @example
30
- *
31
- * Channel Provider:
32
- * ```js
33
- * (async ()=> {
34
- * const provider = await fin.InterApplicationBus.Channel.create('channelName');
35
- *
36
- * provider.register('provider-action', (payload, identity) => {
37
- * console.log(payload, identity);
38
- * return {
39
- * echo: payload
40
- * };
41
- * });
42
- *
43
- * provider.beforeAction((action, payload, identity) => {
44
- * //The payload can be altered here before handling the action.
45
- * payload.received = Date.now();
46
- * return payload;
47
- * });
48
- *
49
- * })();
50
- * ```
51
- *
52
- * Channel Client:
53
- * ```js
54
- * (async ()=> {
55
- * const client = await fin.InterApplicationBus.Channel.connect('channelName');
56
- *
57
- * client.register('client-action', (payload, identity) => {
58
- * console.log(payload, identity);
59
- * return {
60
- * echo: payload
61
- * };
62
- * });
63
- *
64
- * client.beforeAction((action, payload, identity) => {
65
- * //The payload can be altered here before handling the action.
66
- * payload.received = Date.now();
67
- * return payload;
68
- * });
69
- *
70
- * const providerResponse = await client.dispatch('provider-action', { message: 'Hello From the client' });
71
- * console.log(providerResponse);
72
- * })();
73
- * ```
74
- */
75
- beforeAction(func: ChannelMiddleware): void;
76
- /**
77
- * Register an error handler. This is called before responding on any error.
78
- *
79
- * @param func
80
- *
81
- * Channel Provider:
82
- * ```js
83
- * (async ()=> {
84
- * const provider = await fin.InterApplicationBus.Channel.create('channelName');
85
- *
86
- * provider.register('provider-action', (payload, identity) => {
87
- * console.log(payload);
88
- * throw new Error('Action error');
89
- * return {
90
- * echo: payload
91
- * };
92
- * });
93
- *
94
- * provider.onError((action, error, identity) => {
95
- * console.log('uncaught Exception in action:', action);
96
- * console.error(error);
97
- * });
98
- *
99
- * })();
100
- * ```
101
- *
102
- * Channel Client:
103
- * ```js
104
- * (async ()=> {
105
- * const client = await fin.InterApplicationBus.Channel.connect('channelName');
106
- *
107
- * client.register('client-action', (payload, identity) => {
108
- * console.log(payload);
109
- * throw new Error('Action error');
110
- * return {
111
- * echo: payload
112
- * };
113
- * });
114
- *
115
- * client.onError((action, error, identity) => {
116
- * console.log('uncaught Exception in action:', action);
117
- * console.error(error);
118
- * });
119
- * })();
120
- * ```
121
- */
122
- onError(func: ErrorMiddleware): void;
123
- /**
124
- * Register middleware that fires after the action.
125
- *
126
- * @param func
127
- *
128
- * @remarks If the action does not return the payload, then the afterAction will not have access to the payload object.
129
- *
130
- * @example
131
- *
132
- * Channel Provider:
133
- * ```js
134
- * (async ()=> {
135
- * const provider = await fin.InterApplicationBus.Channel.create('channelName');
136
- *
137
- * await provider.register('provider-action', (payload, identity) => {
138
- * return {
139
- * echo: payload
140
- * };
141
- * });
142
- *
143
- * await provider.afterAction((action, payload, identity) => {
144
- * //the payload can be altered here after handling the action but before sending an acknowledgement.
145
- * payload.sent = date.now();
146
- * return payload;
147
- * });
148
- *
149
- * })();
150
- * ```
151
- *
152
- * Channel Client:
153
- * ```js
154
- * (async ()=> {
155
- * const client = await fin.InterApplicationBus.Channel.connect('channelName');
156
- *
157
- * await client.register('client-action', (payload, identity) => {
158
- * return {
159
- * echo: payload
160
- * };
161
- * });
162
- *
163
- * await client.afterAction((action, payload, identity) => {
164
- * //the payload can be altered here after handling the action but before sending an acknowledgement.
165
- * payload.sent = date.now();
166
- * return payload;
167
- * });
168
- *
169
- * })();
170
- * ```
171
- */
172
- afterAction(func: ChannelMiddleware): void;
173
- /**
174
- * Remove an action by action name.
175
- *
176
- * @param action
177
- *
178
- * @example
179
- *
180
- * ```js
181
- * (async ()=> {
182
- * const provider = await fin.InterApplicationBus.Channel.create('channelName');
183
- *
184
- * await provider.register('provider-action', (payload, identity) => {
185
- * console.log(payload);
186
- * return {
187
- * echo: payload
188
- * };
189
- * });
190
- *
191
- * await provider.remove('provider-action');
192
- *
193
- * })();
194
- * ```
195
- */
196
- remove(action: string): void;
197
- /**
198
- * Registers a default action. This is used any time an action that has not been registered is invoked.
199
- *
200
- * @example
201
- *
202
- * Channel Provider:
203
- * ```js
204
- * (async ()=> {
205
- * const provider = await fin.InterApplicationBus.Channel.create('channelName');
206
- *
207
- * await provider.setDefaultAction((action, payload, identity) => {
208
- * console.log(`Client with identity ${JSON.stringify(identity)} has attempted to dispatch unregistered action: ${action}.`);
209
- *
210
- * return {
211
- * echo: payload
212
- * };
213
- * });
214
- *
215
- * })();
216
- * ```
217
- *
218
- * Channel Client:
219
- * ```js
220
- * (async ()=> {
221
- * const client = await fin.InterApplicationBus.Channel.connect('channelName');
222
- *
223
- * await client.setDefaultAction((action, payload, identity) => {
224
- * console.log(`Provider with identity ${JSON.stringify(identity)} has attempted to dispatch unregistered action: ${action}.`);
225
- *
226
- * return {
227
- * echo: payload
228
- * };
229
- * });
230
- *
231
- * })();
232
- * ```
233
- * @param func
234
- */
235
- setDefaultAction(func: ChannelMiddleware): void;
236
- /**
237
- * Register an action to be called by dispatching from any channelClient or channelProvider.
238
- *
239
- * @param topic
240
- * @param listener
241
- *
242
- * @remarks The return value will be sent back as an acknowledgement to the original caller. You can throw an
243
- * error to send a negative-acknowledgement and the error will reject the promise returned to the sender by the
244
- * dispatch call. Once a listener is registered for a particular action, it stays in place receiving and responding
245
- * to incoming messages until it is removed. This messaging mechanism works exactly the same when messages are
246
- * dispatched from the provider to a client. However, the provider has an additional publish method that sends messages
247
- * to all connected clients.
248
- *
249
- * Because multiple clients can share the same `name` and `uuid`, in order to distinguish between individual clients,
250
- * the `identity` argument in a provider's registered action callback contains an `endpointId` property. When dispatching
251
- * from a provider to a client, the `endpointId` property must be provided in order to send an action to a specific client.
252
- *
253
- * @example
254
- *
255
- * Channel Provider:
256
- * ```js
257
- * (async ()=> {
258
- * const provider = await fin.InterApplicationBus.Channel.create('channelName');
259
- *
260
- * await provider.register('provider-action', (payload, identity) => {
261
- * console.log('Action dispatched by client: ', identity);
262
- * console.log('Payload sent in dispatch: ', payload);
263
- *
264
- * return { echo: payload };
265
- * });
266
- * })();
267
- * ```
268
- *
269
- * Channel Client:
270
- * ```js
271
- * (async ()=> {
272
- * const client = await fin.InterApplicationBus.Channel.connect('channelName');
273
- *
274
- * await client.register('client-action', (payload, identity) => {
275
- * console.log('Action dispatched by client: ', identity);
276
- * console.log('Payload sent in dispatch: ', payload);
277
- *
278
- * return { echo: payload };
279
- * });
280
- * })();
281
- * ```
282
- */
283
- register(topic: string, listener: ChannelAction): boolean;
284
- }
285
- export {};