@openfin/core 30.73.23 → 30.73.25

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 (93) hide show
  1. package/LICENSE.md +4 -0
  2. package/package.json +2 -2
  3. package/src/OpenFin.d.ts +1678 -188
  4. package/src/api/application/Factory.d.ts +1 -0
  5. package/src/api/application/Factory.js +1 -0
  6. package/src/api/application/Instance.d.ts +3 -2
  7. package/src/api/application/Instance.js +1 -0
  8. package/src/api/base.d.ts +16 -14
  9. package/src/api/base.js +2 -2
  10. package/src/api/clipboard/index.d.ts +1 -0
  11. package/src/api/clipboard/index.js +1 -0
  12. package/src/api/events/application.d.ts +65 -56
  13. package/src/api/events/base.d.ts +33 -15
  14. package/src/api/events/channel.d.ts +13 -8
  15. package/src/api/events/eventAggregator.js +1 -9
  16. package/src/api/events/externalApplication.d.ts +10 -5
  17. package/src/api/events/frame.d.ts +13 -7
  18. package/src/api/events/globalHotkey.d.ts +11 -12
  19. package/src/api/events/platform.d.ts +10 -16
  20. package/src/api/events/system.d.ts +41 -29
  21. package/src/api/events/typedEventEmitter.d.ts +15 -8
  22. package/src/api/events/view.d.ts +37 -54
  23. package/src/api/events/webcontents.d.ts +74 -28
  24. package/src/api/events/window.d.ts +147 -134
  25. package/src/api/external-application/Instance.d.ts +2 -2
  26. package/src/api/fin.d.ts +1 -1
  27. package/src/api/frame/Instance.d.ts +2 -2
  28. package/src/api/global-hotkey/index.d.ts +2 -4
  29. package/src/api/global-hotkey/index.js +6 -0
  30. package/src/api/interappbus/channel/channel.d.ts +1 -1
  31. package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
  32. package/src/api/interappbus/channel/channels-docs.js +7 -0
  33. package/src/api/interappbus/channel/client.d.ts +3 -2
  34. package/src/api/interappbus/channel/client.js +12 -5
  35. package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
  36. package/src/api/interappbus/channel/index.d.ts +3 -3
  37. package/src/api/interappbus/channel/index.js +7 -7
  38. package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
  39. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
  40. package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
  41. package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
  42. package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
  43. package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
  44. package/src/api/interappbus/channel/provider.d.ts +1 -1
  45. package/src/api/interappbus/index.d.ts +1 -1
  46. package/src/api/interop/Factory.d.ts +1 -2
  47. package/src/api/interop/Factory.js +20 -4
  48. package/src/api/interop/InteropBroker.d.ts +16 -48
  49. package/src/api/interop/InteropBroker.js +33 -47
  50. package/src/api/interop/InteropClient.d.ts +10 -9
  51. package/src/api/interop/InteropClient.js +9 -8
  52. package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
  53. package/src/api/interop/fdc3/fdc3-1.2.js +8 -8
  54. package/src/api/interop/fdc3/fdc3-2.0.d.ts +2 -2
  55. package/src/api/interop/fdc3/fdc3-2.0.js +15 -7
  56. package/src/api/interop/fdc3/fdc3.d.ts +4 -5
  57. package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
  58. package/src/api/interop/fdc3/overrideCheck.js +32 -0
  59. package/src/api/interop/fdc3/versions.d.ts +1 -0
  60. package/src/api/interop/fdc3/versions.js +2 -0
  61. package/src/api/me.d.ts +1 -1
  62. package/src/api/platform/Factory.d.ts +6 -1
  63. package/src/api/platform/Factory.js +9 -0
  64. package/src/api/platform/Instance.d.ts +7 -6
  65. package/src/api/platform/Instance.js +6 -3
  66. package/src/api/platform/layout/Factory.d.ts +4 -0
  67. package/src/api/platform/layout/Factory.js +4 -0
  68. package/src/api/platform/layout/Instance.d.ts +1 -1
  69. package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
  70. package/src/api/platform/provider.d.ts +162 -0
  71. package/src/api/platform/provider.js +2 -0
  72. package/src/api/snapshot-source/Factory.d.ts +1 -0
  73. package/src/api/snapshot-source/Factory.js +1 -0
  74. package/src/api/snapshot-source/Instance.d.ts +1 -1
  75. package/src/api/system/index.d.ts +2 -3
  76. package/src/api/system/index.js +22 -6
  77. package/src/api/view/Instance.d.ts +9 -5
  78. package/src/api/view/Instance.js +7 -4
  79. package/src/api/webcontents/main.d.ts +20 -6
  80. package/src/api/webcontents/main.js +10 -0
  81. package/src/api/window/Instance.d.ts +22 -4
  82. package/src/api/window/Instance.js +22 -0
  83. package/src/browser.js +1 -1
  84. package/src/mock.js +1 -1
  85. package/src/namespaces.d.ts +21 -0
  86. package/src/namespaces.js +24 -0
  87. package/src/transport/fin_store.d.ts +1 -1
  88. package/src/transport/transport-errors.d.ts +6 -1
  89. package/src/transport/transport-errors.js +1 -2
  90. package/src/transport/transport.d.ts +12 -9
  91. package/src/transport/transport.js +11 -2
  92. package/src/util/inaccessibleObject.d.ts +2 -0
  93. package/src/util/inaccessibleObject.js +49 -0
@@ -1,57 +1,40 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
- import { CertificateSelectionShownEvent, WebContentsEventMapping, WindowResourceLoadFailedEvent, WindowResourceResponseReceivedEvent } from './webcontents';
3
- import { BaseEventMap, WindowEvent } from './base';
4
- import { WindowNavigationRejectedEvent } from './window';
5
- import { CrashedEvent } from './application';
6
- export interface ViewEventMapping<Topic = string, Type = string> extends WebContentsEventMapping {
7
- 'attached': WindowEvent<Topic, Type>;
8
- 'created': WindowEvent<Topic, Type>;
9
- 'destroyed': WindowEvent<Topic, Type>;
10
- 'hidden': WindowEvent<Topic, Type>;
11
- 'hotkey': InputEvent & WindowEvent<Topic, Type>;
12
- 'shown': WindowEvent<Topic, Type>;
13
- 'target-changed': TargetChangedEvent<Topic, Type>;
14
- }
15
- interface PropagatedViewIdentity {
16
- viewIdentity: OpenFin.Identity;
17
- }
18
- export interface PropagatedViewEventMapping<Topic = string, Type = string> extends BaseEventMap {
19
- 'view-blurred': WindowEvent<Topic, Type> & PropagatedViewIdentity;
20
- 'view-certificate-selection-shown': CertificateSelectionShownEvent<Topic, Type> & PropagatedViewIdentity;
21
- 'view-crashed': CrashedEvent & WindowEvent<Topic, Type> & PropagatedViewIdentity;
22
- 'view-created': CrashedEvent & WindowEvent<Topic, Type> & PropagatedViewIdentity;
23
- 'view-destroyed': WindowEvent<Topic, Type> & PropagatedViewIdentity;
24
- 'view-did-change-theme-color': WindowEvent<Topic, Type> & PropagatedViewIdentity;
25
- 'view-focused': WindowEvent<Topic, Type> & PropagatedViewIdentity;
26
- 'view-hidden': WindowEvent<Topic, Type> & PropagatedViewIdentity;
27
- 'view-hotkey': InputEvent & WindowEvent<Topic, Type> & PropagatedViewIdentity;
28
- 'view-navigation-rejected': WindowNavigationRejectedEvent<Topic, Type> & PropagatedViewIdentity;
29
- 'view-page-favicon-updated': WindowEvent<Topic, Type> & PropagatedViewIdentity;
30
- 'view-page-title-updated': WindowEvent<Topic, Type> & PropagatedViewIdentity;
31
- 'view-resource-load-failed': WindowResourceLoadFailedEvent<Topic, Type> & PropagatedViewIdentity;
32
- 'view-resource-response-received': WindowResourceResponseReceivedEvent<Topic, Type> & PropagatedViewIdentity;
33
- 'view-shown': WindowEvent<Topic, Type> & PropagatedViewIdentity;
34
- 'view-target-changed': TargetChangedEvent<Topic, Type> & PropagatedViewIdentity;
35
- }
36
- export declare type ViewEvents = {
37
- [Type in keyof ViewEventMapping]: ViewEventMapping<'view', Type>[Type];
38
- };
39
- export declare type PropagatedViewEvents<Topic> = {
40
- [Type in keyof PropagatedViewEventMapping]: PropagatedViewEventMapping<Topic, Type>[Type];
41
- };
42
- export interface InputEvent {
43
- inputType: 'keyUp' | 'keyDown';
44
- ctrlKey: boolean;
45
- shiftKey: boolean;
46
- altKey: boolean;
47
- metaKey: boolean;
48
- key: string;
49
- code: string;
50
- repeat: boolean;
51
- command?: string;
52
- }
53
- export interface TargetChangedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
2
+ import { NonPropagatedWebContentsEvent, WillPropagateWebContentsEvent } from './webcontents';
3
+ import { NamedEvent, PropagatedEvent } from './base';
4
+ export declare type TargetChangedEvent = NamedEvent & {
5
+ type: 'target-changed';
54
6
  previousTarget: OpenFin.Identity;
55
7
  target: OpenFin.Identity;
56
- }
57
- export {};
8
+ };
9
+ /**
10
+ * A View event that does not propagate to (republish on) parent topics.
11
+ */
12
+ export declare type NonPropagatedViewEvent = NonPropagatedWebContentsEvent;
13
+ export declare type AttachedEvent = NamedEvent & {
14
+ type: 'attached';
15
+ };
16
+ export declare type CreatedEvent = NamedEvent & {
17
+ type: 'created';
18
+ };
19
+ export declare type DestroyedEvent = NamedEvent & {
20
+ type: 'destroyed';
21
+ };
22
+ export declare type HiddenEvent = NamedEvent & {
23
+ type: 'hidden';
24
+ };
25
+ export declare type HotkeyEvent = NamedEvent & {
26
+ type: 'hotkey';
27
+ };
28
+ export declare type ShownEvent = NamedEvent & {
29
+ type: 'shown';
30
+ };
31
+ /**
32
+ * A View event that does propagate to (republish on) parent topics.
33
+ */
34
+ export declare type WillPropagateViewEvent = WillPropagateWebContentsEvent | AttachedEvent | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent;
35
+ export declare type ViewEvent = {
36
+ topic: 'view';
37
+ } & (NonPropagatedViewEvent | WillPropagateViewEvent);
38
+ export declare type ViewEventType = ViewEvent['type'];
39
+ export declare type PropagatedViewEvent = PropagatedEvent<'view', WillPropagateViewEvent>;
40
+ export declare type PropagatedViewEventType = PropagatedViewEvent['type'];
@@ -1,14 +1,17 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
- import { BaseEventMap, WindowEvent } from './base';
2
+ import { NamedEvent } from './base';
3
3
  import { CrashedEvent } from './application';
4
- import { WindowNavigationRejectedEvent } from './window';
5
- export interface WindowResourceLoadFailedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
4
+ declare type BaseLoadFailedEvent = NamedEvent & {
6
5
  errorCode: number;
7
6
  errorDescription: string;
8
7
  validatedURL: string;
9
8
  isMainFrame: boolean;
10
- }
11
- export interface WindowResourceResponseReceivedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
9
+ };
10
+ export declare type ResourceLoadFailedEvent = BaseLoadFailedEvent & {
11
+ type: 'resource-load-failed';
12
+ };
13
+ export declare type ResourceResponseReceivedEvent = NamedEvent & {
14
+ type: 'response-received';
12
15
  status: boolean;
13
16
  newUrl: string;
14
17
  originalUrl: string;
@@ -17,33 +20,76 @@ export interface WindowResourceResponseReceivedEvent<Topic, Type> extends Window
17
20
  referrer: string;
18
21
  headers: any;
19
22
  resourceType: 'mainFrame' | 'subFrame' | 'styleSheet' | 'script' | 'image' | 'object' | 'xhr' | 'other';
20
- }
21
- export interface PageTitleUpdatedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
23
+ };
24
+ export declare type PageTitleUpdatedEvent = NamedEvent & {
25
+ type: 'page-title-updated';
22
26
  title: string;
23
- }
24
- export interface CertificateErrorEvent<Topic, Type> extends WindowEvent<Topic, Type> {
27
+ };
28
+ export declare type CertificateErrorEvent = NamedEvent & {
29
+ type: 'certificate-error';
25
30
  error: string;
26
31
  url: string;
27
32
  certificate: OpenFin.Certificate;
28
- }
29
- export interface CertificateSelectionShownEvent<Topic, Type> extends WindowEvent<Topic, Type> {
33
+ };
34
+ export declare type CertificateSelectionShownEvent = NamedEvent & {
35
+ type: 'certificate-selection-shown';
30
36
  url: string;
31
37
  certificates: OpenFin.Certificate[];
32
- }
33
- export interface FaviconUpdatedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
38
+ };
39
+ export declare type FaviconUpdatedEvent = NamedEvent & {
40
+ type: 'page-favicon-updated';
34
41
  favicons: string[];
35
- }
36
- export interface WebContentsEventMapping<Topic = string, Type = string> extends BaseEventMap {
37
- 'blurred': WindowEvent<Topic, Type>;
38
- 'certificate-error': CertificateErrorEvent<Topic, Type>;
39
- 'certificate-selection-shown': CertificateSelectionShownEvent<Topic, Type>;
40
- 'crashed': CrashedEvent & WindowEvent<Topic, Type>;
41
- 'did-change-theme-color': WindowEvent<Topic, Type>;
42
- 'focused': WindowEvent<Topic, Type>;
43
- 'found-in-page': WindowEvent<Topic, Type>;
44
- 'navigation-rejected': WindowNavigationRejectedEvent<Topic, Type>;
45
- 'page-favicon-updated': FaviconUpdatedEvent<Topic, Type>;
46
- 'page-title-updated': PageTitleUpdatedEvent<Topic, Type>;
47
- 'resource-load-failed': WindowResourceLoadFailedEvent<Topic, Type>;
48
- 'resource-response-received': WindowResourceResponseReceivedEvent<Topic, Type>;
49
- }
42
+ };
43
+ export declare type NavigationRejectedEvent = NamedEvent & {
44
+ type: 'navigation-rejected';
45
+ sourceName?: string;
46
+ url: string;
47
+ };
48
+ declare type BaseUrlEvent = NamedEvent & {
49
+ type: 'url-changed';
50
+ url: string;
51
+ };
52
+ export declare type UrlChangedEvent = BaseUrlEvent & ({
53
+ isInPage: true;
54
+ } | {
55
+ isInPage: false;
56
+ httpResponseCode: number;
57
+ httpStatusText: string;
58
+ });
59
+ export declare type DidFinishLoadEvent = NamedEvent & {
60
+ type: 'did-finish-load';
61
+ };
62
+ export declare type DidFailLoadEvent = BaseLoadFailedEvent & {
63
+ type: 'did-fail-load';
64
+ };
65
+ export declare type FoundInPageEvent = NamedEvent & {
66
+ type: 'found-in-page';
67
+ };
68
+ /**
69
+ * A WebContents event that does not propagate to (republish on) parent topics.
70
+ */
71
+ export declare type NonPropagatedWebContentsEvent = FoundInPageEvent | CertificateErrorEvent;
72
+ export declare type BlurredEvent = NamedEvent & {
73
+ type: 'blurred';
74
+ };
75
+ export declare type DidChangeThemeColorEvent = NamedEvent & {
76
+ type: 'did-change-theme-color';
77
+ };
78
+ export declare type FocusedEvent = NamedEvent & {
79
+ type: 'focused';
80
+ };
81
+ export declare type ChildContentBlockedEvent = NamedEvent & {
82
+ type: 'child-content-blocked';
83
+ };
84
+ export declare type ChildContentOpenedInBrowserEvent = NamedEvent & {
85
+ type: 'child-content-opened-in-browser';
86
+ };
87
+ export declare type ChildViewCreatedEvent = NamedEvent & {
88
+ type: 'child-view-created';
89
+ };
90
+ /**
91
+ * A WebContents event that does propagate to (republish on) parent topics.
92
+ */
93
+ export declare type WillPropagateWebContentsEvent = BlurredEvent | CertificateSelectionShownEvent | CrashedEvent | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | FaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent;
94
+ export declare type WebContentsEvent = NonPropagatedWebContentsEvent | WillPropagateWebContentsEvent;
95
+ export {};
@@ -1,13 +1,14 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
- import { CrashedEvent } from './application';
3
- import { BaseEventMap, WindowEvent } from './base';
4
- import { CertificateSelectionShownEvent, WebContentsEventMapping, WindowResourceLoadFailedEvent, WindowResourceResponseReceivedEvent } from './webcontents';
5
- import { InputEvent, PropagatedViewEventMapping } from './view';
6
- export interface WindowAlertRequestedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
2
+ import { NamedEvent, PropagatedEvent } from './base';
3
+ import { PropagatedViewEvent } from './view';
4
+ import { NonPropagatedWebContentsEvent, WillPropagateWebContentsEvent } from './webcontents';
5
+ export declare type AlertRequestedEvent = NamedEvent & {
6
+ type: 'alert-requested';
7
7
  message: string;
8
8
  url: string;
9
- }
10
- export interface WindowAuthRequestedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
9
+ };
10
+ export declare type AuthRequestedEvent = NamedEvent & {
11
+ type: 'auth-requested';
11
12
  authInfo: {
12
13
  host: string;
13
14
  isProxy: boolean;
@@ -15,165 +16,177 @@ export interface WindowAuthRequestedEvent<Topic, Type> extends WindowEvent<Topic
15
16
  realm: string;
16
17
  scheme: string;
17
18
  };
18
- }
19
- export interface WindowEndLoadEvent<Topic, Type> extends WindowEvent<Topic, Type> {
19
+ };
20
+ export declare type EndLoadEvent = NamedEvent & {
21
+ type: 'end-load';
20
22
  documentName: string;
21
23
  isMain: boolean;
22
- }
23
- export interface WindowNavigationRejectedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
24
- sourceName?: string;
25
- url: string;
26
- }
27
- export interface WillRedirectEvent<Topic, Type> extends WindowEvent<Topic, Type> {
24
+ };
25
+ export declare type WillRedirectEvent = NamedEvent & {
26
+ type: 'will-redirect';
28
27
  blocked: boolean;
29
28
  isInPlace: boolean;
30
29
  url: string;
31
- }
32
- export interface WindowReloadedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
30
+ };
31
+ export declare type ReloadedEvent = NamedEvent & {
32
+ type: 'reloaded';
33
33
  url: string;
34
- }
35
- export interface WindowOptionsChangedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
34
+ };
35
+ export declare type WindowOptionsChangedEvent = NamedEvent & {
36
+ type: 'options-changed';
36
37
  options: OpenFin.WindowOptions;
37
38
  diff: OpenFin.WindowOptionDiff;
38
- }
39
- export interface WindowExternalProcessExitedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
39
+ };
40
+ export declare type ExternalProcessExitedEvent = NamedEvent & {
41
+ type: 'external-process-exited';
40
42
  processUuid: string;
41
43
  exitCode: number;
42
- }
43
- export interface WindowExternalProcessStartedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
44
+ };
45
+ export declare type ExternalProcessStartedEvent = NamedEvent & {
46
+ type: 'external-process-started';
44
47
  processUuid: string;
45
- }
46
- export interface WindowHiddenEvent<Topic, Type> extends WindowEvent<Topic, Type> {
48
+ };
49
+ export declare type HiddenEvent = NamedEvent & {
50
+ type: 'hidden';
47
51
  reason: 'closing' | 'hide' | 'hide-on-close';
48
- }
49
- export interface PreloadScriptInfoRunning {
52
+ };
53
+ export declare type PreloadScriptInfoRunning = {
50
54
  state: 'load-started' | 'load-failed' | 'load-succeeded' | 'failed' | 'succeeded';
51
- }
52
- export interface PreloadScriptInfo {
55
+ };
56
+ export declare type PreloadScriptInfo = {
53
57
  state: 'load-failed' | 'failed' | 'succeeded';
54
- }
55
- export interface WindowPreloadScriptsStateChangeEvent<Topic, Type> extends WindowEvent<Topic, Type> {
56
- preloadScripts: (PreloadScriptInfoRunning & any)[];
57
- }
58
- export interface WindowPreloadScriptsStateChangedEvent<Topic, Type> extends WindowEvent<Topic, Type> {
58
+ };
59
+ export declare type PreloadScriptsStateChangeEvent = NamedEvent & {
59
60
  preloadScripts: (PreloadScriptInfoRunning & any)[];
60
- }
61
- export interface WindowBeginBoundsChangingEvent<Topic, Type> extends WindowEvent<Topic, Type> {
62
- height: number;
63
- left: number;
64
- top: number;
65
- width: number;
66
- windowState: 'minimized' | 'normal' | 'maximized';
67
- }
68
- export interface WindowEndBoundsChangingEvent<Topic, Type> extends WindowEvent<Topic, Type> {
61
+ };
62
+ export declare type UserBoundsChangeEvent = NamedEvent & {
69
63
  height: number;
70
64
  left: number;
71
65
  top: number;
72
66
  width: number;
73
67
  windowState: 'minimized' | 'normal' | 'maximized';
74
- }
75
- export interface WindowBoundsChange<Topic, Type> extends WindowEvent<Topic, Type> {
68
+ };
69
+ export declare type BoundsChangeEvent = NamedEvent & {
76
70
  changeType: 0 | 1 | 2;
77
71
  deferred: boolean;
78
72
  height: number;
79
73
  left: number;
80
74
  top: number;
81
75
  width: number;
82
- }
83
- export interface WillMoveOrResize<Topic, Type> extends WindowEvent<Topic, Type> {
76
+ };
77
+ export declare type WillMoveOrResizeEvent = NamedEvent & {
84
78
  height: number;
85
79
  left: number;
86
80
  top: number;
87
81
  width: number;
88
82
  monitorScaleFactor: number;
89
- }
90
- export declare type WindowPerformanceReport<Topic, Type> = Performance & WindowEvent<Topic, Type>;
91
- export interface ViewDetached<Topic, Type> extends WindowEvent<Topic, Type> {
83
+ };
84
+ export declare type PerformanceReportEvent = Performance & NamedEvent & {
85
+ type: 'performance-report';
86
+ };
87
+ export declare type ViewDetachedEvent = NamedEvent & {
88
+ type: 'view-detached';
92
89
  previousTarget: OpenFin.Identity;
93
90
  target: OpenFin.Identity;
94
91
  viewIdentity: OpenFin.Identity;
95
- }
96
- export interface WindowEventMapping<Topic = string, Type = string> extends WebContentsEventMapping {
97
- 'auth-requested': WindowAuthRequestedEvent<Topic, Type>;
98
- 'begin-user-bounds-changing': WindowBeginBoundsChangingEvent<Topic, Type>;
99
- 'bounds-changed': WindowBoundsChange<Topic, Type>;
100
- 'bounds-changing': WindowBoundsChange<Topic, Type>;
101
- 'close-requested': WindowEvent<Topic, Type>;
102
- 'closed': WindowEvent<Topic, Type>;
103
- 'closing': WindowEvent<Topic, Type>;
104
- 'disabled-movement-bounds-changed': WindowBoundsChange<Topic, Type>;
105
- 'disabled-movement-bounds-changing': WindowBoundsChange<Topic, Type>;
106
- 'embedded': WindowEvent<Topic, Type>;
107
- 'end-user-bounds-changing': WindowEndBoundsChangingEvent<Topic, Type>;
108
- 'external-process-exited': WindowExternalProcessExitedEvent<Topic, Type>;
109
- 'external-process-started': WindowExternalProcessStartedEvent<Topic, Type>;
110
- 'hidden': WindowHiddenEvent<Topic, Type>;
111
- 'hotkey': InputEvent & WindowEvent<Topic, Type>;
112
- 'initialized': WindowEvent<Topic, Type>;
113
- 'layout-initialized': WindowEvent<Topic, Type>;
114
- 'layout-ready': WindowEvent<Topic, Type>;
115
- 'maximized': WindowEvent<Topic, Type>;
116
- 'minimized': WindowEvent<Topic, Type>;
117
- 'options-changed': WindowOptionsChangedEvent<Topic, Type>;
118
- 'performance-report': WindowPerformanceReport<Topic, Type>;
119
- 'preload-scripts-state-changed': WindowPreloadScriptsStateChangeEvent<Topic, Type>;
120
- 'preload-scripts-state-changing': WindowPreloadScriptsStateChangeEvent<Topic, Type>;
121
- 'reloaded': WindowReloadedEvent<Topic, Type>;
122
- 'restored': WindowEvent<Topic, Type>;
123
- 'show-requested': WindowEvent<Topic, Type>;
124
- 'shown': WindowEvent<Topic, Type>;
125
- 'user-movement-disabled': WindowEvent<Topic, Type>;
126
- 'user-movement-enabled': WindowEvent<Topic, Type>;
127
- 'view-attached': WindowEvent<Topic, Type>;
128
- 'view-detached': ViewDetached<Topic, Type>;
129
- 'will-move': WillMoveOrResize<Topic, Type>;
130
- 'will-redirect': WillRedirectEvent<Topic, Type>;
131
- 'will-resize': WillMoveOrResize<Topic, Type>;
132
- }
133
- export interface PropagatedWindowEventMapping<Topic = string, Type = string> extends BaseEventMap {
134
- 'window-begin-user-bounds-changing': WindowBeginBoundsChangingEvent<Topic, Type>;
135
- 'window-blurred': WindowEvent<Topic, Type>;
136
- 'window-bounds-changed': WindowBoundsChange<Topic, Type>;
137
- 'window-bounds-changing': WindowBoundsChange<Topic, Type>;
138
- 'window-certificate-selection-shown': CertificateSelectionShownEvent<Topic, Type>;
139
- 'window-closed': WindowEvent<Topic, Type>;
140
- 'window-closing': WindowEvent<Topic, Type>;
141
- 'window-crashed': CrashedEvent & WindowEvent<Topic, Type>;
142
- 'window-disabled-movement-bounds-changed': WindowBoundsChange<Topic, Type>;
143
- 'window-disabled-movement-bounds-changing': WindowBoundsChange<Topic, Type>;
144
- 'window-embedded': WindowEvent<Topic, Type>;
145
- 'window-end-user-bounds-changing': WindowBeginBoundsChangingEvent<Topic, Type>;
146
- 'window-external-process-exited': WindowExternalProcessExitedEvent<Topic, Type>;
147
- 'window-external-process-started': WindowExternalProcessStartedEvent<Topic, Type>;
148
- 'window-focused': WindowEvent<Topic, Type>;
149
- 'window-hidden': WindowHiddenEvent<Topic, Type>;
150
- 'window-hotkey': InputEvent & WindowEvent<Topic, Type>;
151
- 'window-initialized': WindowEvent<Topic, Type>;
152
- 'window-layout-initialized': WindowEvent<Topic, Type>;
153
- 'window-layout-ready': WindowEvent<Topic, Type>;
154
- 'window-maximized': WindowEvent<Topic, Type>;
155
- 'window-minimized': WindowEvent<Topic, Type>;
156
- 'window-navigation-rejected': WindowNavigationRejectedEvent<Topic, Type>;
157
- 'window-options-changed': WindowOptionsChangedEvent<Topic, Type>;
158
- 'window-performance-report': WindowPerformanceReport<Topic, Type>;
159
- 'window-preload-scripts-state-changed': WindowPreloadScriptsStateChangeEvent<Topic, Type>;
160
- 'window-preload-scripts-state-changing': WindowPreloadScriptsStateChangedEvent<Topic, Type>;
161
- 'window-resource-load-failed': WindowResourceLoadFailedEvent<Topic, Type>;
162
- 'window-resource-response-received': WindowResourceResponseReceivedEvent<Topic, Type>;
163
- 'window-reloaded': WindowReloadedEvent<Topic, Type>;
164
- 'window-restored': WindowEvent<Topic, Type>;
165
- 'window-shown': WindowEvent<Topic, Type>;
166
- 'window-user-movement-disabled': WindowEvent<Topic, Type>;
167
- 'window-user-movement-enabled': WindowEvent<Topic, Type>;
168
- 'window-view-attached': WindowEvent<Topic, Type>;
169
- 'window-view-detached': ViewDetached<Topic, Type>;
170
- 'window-will-move': WillMoveOrResize<Topic, Type>;
171
- 'window-will-redirect': WillRedirectEvent<Topic, Type>;
172
- 'window-will-resize': WillMoveOrResize<Topic, Type>;
173
- }
174
- export declare type WindowEvents = PropagatedViewEventMapping<'window'> & {
175
- [Type in keyof WindowEventMapping]: WindowEventMapping<'window', Type>[Type];
176
- };
177
- export declare type PropagatedWindowEvents<Topic> = {
178
- [Type in keyof PropagatedWindowEventMapping]: PropagatedWindowEventMapping<Topic, Type>[Type];
179
92
  };
93
+ export declare type InputEvent = {
94
+ inputType: 'keyUp' | 'keyDown';
95
+ ctrlKey: boolean;
96
+ shiftKey: boolean;
97
+ altKey: boolean;
98
+ metaKey: boolean;
99
+ key: string;
100
+ code: string;
101
+ repeat: boolean;
102
+ command?: string;
103
+ };
104
+ /**
105
+ * A Window event that does not propagate to (republish on) parent topics.
106
+ */
107
+ export declare type NonPropagatedWindowEvent = NonPropagatedWebContentsEvent;
108
+ export declare type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
109
+ type: 'begin-user-bounds-changing';
110
+ };
111
+ export declare type BoundsChangedEvent = BoundsChangeEvent & {
112
+ type: 'bounds-changed';
113
+ };
114
+ export declare type BoundsChangingEvent = BoundsChangeEvent & {
115
+ type: 'bounds-changing';
116
+ };
117
+ export declare type WindowCloseRequestedEvent = NamedEvent & {
118
+ type: 'close-requested';
119
+ };
120
+ export declare type WindowClosedEvent = NamedEvent & {
121
+ type: 'closed';
122
+ };
123
+ export declare type WindowClosingEvent = NamedEvent & {
124
+ type: 'closing';
125
+ };
126
+ export declare type DisabledMovementBoundsChangedEvent = BoundsChangeEvent & {
127
+ type: 'disabled-movement-bounds-changed';
128
+ };
129
+ export declare type DisabledMovementBoundsChangingEvent = BoundsChangeEvent & {
130
+ type: 'disabled-movement-bounds-changing';
131
+ };
132
+ export declare type EmbeddedEvent = NamedEvent & {
133
+ type: 'embedded';
134
+ };
135
+ export declare type EndUserBoundsChangingEvent = UserBoundsChangeEvent & {
136
+ type: 'end-user-bounds-changing';
137
+ };
138
+ export declare type WindowHotkeyEvent = InputEvent & NamedEvent & {
139
+ type: 'hotkey';
140
+ };
141
+ export declare type WindowInitializedEvent = NamedEvent & {
142
+ type: 'initialized';
143
+ };
144
+ export declare type LayoutInitializedEvent = NamedEvent & {
145
+ type: 'layout-initialized';
146
+ };
147
+ export declare type LayoutReadyEvent = NamedEvent & {
148
+ type: 'layout-ready';
149
+ };
150
+ export declare type MaximizedEvent = NamedEvent & {
151
+ type: 'maximized';
152
+ };
153
+ export declare type MinimizedEvent = NamedEvent & {
154
+ type: 'minimized';
155
+ };
156
+ export declare type PreloadScriptsStateChangedEvent = PreloadScriptsStateChangeEvent & {
157
+ type: 'preload-script-state-changed';
158
+ };
159
+ export declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent & {
160
+ type: 'preload-script-state-changing';
161
+ };
162
+ export declare type WindowRestoredEvent = NamedEvent & {
163
+ type: 'restored';
164
+ };
165
+ export declare type WindowShowRequestedEvent = NamedEvent & {
166
+ type: 'show-requested';
167
+ };
168
+ export declare type WindowShownEvent = NamedEvent & {
169
+ type: 'shown';
170
+ };
171
+ export declare type UserMovementEnabledEvent = NamedEvent & {
172
+ type: 'user-movement-enabled';
173
+ };
174
+ export declare type UserMovementDisabledEvent = NamedEvent & {
175
+ type: 'user-movement-disabled';
176
+ };
177
+ export declare type WillMoveEvent = WillMoveOrResizeEvent & {
178
+ type: 'will-move';
179
+ };
180
+ export declare type WillResizeEvent = WillMoveOrResizeEvent & {
181
+ type: 'will-resize';
182
+ };
183
+ /**
184
+ * A Window event that does propagate to (republish on) parent topics.
185
+ */
186
+ export declare type WillPropagateWindowEvent = WillPropagateWebContentsEvent | PropagatedViewEvent | ViewDetachedEvent | AuthRequestedEvent | BeginUserBoundsChangingEvent | BoundsChangedEvent | BoundsChangingEvent | WindowCloseRequestedEvent | WindowClosedEvent | WindowClosingEvent | DisabledMovementBoundsChangedEvent | DisabledMovementBoundsChangingEvent | EmbeddedEvent | EndUserBoundsChangingEvent | ExternalProcessExitedEvent | ExternalProcessStartedEvent | HiddenEvent | WindowHotkeyEvent | WindowInitializedEvent | LayoutInitializedEvent | LayoutReadyEvent | MaximizedEvent | MinimizedEvent | WindowOptionsChangedEvent | PerformanceReportEvent | PreloadScriptsStateChangedEvent | PreloadScriptsStateChangingEvent | ReloadedEvent | WindowRestoredEvent | WindowShowRequestedEvent | WindowShownEvent | UserMovementDisabledEvent | UserMovementEnabledEvent | WillMoveEvent | WillRedirectEvent | WillResizeEvent;
187
+ export declare type WindowEvent = {
188
+ topic: 'window';
189
+ } & (WillPropagateWindowEvent | NonPropagatedWindowEvent);
190
+ export declare type WindowEventType = WindowEvent['type'];
191
+ export declare type PropagatedWindowEvent = PropagatedEvent<'window', WillPropagateWindowEvent>;
192
+ export declare type PropagatedWindowEventType = PropagatedWindowEvent['type'];
@@ -1,6 +1,6 @@
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
  /**
5
5
  * @classdesc An ExternalApplication object representing native language adapter connections to the runtime. Allows
6
6
  * the developer to listen to <a href="tutorial-ExternalApplication.EventEmitter.html">application events.</a>
@@ -13,7 +13,7 @@ import Transport from '../../transport/transport';
13
13
  * @class
14
14
  * @hideconstructor
15
15
  */
16
- export declare class ExternalApplication extends EmitterBase<OpenFin.ExternalApplicationEvents> {
16
+ export declare class ExternalApplication extends EmitterBase<OpenFin.ExternalApplicationEvent> {
17
17
  identity: OpenFin.ApplicationIdentity;
18
18
  constructor(wire: Transport, identity: OpenFin.ApplicationIdentity);
19
19
  /**
package/src/api/fin.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
3
  import type * as OpenFin from '../OpenFin';
4
- import Transport from '../transport/transport';
4
+ import { Transport } from '../transport/transport';
5
5
  import System from './system/index';
6
6
  import _WindowModule from './window/index';
7
7
  import ApplicationModule from './application/index';
@@ -1,7 +1,7 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
- import Transport from '../../transport/transport';
4
- declare type FrameEvents = OpenFin.FrameEvents;
3
+ import { Transport } from '../../transport/transport';
4
+ declare type FrameEvents = OpenFin.FrameEvent;
5
5
  /**
6
6
  * @classdesc
7
7
  * An iframe represents an embedded HTML page within a parent HTML page. Because this embedded page
@@ -1,12 +1,11 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
- import Transport from '../../transport/transport';
4
- declare type GlobalHotkeyEvents = OpenFin.GlobalHotkeyEvents;
3
+ import { Transport } from '../../transport/transport';
5
4
  /**
6
5
  * The GlobalHotkey module can register/unregister a global hotkeys.
7
6
  * @namespace
8
7
  */
9
- export default class GlobalHotkey extends EmitterBase<GlobalHotkeyEvents> {
8
+ export default class GlobalHotkey extends EmitterBase<OpenFin.GlobalHotkeyEvent> {
10
9
  constructor(wire: Transport);
11
10
  /**
12
11
  * Registers a global hotkey with the operating system.
@@ -37,4 +36,3 @@ export default class GlobalHotkey extends EmitterBase<GlobalHotkeyEvents> {
37
36
  */
38
37
  isRegistered(hotkey: string): Promise<boolean>;
39
38
  }
40
- export {};
@@ -17,6 +17,8 @@ class GlobalHotkey extends base_1.EmitterBase {
17
17
  * @tutorial GlobalHotkey.register
18
18
  */
19
19
  async register(hotkey, listener) {
20
+ // TODO: fix typing (hotkey events are not typed)
21
+ // @ts-expect-error
20
22
  await this.on(hotkey, listener);
21
23
  await this.wire.sendAction('global-hotkey-register', { hotkey });
22
24
  return undefined;
@@ -28,6 +30,8 @@ class GlobalHotkey extends base_1.EmitterBase {
28
30
  * @tutorial GlobalHotkey.unregister
29
31
  */
30
32
  async unregister(hotkey) {
33
+ // TODO: fix typing (hotkey events are not typed)
34
+ // @ts-expect-error
31
35
  await this.removeAllListeners(hotkey);
32
36
  await this.wire.sendAction('global-hotkey-unregister', { hotkey });
33
37
  return undefined;
@@ -40,6 +44,8 @@ class GlobalHotkey extends base_1.EmitterBase {
40
44
  async unregisterAll() {
41
45
  await Promise.all(this.eventNames()
42
46
  .filter((name) => !(name === 'registered' || name === 'unregistered'))
47
+ // TODO: fix typing (hotkey events are not typed)
48
+ // @ts-expect-error
43
49
  .map((name) => this.removeAllListeners(name)));
44
50
  await this.wire.sendAction('global-hotkey-unregister-all', {});
45
51
  return undefined;
@@ -1,5 +1,5 @@
1
1
  import type * as OpenFin from '../../../OpenFin';
2
- import Transport from '../../../transport/transport';
2
+ import { Transport } from '../../../transport/transport';
3
3
  declare type ProviderIdentity = OpenFin.ProviderIdentity;
4
4
  declare type ChannelMiddleware = OpenFin.ChannelMiddleware;
5
5
  declare type ErrorMiddleware = OpenFin.ErrorMiddleware;