@openfin/core 30.73.27 → 31.74.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.
- package/LICENSE.md +4 -0
- package/package.json +2 -2
- package/src/OpenFin.d.ts +1664 -173
- package/src/api/application/Factory.d.ts +1 -0
- package/src/api/application/Factory.js +1 -0
- package/src/api/application/Instance.d.ts +2 -1
- package/src/api/application/Instance.js +1 -0
- package/src/api/base.d.ts +2 -2
- package/src/api/clipboard/index.d.ts +1 -0
- package/src/api/clipboard/index.js +1 -0
- package/src/api/events/platform.d.ts +4 -5
- package/src/api/events/system.d.ts +5 -6
- package/src/api/events/webcontents.d.ts +23 -3
- package/src/api/external-application/Instance.d.ts +1 -1
- package/src/api/fin.d.ts +1 -1
- package/src/api/frame/Instance.d.ts +1 -1
- package/src/api/global-hotkey/index.d.ts +1 -1
- package/src/api/interappbus/channel/channel.d.ts +1 -1
- package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
- package/src/api/interappbus/channel/channels-docs.js +7 -0
- package/src/api/interappbus/channel/client.d.ts +3 -2
- package/src/api/interappbus/channel/client.js +12 -5
- package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
- package/src/api/interappbus/channel/index.d.ts +1 -1
- package/src/api/interappbus/channel/index.js +5 -7
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
- package/src/api/interappbus/channel/provider.d.ts +1 -1
- package/src/api/interappbus/index.d.ts +1 -1
- package/src/api/interop/Factory.d.ts +1 -2
- package/src/api/interop/Factory.js +20 -4
- package/src/api/interop/InteropBroker.d.ts +16 -48
- package/src/api/interop/InteropBroker.js +33 -47
- package/src/api/interop/InteropClient.d.ts +10 -9
- package/src/api/interop/InteropClient.js +9 -8
- package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
- package/src/api/interop/fdc3/fdc3-1.2.js +8 -8
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +2 -2
- package/src/api/interop/fdc3/fdc3-2.0.js +15 -7
- package/src/api/interop/fdc3/fdc3.d.ts +4 -5
- package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
- package/src/api/interop/fdc3/overrideCheck.js +32 -0
- package/src/api/interop/fdc3/versions.d.ts +1 -0
- package/src/api/interop/fdc3/versions.js +2 -0
- package/src/api/me.d.ts +1 -1
- package/src/api/platform/Factory.d.ts +6 -1
- package/src/api/platform/Factory.js +5 -0
- package/src/api/platform/Instance.d.ts +4 -2
- package/src/api/platform/Instance.js +4 -2
- package/src/api/platform/layout/Factory.d.ts +4 -0
- package/src/api/platform/layout/Factory.js +4 -0
- package/src/api/platform/layout/Instance.d.ts +1 -1
- package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
- package/src/api/platform/provider.d.ts +162 -0
- package/src/api/platform/provider.js +2 -0
- package/src/api/snapshot-source/Factory.d.ts +1 -0
- package/src/api/snapshot-source/Factory.js +1 -0
- package/src/api/snapshot-source/Instance.d.ts +1 -1
- package/src/api/system/index.d.ts +1 -471
- package/src/api/system/index.js +6 -476
- package/src/api/view/Instance.d.ts +7 -3
- package/src/api/view/Instance.js +7 -4
- package/src/api/webcontents/main.d.ts +18 -4
- package/src/api/window/Instance.d.ts +21 -1
- package/src/api/window/Instance.js +20 -0
- package/src/browser.js +1 -1
- package/src/mock.js +1 -1
- package/src/namespaces.d.ts +21 -0
- package/src/namespaces.js +24 -0
- package/src/transport/fin_store.d.ts +1 -1
- package/src/transport/transport-errors.d.ts +6 -1
- package/src/transport/transport-errors.js +1 -2
- package/src/transport/transport.d.ts +9 -6
- package/src/transport/transport.js +11 -2
- package/src/util/inaccessibleObject.d.ts +2 -0
- package/src/util/inaccessibleObject.js +49 -0
|
@@ -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.
|
|
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.
|
|
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,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(
|
|
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(
|
|
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
|
|
53
|
-
success:
|
|
54
|
-
data:
|
|
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
|
-
|
|
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,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;
|