@openfin/core 30.73.27 → 30.74.6

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 (127) hide show
  1. package/LICENSE.md +4 -0
  2. package/package.json +2 -2
  3. package/src/OpenFin.d.ts +1726 -189
  4. package/src/OpenFin.js +3 -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 +1 -0
  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 +2 -2
  26. package/src/api/clipboard/index.d.ts +1 -0
  27. package/src/api/clipboard/index.js +1 -0
  28. package/src/api/events/base.d.ts +0 -3
  29. package/src/api/events/platform.d.ts +4 -5
  30. package/src/api/events/system.d.ts +5 -6
  31. package/src/api/events/view.d.ts +6 -3
  32. package/src/api/events/webcontents.d.ts +25 -3
  33. package/src/api/events/window.d.ts +21 -13
  34. package/src/api/external-application/Instance.d.ts +1 -1
  35. package/src/api/fin.d.ts +1 -1
  36. package/src/api/frame/Instance.d.ts +1 -1
  37. package/src/api/global-hotkey/index.d.ts +1 -1
  38. package/src/api/interappbus/channel/channel.d.ts +1 -1
  39. package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
  40. package/src/api/interappbus/channel/channels-docs.js +7 -0
  41. package/src/api/interappbus/channel/client.d.ts +3 -2
  42. package/src/api/interappbus/channel/client.js +12 -5
  43. package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
  44. package/src/api/interappbus/channel/index.d.ts +1 -1
  45. package/src/api/interappbus/channel/index.js +6 -8
  46. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
  47. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
  48. package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
  49. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
  50. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
  51. package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
  52. package/src/api/interappbus/channel/provider.d.ts +1 -1
  53. package/src/api/interappbus/index.d.ts +1 -1
  54. package/src/api/interop/Factory.d.ts +1 -2
  55. package/src/api/interop/Factory.js +20 -4
  56. package/src/api/interop/InteropBroker.d.ts +16 -48
  57. package/src/api/interop/InteropBroker.js +39 -47
  58. package/src/api/interop/InteropClient.d.ts +10 -9
  59. package/src/api/interop/InteropClient.js +9 -8
  60. package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
  61. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +1 -0
  62. package/src/api/interop/fdc3/PrivateChannelClient.js +15 -7
  63. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +15 -1
  64. package/src/api/interop/fdc3/PrivateChannelProvider.js +80 -21
  65. package/src/api/interop/fdc3/fdc3-1.2.js +27 -12
  66. package/src/api/interop/fdc3/fdc3-2.0.d.ts +13 -12
  67. package/src/api/interop/fdc3/fdc3-2.0.js +33 -26
  68. package/src/api/interop/fdc3/fdc3.d.ts +4 -5
  69. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  70. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  71. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +1 -1
  72. package/src/api/interop/fdc3/utils.d.ts +17 -0
  73. package/src/api/interop/fdc3/utils.js +52 -18
  74. package/src/api/interop/fdc3/versions.d.ts +1 -0
  75. package/src/api/interop/fdc3/versions.js +2 -0
  76. package/src/api/me.d.ts +1 -1
  77. package/src/api/platform/Factory.d.ts +6 -1
  78. package/src/api/platform/Factory.js +5 -0
  79. package/src/api/platform/Instance.d.ts +5 -3
  80. package/src/api/platform/Instance.js +5 -3
  81. package/src/api/platform/layout/Factory.d.ts +4 -0
  82. package/src/api/platform/layout/Factory.js +15 -3
  83. package/src/api/platform/layout/Instance.d.ts +7 -1
  84. package/src/api/platform/layout/Instance.js +26 -1
  85. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +9 -0
  86. package/src/api/platform/layout/controllers/layout-content-cache.js +54 -0
  87. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +117 -0
  88. package/src/api/platform/layout/controllers/layout-entities-controller.js +270 -0
  89. package/src/api/platform/layout/entities/layout-entities.d.ts +144 -0
  90. package/src/api/platform/layout/entities/layout-entities.js +216 -0
  91. package/src/api/platform/layout/entities/shapes.d.ts +6 -0
  92. package/src/api/platform/layout/entities/shapes.js +2 -0
  93. package/src/api/platform/layout/layout.constants.d.ts +1 -0
  94. package/src/api/platform/layout/layout.constants.js +4 -0
  95. package/src/api/platform/layout/shapes.d.ts +3 -0
  96. package/src/api/platform/layout/utils/layout-traversal.d.ts +4 -0
  97. package/src/api/platform/layout/utils/layout-traversal.js +65 -0
  98. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
  99. package/src/api/platform/provider.d.ts +162 -0
  100. package/src/api/platform/provider.js +2 -0
  101. package/src/api/snapshot-source/Factory.d.ts +1 -0
  102. package/src/api/snapshot-source/Factory.js +1 -0
  103. package/src/api/snapshot-source/Instance.d.ts +1 -1
  104. package/src/api/system/index.d.ts +1 -471
  105. package/src/api/system/index.js +6 -476
  106. package/src/api/view/Instance.d.ts +24 -5
  107. package/src/api/view/Instance.js +53 -8
  108. package/src/api/webcontents/main.d.ts +18 -4
  109. package/src/api/window/Instance.d.ts +26 -1
  110. package/src/api/window/Instance.js +25 -0
  111. package/src/browser.js +1 -1
  112. package/src/mock.js +1 -1
  113. package/src/namespaces.d.ts +21 -0
  114. package/src/namespaces.js +24 -0
  115. package/src/transport/fin_store.d.ts +1 -1
  116. package/src/transport/transport-errors.d.ts +6 -1
  117. package/src/transport/transport-errors.js +1 -2
  118. package/src/transport/transport.d.ts +9 -6
  119. package/src/transport/transport.js +11 -2
  120. package/src/util/channel-api-relay.d.ts +13 -0
  121. package/src/util/channel-api-relay.js +37 -0
  122. package/src/util/inaccessibleObject.d.ts +2 -0
  123. package/src/util/inaccessibleObject.js +49 -0
  124. package/src/util/lazy.d.ts +16 -0
  125. package/src/util/lazy.js +26 -0
  126. package/src/util/reversible-map.d.ts +11 -0
  127. package/src/util/reversible-map.js +49 -0
@@ -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}.
@@ -127,6 +134,11 @@ import { WebContents } from '../webcontents/main';
127
134
  * The aspect ratio of width to height to enforce for the window. If this value is equal to or less than zero,
128
135
  * an aspect ratio will not be enforced.
129
136
  *
137
+ * @property {string} [autoplayPolicy="no-user-gesture-required"]
138
+ * Autoplay policy to apply to content in the window, can be
139
+ * `no-user-gesture-required`, `user-gesture-required`,
140
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
141
+ *
130
142
  * @property {boolean} [autoShow=true]
131
143
  * A flag to automatically show the window when it is created.
132
144
  *
@@ -358,31 +370,37 @@ import { WebContents } from '../webcontents/main';
358
370
  * _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
359
371
  */
360
372
  /**
373
+ * @PORTED
361
374
  * @typedef {Object} ViewVisibility _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
362
375
  * @property {ShowViewsOnWindowResize} [showViewsOnWindowResize] Enables views to be shown when a Platform Window is being resized by the user.
363
376
  * @property {ShowViewsOnSplitterDrag} [showViewsOnSplitterDrag] Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
364
377
  * @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
378
  */
366
379
  /**
380
+ * @PORTED
367
381
  * @typedef {Object} ShowViewsOnWindowResize _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
368
382
  * @property {boolean} [enabled=false] Enables or disables showing Views when a Platform Window is being resized.
369
383
  * @property {number} [paintIntervalMs=0] Number of miliseconds to wait between view repaints.
370
384
  */
371
385
  /**
386
+ * @REMOVED
372
387
  * @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
388
  * @property {boolean} [enabled=false] Enables or disables showing views when the layout splitter is being dragged.
374
389
  */
375
390
  /**
391
+ * @REMOVED
376
392
  * @typedef {Object} ShowViewsOnTabDrag _Platform Windows Only_. Allows views to be shown when the user is manipulating the layout by repositioning a tab.
377
393
  * @property {boolean} [enabled=false] Enables or disables showing views when a tab is being dragged.
378
394
  */
379
395
  /**
396
+ * @PORTED
380
397
  * @typedef {object} CapturePageOptions
381
398
  * @property { Area } [area] The area of the window to be captured.
382
399
  * @property { string } [format='png'] The format of the captured image. Can be 'png', 'jpg', or 'bmp'.
383
400
  * @property { number } [quality=100] Number representing quality of JPEG image only. Between 0 - 100.
384
401
  */
385
402
  /**
403
+ * @PORTED
386
404
  * @typedef { object } Area
387
405
  * @property { number } height Area's height
388
406
  * @property { number } width Area's width
@@ -390,6 +408,7 @@ import { WebContents } from '../webcontents/main';
390
408
  * @property { number } y Y coordinate of area's starting point
391
409
  */
392
410
  /**
411
+ * @PORTED
393
412
  * @typedef {object} FindInPageOptions
394
413
  * @property {boolean} [forward=true] Whether to search forward or backward.
395
414
  * @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 +419,21 @@ import { WebContents } from '../webcontents/main';
400
419
  * lowercase or non-letter. Accepts several other intra-word matches.
401
420
  */
402
421
  /**
422
+ * @REMOVED
403
423
  * @typedef {object} Transition
404
424
  * @property {Opacity} opacity - The Opacity transition
405
425
  * @property {Position} position - The Position transition
406
426
  * @property {Size} size - The Size transition
407
427
  */
408
428
  /**
429
+ * @PORTED
409
430
  * @typedef {object} TransitionOptions
410
431
  * @property {boolean} interrupt - This option interrupts the current animation. When false it pushes
411
432
  this animation onto the end of the animation queue.
412
433
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
413
434
  */
414
435
  /**
436
+ * @PORTED
415
437
  * @typedef {object} Size
416
438
  * @property {number} duration - The total time in milliseconds this transition should take.
417
439
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
@@ -419,6 +441,7 @@ this animation onto the end of the animation queue.
419
441
  * @property {number} height - Optional if width is present. Defaults to the window's current height.
420
442
  */
421
443
  /**
444
+ * @PORTED
422
445
  * @typedef {object} Position
423
446
  * @property {number} duration - The total time in milliseconds this transition should take.
424
447
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
@@ -426,12 +449,14 @@ this animation onto the end of the animation queue.
426
449
  * @property {number} top - Defaults to the window's current top position in virtual screen coordinates.
427
450
  */
428
451
  /**
452
+ * @PORTED
429
453
  * @typedef {object} Opacity
430
454
  * @property {number} duration - The total time in milliseconds this transition should take.
431
455
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
432
456
  * @property {number} opacity - This value is clamped from 0.0 to 1.0.
433
457
  */
434
458
  /**
459
+ * @REMOVED
435
460
  * Bounds is a interface that has the properties of height,
436
461
  * width, left, top which are all numbers
437
462
  * @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}.
@@ -134,6 +141,11 @@ const view_1 = require("../view");
134
141
  * The aspect ratio of width to height to enforce for the window. If this value is equal to or less than zero,
135
142
  * an aspect ratio will not be enforced.
136
143
  *
144
+ * @property {string} [autoplayPolicy="no-user-gesture-required"]
145
+ * Autoplay policy to apply to content in the window, can be
146
+ * `no-user-gesture-required`, `user-gesture-required`,
147
+ * `document-user-activation-required`. Defaults to `no-user-gesture-required`.
148
+ *
137
149
  * @property {boolean} [autoShow=true]
138
150
  * A flag to automatically show the window when it is created.
139
151
  *
@@ -365,31 +377,37 @@ const view_1 = require("../view");
365
377
  * _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
366
378
  */
367
379
  /**
380
+ * @PORTED
368
381
  * @typedef {Object} ViewVisibility _Platform Windows Only_. Controls behavior for showing views when they are being resized by the user.
369
382
  * @property {ShowViewsOnWindowResize} [showViewsOnWindowResize] Enables views to be shown when a Platform Window is being resized by the user.
370
383
  * @property {ShowViewsOnSplitterDrag} [showViewsOnSplitterDrag] Allows views to be shown when they are resized by the user dragging the splitter between layout stacks.
371
384
  * @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
385
  */
373
386
  /**
387
+ * @PORTED
374
388
  * @typedef {Object} ShowViewsOnWindowResize _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
375
389
  * @property {boolean} [enabled=false] Enables or disables showing Views when a Platform Window is being resized.
376
390
  * @property {number} [paintIntervalMs=0] Number of miliseconds to wait between view repaints.
377
391
  */
378
392
  /**
393
+ * @REMOVED
379
394
  * @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
395
  * @property {boolean} [enabled=false] Enables or disables showing views when the layout splitter is being dragged.
381
396
  */
382
397
  /**
398
+ * @REMOVED
383
399
  * @typedef {Object} ShowViewsOnTabDrag _Platform Windows Only_. Allows views to be shown when the user is manipulating the layout by repositioning a tab.
384
400
  * @property {boolean} [enabled=false] Enables or disables showing views when a tab is being dragged.
385
401
  */
386
402
  /**
403
+ * @PORTED
387
404
  * @typedef {object} CapturePageOptions
388
405
  * @property { Area } [area] The area of the window to be captured.
389
406
  * @property { string } [format='png'] The format of the captured image. Can be 'png', 'jpg', or 'bmp'.
390
407
  * @property { number } [quality=100] Number representing quality of JPEG image only. Between 0 - 100.
391
408
  */
392
409
  /**
410
+ * @PORTED
393
411
  * @typedef { object } Area
394
412
  * @property { number } height Area's height
395
413
  * @property { number } width Area's width
@@ -397,6 +415,7 @@ const view_1 = require("../view");
397
415
  * @property { number } y Y coordinate of area's starting point
398
416
  */
399
417
  /**
418
+ * @PORTED
400
419
  * @typedef {object} FindInPageOptions
401
420
  * @property {boolean} [forward=true] Whether to search forward or backward.
402
421
  * @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 +426,21 @@ const view_1 = require("../view");
407
426
  * lowercase or non-letter. Accepts several other intra-word matches.
408
427
  */
409
428
  /**
429
+ * @REMOVED
410
430
  * @typedef {object} Transition
411
431
  * @property {Opacity} opacity - The Opacity transition
412
432
  * @property {Position} position - The Position transition
413
433
  * @property {Size} size - The Size transition
414
434
  */
415
435
  /**
436
+ * @PORTED
416
437
  * @typedef {object} TransitionOptions
417
438
  * @property {boolean} interrupt - This option interrupts the current animation. When false it pushes
418
439
  this animation onto the end of the animation queue.
419
440
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
420
441
  */
421
442
  /**
443
+ * @PORTED
422
444
  * @typedef {object} Size
423
445
  * @property {number} duration - The total time in milliseconds this transition should take.
424
446
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
@@ -426,6 +448,7 @@ this animation onto the end of the animation queue.
426
448
  * @property {number} height - Optional if width is present. Defaults to the window's current height.
427
449
  */
428
450
  /**
451
+ * @PORTED
429
452
  * @typedef {object} Position
430
453
  * @property {number} duration - The total time in milliseconds this transition should take.
431
454
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
@@ -433,12 +456,14 @@ this animation onto the end of the animation queue.
433
456
  * @property {number} top - Defaults to the window's current top position in virtual screen coordinates.
434
457
  */
435
458
  /**
459
+ * @PORTED
436
460
  * @typedef {object} Opacity
437
461
  * @property {number} duration - The total time in milliseconds this transition should take.
438
462
  * @property {boolean} relative - Treat 'opacity' as absolute or as a delta. Defaults to false.
439
463
  * @property {number} opacity - This value is clamped from 0.0 to 1.0.
440
464
  */
441
465
  /**
466
+ * @REMOVED
442
467
  * Bounds is a interface that has the properties of height,
443
468
  * width, left, top which are all numbers
444
469
  * @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
  });
package/src/mock.js CHANGED
@@ -85,7 +85,7 @@ class MockEnvironment {
85
85
  exports.fin = ((typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.fin)) ||
86
86
  (() => {
87
87
  const environment = new MockEnvironment();
88
- const transport = new transport_1.default(MockWire, environment, {
88
+ const transport = new transport_1.Transport(MockWire, environment, {
89
89
  uuid: '',
90
90
  name: ''
91
91
  });
@@ -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,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,3 +1,4 @@
1
+ import { ErrorPlainObject } from '../util/errors';
1
2
  export declare type ReadyState = 'CONNECTING' | 'OPEN' | 'CLOSING' | 'CLOSED';
2
3
  export declare class DisconnectedError extends Error {
3
4
  constructor(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 declare 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
+ import { ErrorPlainObject } from '../util/errors';
10
11
  declare type EntityType = OpenFin.EntityType;
11
12
  export declare type MessageHandler = (data: any) => boolean;
12
- declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
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 declare 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");
@@ -168,7 +169,15 @@ class Transport extends events_1.EventEmitter {
168
169
  reject(new transport_errors_1.NoAckError(data.action));
169
170
  }
170
171
  else if (!('payload' in data)) {
171
- reject(new transport_errors_1.RuntimeError(data));
172
+ // 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.
173
+ // @ts-expect-error
174
+ if (typeof data.reason === 'string') {
175
+ reject(new transport_errors_1.RuntimeError(data));
176
+ }
177
+ else {
178
+ console.warn('Received invalid response from core', data);
179
+ reject(new Error('Invalid response'));
180
+ }
172
181
  }
173
182
  else if (!data.payload.success) {
174
183
  reject(new transport_errors_1.RuntimeError(data.payload));
@@ -181,5 +190,5 @@ class Transport extends events_1.EventEmitter {
181
190
  return true;
182
191
  }
183
192
  }
193
+ exports.Transport = Transport;
184
194
  _Transport_wire = new WeakMap();
185
- exports.default = Transport;
@@ -0,0 +1,13 @@
1
+ import type * as OpenFin from '../OpenFin';
2
+ /**
3
+ * @internal
4
+ * Create a channel relay for a given channel exposition, allowing a single provider to route
5
+ * actions to the designated clients.
6
+ *
7
+ * Designed to be used in conjunction with @expose
8
+ *
9
+ * @param channelProvider The channel provider to relay the actions on.
10
+ * @param config Determines which actions to relay. Please ensure action prefix matches the exposed api.
11
+ */
12
+ export declare const relayChannelClientApi: (channelProvider: OpenFin.ChannelProvider, relayId: string) => Promise<void>;
13
+ export declare const createRelayedDispatch: (client: OpenFin.ChannelClient, target: OpenFin.Identity, relayId: string, relayErrorMsg?: string) => OpenFin.ChannelClient['dispatch'];
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createRelayedDispatch = exports.relayChannelClientApi = void 0;
4
+ /**
5
+ * @internal
6
+ * Create a channel relay for a given channel exposition, allowing a single provider to route
7
+ * actions to the designated clients.
8
+ *
9
+ * Designed to be used in conjunction with @expose
10
+ *
11
+ * @param channelProvider The channel provider to relay the actions on.
12
+ * @param config Determines which actions to relay. Please ensure action prefix matches the exposed api.
13
+ */
14
+ const relayChannelClientApi = async (channelProvider, relayId) => {
15
+ channelProvider.register(`relay:${relayId}`, ({ action, target, payload }) => {
16
+ return channelProvider.dispatch(target, action, payload);
17
+ });
18
+ await Promise.resolve();
19
+ };
20
+ exports.relayChannelClientApi = relayChannelClientApi;
21
+ const createRelayedDispatch = (client, target, relayId, relayErrorMsg) => async (action, payload) => {
22
+ try {
23
+ return await client.dispatch(`relay:${relayId}`, {
24
+ action,
25
+ payload,
26
+ target
27
+ });
28
+ }
29
+ catch (e) {
30
+ if (e.message.includes('no longer connected') && relayErrorMsg) {
31
+ throw new Error(relayErrorMsg);
32
+ }
33
+ ;
34
+ throw e;
35
+ }
36
+ };
37
+ exports.createRelayedDispatch = createRelayedDispatch;
@@ -0,0 +1,2 @@
1
+ export declare function createUnusableObject(message: string): Record<any, never>;
2
+ export declare function createWarningObject<T extends {}>(message: string, obj: T): T;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createWarningObject = exports.createUnusableObject = void 0;
4
+ function createUnusableObject(message) {
5
+ const handle = () => {
6
+ throw new Error(message);
7
+ };
8
+ return new Proxy({}, {
9
+ apply: handle,
10
+ construct: handle,
11
+ defineProperty: handle,
12
+ deleteProperty: handle,
13
+ get: handle,
14
+ getOwnPropertyDescriptor: handle,
15
+ getPrototypeOf: handle,
16
+ has: handle,
17
+ isExtensible: handle,
18
+ ownKeys: handle,
19
+ preventExtensions: handle,
20
+ set: handle,
21
+ setPrototypeOf: handle
22
+ });
23
+ }
24
+ exports.createUnusableObject = createUnusableObject;
25
+ function createWarningObject(message, obj) {
26
+ return new Proxy(obj, {
27
+ get: (...args) => {
28
+ // eslint-disable-next-line no-console
29
+ console.warn(message);
30
+ return Reflect.get(...args);
31
+ },
32
+ set: (...args) => {
33
+ // eslint-disable-next-line no-console
34
+ console.warn(message);
35
+ return Reflect.set(...args);
36
+ },
37
+ getOwnPropertyDescriptor: (...args) => {
38
+ // eslint-disable-next-line no-console
39
+ console.warn(message);
40
+ return Reflect.getOwnPropertyDescriptor(...args);
41
+ },
42
+ ownKeys: (...args) => {
43
+ // eslint-disable-next-line no-console
44
+ console.warn(message);
45
+ return Reflect.ownKeys(...args);
46
+ }
47
+ });
48
+ }
49
+ exports.createWarningObject = createWarningObject;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Handy class for managing asynchronous dependencies of classes.
3
+ *
4
+ * Will call the producer function once and only once when getValue is called,
5
+ * returning the resultant value for every subsequent call.
6
+ */
7
+ export declare class Lazy<T> {
8
+ private producerFn;
9
+ constructor(producerFn: () => T);
10
+ private value;
11
+ /**
12
+ * Lazily get the value returned by the producer.
13
+ * @returns The value returned from the producer function
14
+ */
15
+ getValue(): T;
16
+ }