@openfin/core 30.73.28 → 31.74.2

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 (160) hide show
  1. package/LICENSE.md +4 -0
  2. package/package.json +2 -2
  3. package/src/OpenFin.d.ts +1929 -407
  4. package/src/OpenFin.js +0 -2
  5. package/src/api/api-exposer/api-consumer.d.ts +28 -0
  6. package/src/api/api-exposer/api-consumer.js +28 -0
  7. package/src/api/api-exposer/api-exposer.d.ts +35 -0
  8. package/src/api/api-exposer/api-exposer.js +38 -0
  9. package/src/api/api-exposer/decorators.d.ts +10 -0
  10. package/src/api/api-exposer/decorators.js +18 -0
  11. package/src/api/api-exposer/index.d.ts +4 -0
  12. package/src/api/api-exposer/index.js +20 -0
  13. package/src/api/api-exposer/strategies/index.d.ts +1 -0
  14. package/src/api/api-exposer/strategies/index.js +17 -0
  15. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +14 -0
  16. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +20 -0
  17. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +20 -0
  18. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +23 -0
  19. package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +2 -0
  20. package/src/api/api-exposer/strategies/openfin-channels/index.js +18 -0
  21. package/src/api/application/Factory.d.ts +1 -0
  22. package/src/api/application/Factory.js +2 -2
  23. package/src/api/application/Instance.d.ts +2 -1
  24. package/src/api/application/Instance.js +1 -0
  25. package/src/api/base.d.ts +4 -4
  26. package/src/api/clipboard/index.d.ts +1 -0
  27. package/src/api/clipboard/index.js +1 -0
  28. package/src/api/events/application.d.ts +22 -22
  29. package/src/api/events/base.d.ts +6 -9
  30. package/src/api/events/channel.d.ts +5 -5
  31. package/src/api/events/emitterMap.d.ts +1 -1
  32. package/src/api/events/externalApplication.d.ts +3 -3
  33. package/src/api/events/frame.d.ts +5 -5
  34. package/src/api/events/globalHotkey.d.ts +3 -3
  35. package/src/api/events/platform.d.ts +6 -7
  36. package/src/api/events/system.d.ts +20 -21
  37. package/src/api/events/typedEventEmitter.d.ts +1 -1
  38. package/src/api/events/view.d.ts +17 -14
  39. package/src/api/events/webcontents.d.ts +40 -18
  40. package/src/api/events/window.d.ts +65 -57
  41. package/src/api/external-application/Instance.d.ts +1 -1
  42. package/src/api/fin.d.ts +2 -2
  43. package/src/api/frame/Instance.d.ts +2 -2
  44. package/src/api/global-hotkey/index.d.ts +1 -1
  45. package/src/api/interappbus/channel/channel.d.ts +5 -5
  46. package/src/api/interappbus/channel/channel.js +3 -3
  47. package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
  48. package/src/api/interappbus/channel/channels-docs.js +7 -0
  49. package/src/api/interappbus/channel/client.d.ts +5 -4
  50. package/src/api/interappbus/channel/client.js +24 -17
  51. package/src/api/interappbus/channel/connection-manager.d.ts +2 -2
  52. package/src/api/interappbus/channel/connection-manager.js +12 -12
  53. package/src/api/interappbus/channel/index.d.ts +3 -3
  54. package/src/api/interappbus/channel/index.js +6 -8
  55. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
  56. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +2 -2
  57. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +2 -2
  58. package/src/api/interappbus/channel/protocols/combined/strategy.js +5 -5
  59. package/src/api/interappbus/channel/protocols/index.d.ts +7 -4
  60. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +1 -1
  61. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
  62. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
  63. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +1 -1
  64. package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
  65. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +4 -4
  66. package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -3
  67. package/src/api/interappbus/channel/provider.d.ts +6 -6
  68. package/src/api/interappbus/channel/provider.js +24 -24
  69. package/src/api/interappbus/index.d.ts +1 -1
  70. package/src/api/interop/Factory.d.ts +1 -2
  71. package/src/api/interop/Factory.js +20 -4
  72. package/src/api/interop/InteropBroker.d.ts +16 -48
  73. package/src/api/interop/InteropBroker.js +38 -48
  74. package/src/api/interop/InteropClient.d.ts +10 -9
  75. package/src/api/interop/InteropClient.js +9 -8
  76. package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
  77. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +2 -1
  78. package/src/api/interop/fdc3/PrivateChannelClient.js +15 -7
  79. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +16 -2
  80. package/src/api/interop/fdc3/PrivateChannelProvider.js +80 -21
  81. package/src/api/interop/fdc3/fdc3-1.2.js +27 -12
  82. package/src/api/interop/fdc3/fdc3-2.0.d.ts +13 -12
  83. package/src/api/interop/fdc3/fdc3-2.0.js +33 -26
  84. package/src/api/interop/fdc3/fdc3.d.ts +4 -5
  85. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  86. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  87. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +3 -3
  88. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +5 -5
  89. package/src/api/interop/fdc3/utils.d.ts +17 -0
  90. package/src/api/interop/fdc3/utils.js +52 -18
  91. package/src/api/interop/fdc3/versions.d.ts +1 -0
  92. package/src/api/interop/fdc3/versions.js +2 -0
  93. package/src/api/interop/utils.d.ts +0 -1
  94. package/src/api/interop/utils.js +1 -9
  95. package/src/api/me.d.ts +4 -4
  96. package/src/api/platform/Factory.d.ts +6 -1
  97. package/src/api/platform/Factory.js +10 -9
  98. package/src/api/platform/Instance.d.ts +5 -3
  99. package/src/api/platform/Instance.js +5 -3
  100. package/src/api/platform/common-utils.d.ts +1 -1
  101. package/src/api/platform/layout/Factory.d.ts +5 -1
  102. package/src/api/platform/layout/Factory.js +15 -3
  103. package/src/api/platform/layout/Instance.d.ts +10 -4
  104. package/src/api/platform/layout/Instance.js +26 -1
  105. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +9 -0
  106. package/src/api/platform/layout/controllers/layout-content-cache.js +54 -0
  107. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +117 -0
  108. package/src/api/platform/layout/controllers/layout-entities-controller.js +270 -0
  109. package/src/api/platform/layout/controllers/splitter-controller.d.ts +1 -1
  110. package/src/api/platform/layout/entities/layout-entities.d.ts +144 -0
  111. package/src/api/platform/layout/entities/layout-entities.js +216 -0
  112. package/src/api/platform/layout/entities/shapes.d.ts +6 -0
  113. package/src/api/platform/layout/entities/shapes.js +2 -0
  114. package/src/api/platform/layout/layout.constants.d.ts +1 -0
  115. package/src/api/platform/layout/layout.constants.js +4 -0
  116. package/src/api/platform/layout/shapes.d.ts +4 -1
  117. package/src/api/platform/layout/utils/layout-traversal.d.ts +4 -0
  118. package/src/api/platform/layout/utils/layout-traversal.js +65 -0
  119. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
  120. package/src/api/platform/provider.d.ts +162 -0
  121. package/src/api/platform/provider.js +2 -0
  122. package/src/api/snapshot-source/Factory.d.ts +1 -0
  123. package/src/api/snapshot-source/Factory.js +1 -0
  124. package/src/api/snapshot-source/Instance.d.ts +1 -1
  125. package/src/api/system/index.d.ts +14 -484
  126. package/src/api/system/index.js +6 -476
  127. package/src/api/view/Instance.d.ts +20 -6
  128. package/src/api/view/Instance.js +48 -8
  129. package/src/api/webcontents/main.d.ts +18 -4
  130. package/src/api/window/Instance.d.ts +21 -1
  131. package/src/api/window/Instance.js +20 -0
  132. package/src/browser.js +1 -1
  133. package/src/environment/browser.d.ts +1 -1
  134. package/src/environment/environment.d.ts +1 -1
  135. package/src/environment/node-env.d.ts +1 -1
  136. package/src/environment/openfin-env.d.ts +1 -1
  137. package/src/mock.d.ts +1 -1
  138. package/src/mock.js +6 -3
  139. package/src/namespaces.d.ts +21 -0
  140. package/src/namespaces.js +24 -0
  141. package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -1
  142. package/src/shapes/protocol.d.ts +3 -3
  143. package/src/transport/fin_store.d.ts +1 -1
  144. package/src/transport/transport-errors.d.ts +7 -2
  145. package/src/transport/transport-errors.js +1 -2
  146. package/src/transport/transport.d.ts +11 -8
  147. package/src/transport/transport.js +12 -6
  148. package/src/transport/wire.d.ts +14 -13
  149. package/src/util/channel-api-relay.d.ts +13 -0
  150. package/src/util/channel-api-relay.js +37 -0
  151. package/src/util/errors.d.ts +2 -2
  152. package/src/util/http.js +4 -2
  153. package/src/util/inaccessibleObject.d.ts +2 -0
  154. package/src/util/inaccessibleObject.js +49 -0
  155. package/src/util/lazy.d.ts +16 -0
  156. package/src/util/lazy.js +26 -0
  157. package/src/util/promises.d.ts +1 -1
  158. package/src/util/reversible-map.d.ts +11 -0
  159. package/src/util/reversible-map.js +49 -0
  160. package/src/util/utilTypes.d.ts +1 -1
@@ -1,11 +1,26 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
- import Transport from '../../transport/transport';
3
+ import { Transport } from '../../transport/transport';
4
4
  import { BaseEvent } from '../events/base';
5
- declare type ImageFormat = 'bmp' | 'jpg' | 'png';
5
+ /**
6
+ * Configuration for page capture.
7
+ */
6
8
  export interface CapturePageOptions {
9
+ /**
10
+ * The area of the window to be captured.
11
+ */
7
12
  area?: OpenFin.Rectangle;
8
- format?: ImageFormat;
13
+ /**
14
+ * @defaultValue 'png'
15
+ *
16
+ * The format of the captured image. Can be 'png', 'jpg', or 'bmp'.
17
+ */
18
+ format?: 'bmp' | 'jpg' | 'png';
19
+ /**
20
+ * @defaultValue 100
21
+ *
22
+ * Quality of JPEG image. Between 0 - 100.
23
+ */
9
24
  quality?: number;
10
25
  }
11
26
  export declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
@@ -35,4 +50,3 @@ export declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
35
50
  inspectServiceWorker(): Promise<void>;
36
51
  showPopupWindow(options: OpenFin.PopupOptions): Promise<OpenFin.PopupResult>;
37
52
  }
38
- export {};
@@ -1,7 +1,8 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
- import Transport from '../../transport/transport';
2
+ import { Transport } from '../../transport/transport';
3
3
  import { WebContents } from '../webcontents/main';
4
4
  /**
5
+ * @PORTED
5
6
  * @typedef { object } Margins
6
7
  * @property { string } [marginType]
7
8
  * Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
@@ -13,11 +14,13 @@ import { WebContents } from '../webcontents/main';
13
14
  * @property { number } [right] The right margin of the printed web page, in pixels.
14
15
  */
15
16
  /**
17
+ * @PORTED
16
18
  * @typedef { object } Dpi
17
19
  * @property { number } [horizontal] The horizontal dpi
18
20
  * @property { number } [vertical] The vertical dpi
19
21
  */
20
22
  /**
23
+ * @PORTED
21
24
  * @typedef { object } PrintOptions
22
25
  * @property { boolean } [silent=false] Don't ask user for print settings.
23
26
  * @property { boolean } [printBackground=false] Prints the background color and image of the web page.
@@ -34,6 +37,7 @@ import { WebContents } from '../webcontents/main';
34
37
  * @property { Dpi } [dpi] Set dpi for the printed web page
35
38
  */
36
39
  /**
40
+ * @REMOVED
37
41
  * PrinterInfo interface
38
42
  * @typedef { object } PrinterInfo
39
43
  * @property { string } name Printer Name
@@ -42,12 +46,14 @@ import { WebContents } from '../webcontents/main';
42
46
  * @property { boolean } isDefault Indicates that system's default printer
43
47
  */
44
48
  /**
49
+ * @REMOVED
45
50
  * SharedWorkerInfo interface
46
51
  * @typedef { object } SharedWorkerInfo
47
52
  * @property { string } id The unique id of the shared worker.
48
53
  * @property { string } url The url of the shared worker.
49
54
  */
50
55
  /**
56
+ * @PORTED
51
57
  * ContentCreationRule interface
52
58
  * @typedef { object } ContentCreationRule
53
59
  * @property { string } behavior 'view' | 'window' | 'browser' | 'block'
@@ -55,6 +61,7 @@ import { WebContents } from '../webcontents/main';
55
61
  * @property { object } options Window creation options or View creation options.
56
62
  */
57
63
  /**
64
+ * @PORTED
58
65
  * @typedef {object} Window~options
59
66
  * @summary Window creation options.
60
67
  * @desc This is the options object required by {@link Window.create Window.create}.
@@ -358,31 +365,37 @@ import { WebContents } from '../webcontents/main';
358
365
  * _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
359
366
  */
360
367
  /**
368
+ * @PORTED
361
369
  * @typedef {Object} ViewVisibility _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
362
370
  * @property {ShowViewsOnWindowResize} [showViewsOnWindowResize] Enables views to be shown when a Platform Window is being resized by the user.
363
371
  * @property {ShowViewsOnSplitterDrag} [showViewsOnSplitterDrag] Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
364
372
  * @property {ShowViewsOnTabDrag} [showViewsOnTabDrag] _Supported on Windows Operating Systems only_. Allows views to be shown when the user is dragging a tab around a layout.
365
373
  */
366
374
  /**
375
+ * @PORTED
367
376
  * @typedef {Object} ShowViewsOnWindowResize _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
368
377
  * @property {boolean} [enabled=false] Enables or disables showing Views when a Platform Window is being resized.
369
378
  * @property {number} [paintIntervalMs=0] Number of miliseconds to wait between view repaints.
370
379
  */
371
380
  /**
381
+ * @REMOVED
372
382
  * @typedef {Object} ShowViewsOnSplitterDrag _Platform Windows Only_. Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
373
383
  * @property {boolean} [enabled=false] Enables or disables showing views when the layout splitter is being dragged.
374
384
  */
375
385
  /**
386
+ * @REMOVED
376
387
  * @typedef {Object} ShowViewsOnTabDrag _Platform Windows Only_. Allows views to be shown when the user is manipulating the layout by repositioning a tab.
377
388
  * @property {boolean} [enabled=false] Enables or disables showing views when a tab is being dragged.
378
389
  */
379
390
  /**
391
+ * @PORTED
380
392
  * @typedef {object} CapturePageOptions
381
393
  * @property { Area } [area] The area of the window to be captured.
382
394
  * @property { string } [format='png'] The format of the captured image. Can be 'png', 'jpg', or 'bmp'.
383
395
  * @property { number } [quality=100] Number representing quality of JPEG image only. Between 0 - 100.
384
396
  */
385
397
  /**
398
+ * @PORTED
386
399
  * @typedef { object } Area
387
400
  * @property { number } height Area's height
388
401
  * @property { number } width Area's width
@@ -390,6 +403,7 @@ import { WebContents } from '../webcontents/main';
390
403
  * @property { number } y Y coordinate of area's starting point
391
404
  */
392
405
  /**
406
+ * @PORTED
393
407
  * @typedef {object} FindInPageOptions
394
408
  * @property {boolean} [forward=true] Whether to search forward or backward.
395
409
  * @property {boolean} [findNext=false] Whether to begin a new text finding session. Should be true for first requests, and false for subsequent requests. Defaults to false.
@@ -400,18 +414,21 @@ import { WebContents } from '../webcontents/main';
400
414
  * lowercase or non-letter. Accepts several other intra-word matches.
401
415
  */
402
416
  /**
417
+ * @REMOVED
403
418
  * @typedef {object} Transition
404
419
  * @property {Opacity} opacity - The Opacity transition
405
420
  * @property {Position} position - The Position transition
406
421
  * @property {Size} size - The Size transition
407
422
  */
408
423
  /**
424
+ * @PORTED
409
425
  * @typedef {object} TransitionOptions
410
426
  * @property {boolean} interrupt - This option interrupts the current animation. When false it pushes
411
427
  this animation onto the end of the animation queue.
412
428
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
413
429
  */
414
430
  /**
431
+ * @PORTED
415
432
  * @typedef {object} Size
416
433
  * @property {number} duration - The total time in milliseconds this transition should take.
417
434
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
@@ -419,6 +436,7 @@ this animation onto the end of the animation queue.
419
436
  * @property {number} height - Optional if width is present. Defaults to the window's current height.
420
437
  */
421
438
  /**
439
+ * @PORTED
422
440
  * @typedef {object} Position
423
441
  * @property {number} duration - The total time in milliseconds this transition should take.
424
442
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
@@ -426,12 +444,14 @@ this animation onto the end of the animation queue.
426
444
  * @property {number} top - Defaults to the window's current top position in virtual screen coordinates.
427
445
  */
428
446
  /**
447
+ * @PORTED
429
448
  * @typedef {object} Opacity
430
449
  * @property {number} duration - The total time in milliseconds this transition should take.
431
450
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
432
451
  * @property {number} opacity - This value is clamped from 0.0 to 1.0.
433
452
  */
434
453
  /**
454
+ * @REMOVED
435
455
  * Bounds is a interface that has the properties of height,
436
456
  * width, left, top which are all numbers
437
457
  * @typedef { object } Bounds
@@ -9,6 +9,7 @@ const application_1 = require("../application");
9
9
  const main_1 = require("../webcontents/main");
10
10
  const view_1 = require("../view");
11
11
  /**
12
+ * @PORTED
12
13
  * @typedef { object } Margins
13
14
  * @property { string } [marginType]
14
15
  * Can be `default`, `none`, `printableArea`, or `custom`. If `custom` is chosen,
@@ -20,11 +21,13 @@ const view_1 = require("../view");
20
21
  * @property { number } [right] The right margin of the printed web page, in pixels.
21
22
  */
22
23
  /**
24
+ * @PORTED
23
25
  * @typedef { object } Dpi
24
26
  * @property { number } [horizontal] The horizontal dpi
25
27
  * @property { number } [vertical] The vertical dpi
26
28
  */
27
29
  /**
30
+ * @PORTED
28
31
  * @typedef { object } PrintOptions
29
32
  * @property { boolean } [silent=false] Don't ask user for print settings.
30
33
  * @property { boolean } [printBackground=false] Prints the background color and image of the web page.
@@ -41,6 +44,7 @@ const view_1 = require("../view");
41
44
  * @property { Dpi } [dpi] Set dpi for the printed web page
42
45
  */
43
46
  /**
47
+ * @REMOVED
44
48
  * PrinterInfo interface
45
49
  * @typedef { object } PrinterInfo
46
50
  * @property { string } name Printer Name
@@ -49,12 +53,14 @@ const view_1 = require("../view");
49
53
  * @property { boolean } isDefault Indicates that system's default printer
50
54
  */
51
55
  /**
56
+ * @REMOVED
52
57
  * SharedWorkerInfo interface
53
58
  * @typedef { object } SharedWorkerInfo
54
59
  * @property { string } id The unique id of the shared worker.
55
60
  * @property { string } url The url of the shared worker.
56
61
  */
57
62
  /**
63
+ * @PORTED
58
64
  * ContentCreationRule interface
59
65
  * @typedef { object } ContentCreationRule
60
66
  * @property { string } behavior 'view' | 'window' | 'browser' | 'block'
@@ -62,6 +68,7 @@ const view_1 = require("../view");
62
68
  * @property { object } options Window creation options or View creation options.
63
69
  */
64
70
  /**
71
+ * @PORTED
65
72
  * @typedef {object} Window~options
66
73
  * @summary Window creation options.
67
74
  * @desc This is the options object required by {@link Window.create Window.create}.
@@ -365,31 +372,37 @@ const view_1 = require("../view");
365
372
  * _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
366
373
  */
367
374
  /**
375
+ * @PORTED
368
376
  * @typedef {Object} ViewVisibility _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
369
377
  * @property {ShowViewsOnWindowResize} [showViewsOnWindowResize] Enables views to be shown when a Platform Window is being resized by the user.
370
378
  * @property {ShowViewsOnSplitterDrag} [showViewsOnSplitterDrag] Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
371
379
  * @property {ShowViewsOnTabDrag} [showViewsOnTabDrag] _Supported on Windows Operating Systems only_. Allows views to be shown when the user is dragging a tab around a layout.
372
380
  */
373
381
  /**
382
+ * @PORTED
374
383
  * @typedef {Object} ShowViewsOnWindowResize _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
375
384
  * @property {boolean} [enabled=false] Enables or disables showing Views when a Platform Window is being resized.
376
385
  * @property {number} [paintIntervalMs=0] Number of miliseconds to wait between view repaints.
377
386
  */
378
387
  /**
388
+ * @REMOVED
379
389
  * @typedef {Object} ShowViewsOnSplitterDrag _Platform Windows Only_. Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
380
390
  * @property {boolean} [enabled=false] Enables or disables showing views when the layout splitter is being dragged.
381
391
  */
382
392
  /**
393
+ * @REMOVED
383
394
  * @typedef {Object} ShowViewsOnTabDrag _Platform Windows Only_. Allows views to be shown when the user is manipulating the layout by repositioning a tab.
384
395
  * @property {boolean} [enabled=false] Enables or disables showing views when a tab is being dragged.
385
396
  */
386
397
  /**
398
+ * @PORTED
387
399
  * @typedef {object} CapturePageOptions
388
400
  * @property { Area } [area] The area of the window to be captured.
389
401
  * @property { string } [format='png'] The format of the captured image. Can be 'png', 'jpg', or 'bmp'.
390
402
  * @property { number } [quality=100] Number representing quality of JPEG image only. Between 0 - 100.
391
403
  */
392
404
  /**
405
+ * @PORTED
393
406
  * @typedef { object } Area
394
407
  * @property { number } height Area's height
395
408
  * @property { number } width Area's width
@@ -397,6 +410,7 @@ const view_1 = require("../view");
397
410
  * @property { number } y Y coordinate of area's starting point
398
411
  */
399
412
  /**
413
+ * @PORTED
400
414
  * @typedef {object} FindInPageOptions
401
415
  * @property {boolean} [forward=true] Whether to search forward or backward.
402
416
  * @property {boolean} [findNext=false] Whether to begin a new text finding session. Should be true for first requests, and false for subsequent requests. Defaults to false.
@@ -407,18 +421,21 @@ const view_1 = require("../view");
407
421
  * lowercase or non-letter. Accepts several other intra-word matches.
408
422
  */
409
423
  /**
424
+ * @REMOVED
410
425
  * @typedef {object} Transition
411
426
  * @property {Opacity} opacity - The Opacity transition
412
427
  * @property {Position} position - The Position transition
413
428
  * @property {Size} size - The Size transition
414
429
  */
415
430
  /**
431
+ * @PORTED
416
432
  * @typedef {object} TransitionOptions
417
433
  * @property {boolean} interrupt - This option interrupts the current animation. When false it pushes
418
434
  this animation onto the end of the animation queue.
419
435
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
420
436
  */
421
437
  /**
438
+ * @PORTED
422
439
  * @typedef {object} Size
423
440
  * @property {number} duration - The total time in milliseconds this transition should take.
424
441
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
@@ -426,6 +443,7 @@ this animation onto the end of the animation queue.
426
443
  * @property {number} height - Optional if width is present. Defaults to the window's current height.
427
444
  */
428
445
  /**
446
+ * @PORTED
429
447
  * @typedef {object} Position
430
448
  * @property {number} duration - The total time in milliseconds this transition should take.
431
449
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
@@ -433,12 +451,14 @@ this animation onto the end of the animation queue.
433
451
  * @property {number} top - Defaults to the window's current top position in virtual screen coordinates.
434
452
  */
435
453
  /**
454
+ * @PORTED
436
455
  * @typedef {object} Opacity
437
456
  * @property {number} duration - The total time in milliseconds this transition should take.
438
457
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
439
458
  * @property {number} opacity - This value is clamped from 0.0 to 1.0.
440
459
  */
441
460
  /**
461
+ * @REMOVED
442
462
  * Bounds is a interface that has the properties of height,
443
463
  * width, left, top which are all numbers
444
464
  * @typedef { object } Bounds
package/src/browser.js CHANGED
@@ -16,7 +16,7 @@ async function getRemoteConnectionPayload(fin, uuid = `browser-connection-${Math
16
16
  }
17
17
  exports.getRemoteConnectionPayload = getRemoteConnectionPayload;
18
18
  async function remoteConnect({ uuid, token, address, interopProviderId, withInterop }) {
19
- const wire = new transport_1.default(websocket_1.default, new browser_1.BrowserEnvironment(), {
19
+ const wire = new transport_1.Transport(websocket_1.default, new browser_1.BrowserEnvironment(), {
20
20
  uuid,
21
21
  name: uuid
22
22
  });
@@ -1,7 +1,7 @@
1
1
  import type * as OpenFin from '../OpenFin';
2
2
  import { NewConnectConfig } from '../transport/wire';
3
3
  import { ChildContentOptions, Environment } from './environment';
4
- declare type EntityType = OpenFin.EntityType;
4
+ type EntityType = OpenFin.EntityType;
5
5
  export declare class BrowserEnvironment implements Environment {
6
6
  getManagerConstructor(): Promise<any>;
7
7
  getProviderInitializer(): Promise<any>;
@@ -1,6 +1,6 @@
1
1
  import type * as OpenFin from '../OpenFin';
2
2
  import { NewConnectConfig } from '../transport/wire';
3
- declare type EntityType = OpenFin.EntityType;
3
+ type EntityType = OpenFin.EntityType;
4
4
  export interface Environment {
5
5
  getManagerConstructor(): Promise<any>;
6
6
  getProviderInitializer(): Promise<any>;
@@ -1,7 +1,7 @@
1
1
  import type * as OpenFin from '../OpenFin';
2
2
  import { Environment } from './environment';
3
3
  import { NewConnectConfig } from '../transport/wire';
4
- declare type EntityType = OpenFin.EntityType;
4
+ type EntityType = OpenFin.EntityType;
5
5
  export default class NodeEnvironment implements Environment {
6
6
  getDefaultChannelOptions(): {
7
7
  create: OpenFin.ChannelCreateOptions;
@@ -2,7 +2,7 @@ import type * as OpenFin from '../OpenFin';
2
2
  import { ChildContentOptions, Environment } from './environment';
3
3
  import { NewConnectConfig } from '../transport/wire';
4
4
  import { BrowserEnvironment } from './browser';
5
- declare type EntityType = OpenFin.EntityType;
5
+ type EntityType = OpenFin.EntityType;
6
6
  export default class OpenFinEnvironment extends BrowserEnvironment implements Environment {
7
7
  #private;
8
8
  private raiseEventAsync;
package/src/mock.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type * as OpenFin from './OpenFin';
1
+ import * as OpenFin from './OpenFin';
2
2
  export declare const fin: OpenFin.Fin<"window" | "view">;
3
3
  export default OpenFin;
package/src/mock.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fin = void 0;
4
- const events_1 = require("events");
5
4
  /* eslint-disable import/prefer-default-export */
6
5
  /* eslint-disable spaced-comment */
7
6
  /* eslint-disable @typescript-eslint/triple-slash-reference */
8
7
  /* eslint-disable @typescript-eslint/explicit-function-return-type */
9
8
  /* eslint-disable class-methods-use-this */
10
- /// <reference path="../OpenFin.d.ts"/>
9
+ const events_1 = require("events");
10
+ const OpenFin = require("./OpenFin");
11
11
  const fin_1 = require("./api/fin");
12
12
  const transport_1 = require("./transport/transport");
13
13
  const me_1 = require("./api/me");
@@ -24,6 +24,9 @@ class MockWire extends events_1.EventEmitter {
24
24
  shutdown() {
25
25
  throw new Error('You are not running in OpenFin.');
26
26
  }
27
+ getPort() {
28
+ throw new Error('This transport has no port');
29
+ }
27
30
  // eslint-disable-next-line no-useless-constructor
28
31
  constructor() {
29
32
  super();
@@ -85,7 +88,7 @@ class MockEnvironment {
85
88
  exports.fin = ((typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.fin)) ||
86
89
  (() => {
87
90
  const environment = new MockEnvironment();
88
- const transport = new transport_1.default(MockWire, environment, {
91
+ const transport = new transport_1.Transport(MockWire, environment, {
89
92
  uuid: '',
90
93
  name: ''
91
94
  });
@@ -0,0 +1,21 @@
1
+ export * as OpenFin from './OpenFin';
2
+ export * as Application from './api/application';
3
+ export * as ExternalApplication from './api/external-application';
4
+ export * as Frame from './api/frame';
5
+ export * as Interop from './api/interop';
6
+ export * as InteropBroker from './api/interop/InteropBroker';
7
+ export * as InteropClient from './api/interop/InteropClient';
8
+ export * as InterApplicationBus from './api/interappbus';
9
+ export * as Channel from './api/interappbus/channel';
10
+ export * as ChannelProvider from './api/interappbus/channel/provider';
11
+ export * as ChannelClient from './api/interappbus/channel/client';
12
+ export * as Platform from './api/platform';
13
+ export * as PlatformProvider from './api/platform/provider';
14
+ export * as Layout from './api/platform/layout';
15
+ export * as View from './api/view';
16
+ export * as Window from './api/window';
17
+ export * as SnapshotSource from './api/snapshot-source';
18
+ export * as GlobalHotkey from './api/global-hotkey';
19
+ export * as Clipboard from './api/clipboard';
20
+ export * as Fin from './api/fin';
21
+ export * as System from './api/system';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.System = exports.Fin = exports.Clipboard = exports.GlobalHotkey = exports.SnapshotSource = exports.Window = exports.View = exports.Layout = exports.PlatformProvider = exports.Platform = exports.ChannelClient = exports.ChannelProvider = exports.Channel = exports.InterApplicationBus = exports.InteropClient = exports.InteropBroker = exports.Interop = exports.Frame = exports.ExternalApplication = exports.Application = exports.OpenFin = void 0;
4
+ exports.OpenFin = require("./OpenFin");
5
+ exports.Application = require("./api/application");
6
+ exports.ExternalApplication = require("./api/external-application");
7
+ exports.Frame = require("./api/frame");
8
+ exports.Interop = require("./api/interop");
9
+ exports.InteropBroker = require("./api/interop/InteropBroker");
10
+ exports.InteropClient = require("./api/interop/InteropClient");
11
+ exports.InterApplicationBus = require("./api/interappbus");
12
+ exports.Channel = require("./api/interappbus/channel");
13
+ exports.ChannelProvider = require("./api/interappbus/channel/provider");
14
+ exports.ChannelClient = require("./api/interappbus/channel/client");
15
+ exports.Platform = require("./api/platform");
16
+ exports.PlatformProvider = require("./api/platform/provider");
17
+ exports.Layout = require("./api/platform/layout");
18
+ exports.View = require("./api/view");
19
+ exports.Window = require("./api/window");
20
+ exports.SnapshotSource = require("./api/snapshot-source");
21
+ exports.GlobalHotkey = require("./api/global-hotkey");
22
+ exports.Clipboard = require("./api/clipboard");
23
+ exports.Fin = require("./api/fin");
24
+ exports.System = require("./api/system");
@@ -1 +1 @@
1
- export declare type ERROR_BOX_TYPES = 'OF_error_box:app_initialization' | 'OF_error_box:main_process' | 'OF_error_box:renderer_crash';
1
+ export type ERROR_BOX_TYPES = 'OF_error_box:app_initialization' | 'OF_error_box:main_process' | 'OF_error_box:renderer_crash';
@@ -149,12 +149,12 @@ export interface ProtocolMap extends ProtocolMapBase {
149
149
  response: OpenFin.PrinterInfo[];
150
150
  };
151
151
  }
152
- declare type ApiCall<Request, Response> = {
152
+ type ApiCall<Request, Response> = {
153
153
  request: Request;
154
154
  response: Response;
155
155
  };
156
- declare type VoidCall = ApiCall<void, void>;
157
- declare type IdentityCall<AdditionalPayload = {}, Response = void> = ApiCall<AdditionalPayload & OpenFin.Identity, Response>;
156
+ type VoidCall = ApiCall<void, void>;
157
+ type IdentityCall<AdditionalPayload = {}, Response = void> = ApiCall<AdditionalPayload & OpenFin.Identity, Response>;
158
158
  interface ProtocolMapBase {
159
159
  [action: string]: {
160
160
  request: any;
@@ -1,4 +1,4 @@
1
1
  import Fin from '../api/fin';
2
- import Transport from './transport';
2
+ import { Transport } from './transport';
3
3
  export declare function registerFin(wire: Transport, fin: Fin): void;
4
4
  export declare function getFin(wire: Transport): Fin;
@@ -1,4 +1,5 @@
1
- export declare type ReadyState = 'CONNECTING' | 'OPEN' | 'CLOSING' | 'CLOSED';
1
+ import { ErrorPlainObject } from '../util/errors';
2
+ export type ReadyState = 'CONNECTING' | 'OPEN' | 'CLOSING' | 'CLOSED';
2
3
  export declare class DisconnectedError extends Error {
3
4
  constructor(readyState: ReadyState);
4
5
  readyState: ReadyState;
@@ -13,6 +14,10 @@ export declare class NotImplementedError extends Error {
13
14
  }
14
15
  export declare class NotSupportedError extends Error {
15
16
  }
17
+ export type RuntimeErrorPayload = {
18
+ reason: string;
19
+ error?: ErrorPlainObject;
20
+ };
16
21
  export declare class RuntimeError extends Error {
17
- constructor(data: any);
22
+ constructor(payload: RuntimeErrorPayload);
18
23
  }
@@ -24,8 +24,7 @@ class NotSupportedError extends Error {
24
24
  }
25
25
  exports.NotSupportedError = NotSupportedError;
26
26
  class RuntimeError extends Error {
27
- constructor(data) {
28
- const payload = data.payload || data;
27
+ constructor(payload) {
29
28
  const { reason, error } = payload;
30
29
  super(reason);
31
30
  this.name = 'RuntimeError';
@@ -7,9 +7,10 @@ import EventAggregator from '../api/events/eventAggregator';
7
7
  import { EntityTypeHelpers } from '../api/me';
8
8
  import { ProtocolMap } from '../shapes/protocol';
9
9
  import { NamedEvent } from '../api/events/base';
10
- declare type EntityType = OpenFin.EntityType;
11
- export declare type MessageHandler = (data: any) => boolean;
12
- declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
10
+ import { ErrorPlainObject } from '../util/errors';
11
+ type EntityType = OpenFin.EntityType;
12
+ export type MessageHandler = (data: any) => boolean;
13
+ export declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
13
14
  #private;
14
15
  protected wireListeners: Map<number, {
15
16
  resolve: Function;
@@ -39,7 +40,6 @@ declare class Transport<MeType extends EntityType = EntityType> extends EventEmi
39
40
  protected onmessage(data: Message<Payload>): void;
40
41
  protected handleMessage(data: Message<Payload>): boolean;
41
42
  }
42
- export default Transport;
43
43
  export interface Message<T> {
44
44
  action: string;
45
45
  payload: T;
@@ -49,11 +49,14 @@ export interface EventMessage extends Message<NamedEvent> {
49
49
  action: 'process-desktop-event';
50
50
  payload: NamedEvent;
51
51
  }
52
- export interface Payload {
53
- success: boolean;
54
- data: any;
55
- }
52
+ export type Payload<Success extends boolean = boolean, Data = any> = {
53
+ success: Success;
54
+ data: Success extends true ? Data : never;
55
+ reason: Success extends false ? string : never;
56
+ error?: Success extends false ? ErrorPlainObject | undefined : never;
57
+ };
56
58
  export interface AuthorizationPayload {
57
59
  token: string;
58
60
  file: string;
59
61
  }
62
+ export {};
@@ -12,6 +12,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
12
12
  };
13
13
  var _Transport_wire;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.Transport = void 0;
15
16
  const events_1 = require("events");
16
17
  const wire_1 = require("./wire");
17
18
  const transport_errors_1 = require("./transport-errors");
@@ -31,11 +32,8 @@ class Transport extends events_1.EventEmitter {
31
32
  };
32
33
  // This function is only used in our tests.
33
34
  this.getPort = () => {
34
- if (this.environment.constructor.name !== 'NodeEnvironment') {
35
- throw new transport_errors_1.NotImplementedError('Not Implemented');
36
- }
37
35
  const wire = __classPrivateFieldGet(this, _Transport_wire, "f");
38
- return wire.wire.url.split(':').slice(-1)[0];
36
+ return wire.getPort();
39
37
  };
40
38
  __classPrivateFieldSet(this, _Transport_wire, new WireType(this.onmessage.bind(this)), "f");
41
39
  this.environment = environment;
@@ -168,7 +166,15 @@ class Transport extends events_1.EventEmitter {
168
166
  reject(new transport_errors_1.NoAckError(data.action));
169
167
  }
170
168
  else if (!('payload' in data)) {
171
- reject(new transport_errors_1.RuntimeError(data));
169
+ // I'm not sure when this code would actually run, but passing in something that doeesn't have a reason to the runtimeerror constructor will not end well.
170
+ // @ts-expect-error
171
+ if (typeof data.reason === 'string') {
172
+ reject(new transport_errors_1.RuntimeError(data));
173
+ }
174
+ else {
175
+ console.warn('Received invalid response from core', data);
176
+ reject(new Error('Invalid response'));
177
+ }
172
178
  }
173
179
  else if (!data.payload.success) {
174
180
  reject(new transport_errors_1.RuntimeError(data.payload));
@@ -181,5 +187,5 @@ class Transport extends events_1.EventEmitter {
181
187
  return true;
182
188
  }
183
189
  }
190
+ exports.Transport = Transport;
184
191
  _Transport_wire = new WeakMap();
185
- exports.default = Transport;