@openfin/core 31.74.1 → 31.74.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/package.json +1 -1
  2. package/src/OpenFin.d.ts +284 -253
  3. package/src/OpenFin.js +0 -2
  4. package/src/api/api-exposer/api-consumer.d.ts +28 -0
  5. package/src/api/api-exposer/api-consumer.js +28 -0
  6. package/src/api/api-exposer/api-exposer.d.ts +35 -0
  7. package/src/api/api-exposer/api-exposer.js +38 -0
  8. package/src/api/api-exposer/decorators.d.ts +10 -0
  9. package/src/api/api-exposer/decorators.js +18 -0
  10. package/src/api/api-exposer/index.d.ts +4 -0
  11. package/src/api/api-exposer/index.js +20 -0
  12. package/src/api/api-exposer/strategies/index.d.ts +1 -0
  13. package/src/api/api-exposer/strategies/index.js +17 -0
  14. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +14 -0
  15. package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +20 -0
  16. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +20 -0
  17. package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +23 -0
  18. package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +2 -0
  19. package/src/api/api-exposer/strategies/openfin-channels/index.js +18 -0
  20. package/src/api/application/Factory.js +1 -2
  21. package/src/api/base.d.ts +2 -2
  22. package/src/api/events/application.d.ts +22 -22
  23. package/src/api/events/base.d.ts +6 -9
  24. package/src/api/events/channel.d.ts +5 -5
  25. package/src/api/events/emitterMap.d.ts +1 -1
  26. package/src/api/events/externalApplication.d.ts +3 -3
  27. package/src/api/events/frame.d.ts +5 -5
  28. package/src/api/events/globalHotkey.d.ts +3 -3
  29. package/src/api/events/platform.d.ts +3 -3
  30. package/src/api/events/system.d.ts +17 -17
  31. package/src/api/events/typedEventEmitter.d.ts +1 -1
  32. package/src/api/events/view.d.ts +17 -14
  33. package/src/api/events/webcontents.d.ts +24 -22
  34. package/src/api/events/window.d.ts +65 -57
  35. package/src/api/fin.d.ts +1 -1
  36. package/src/api/frame/Instance.d.ts +1 -1
  37. package/src/api/interappbus/channel/channel.d.ts +4 -4
  38. package/src/api/interappbus/channel/channel.js +3 -3
  39. package/src/api/interappbus/channel/client.d.ts +2 -2
  40. package/src/api/interappbus/channel/client.js +20 -20
  41. package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
  42. package/src/api/interappbus/channel/connection-manager.js +12 -12
  43. package/src/api/interappbus/channel/index.d.ts +2 -2
  44. package/src/api/interappbus/channel/index.js +1 -1
  45. package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
  46. package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +2 -2
  47. package/src/api/interappbus/channel/protocols/combined/strategy.js +5 -5
  48. package/src/api/interappbus/channel/protocols/index.d.ts +4 -4
  49. package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +1 -1
  50. package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +1 -1
  51. package/src/api/interappbus/channel/protocols/strategy-types.d.ts +4 -4
  52. package/src/api/interappbus/channel/protocols/strategy.d.ts +3 -3
  53. package/src/api/interappbus/channel/provider.d.ts +5 -5
  54. package/src/api/interappbus/channel/provider.js +24 -24
  55. package/src/api/interop/InteropBroker.d.ts +1 -1
  56. package/src/api/interop/InteropBroker.js +6 -2
  57. package/src/api/interop/fdc3/PrivateChannelClient.d.ts +2 -1
  58. package/src/api/interop/fdc3/PrivateChannelClient.js +15 -7
  59. package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +16 -2
  60. package/src/api/interop/fdc3/PrivateChannelProvider.js +80 -21
  61. package/src/api/interop/fdc3/fdc3-1.2.js +19 -4
  62. package/src/api/interop/fdc3/fdc3-2.0.d.ts +11 -10
  63. package/src/api/interop/fdc3/fdc3-2.0.js +18 -19
  64. package/src/api/interop/fdc3/shapes/fdc3v1.d.ts +3 -3
  65. package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +5 -5
  66. package/src/api/interop/fdc3/utils.d.ts +17 -0
  67. package/src/api/interop/fdc3/utils.js +52 -18
  68. package/src/api/interop/fdc3/versions.d.ts +1 -1
  69. package/src/api/interop/utils.d.ts +0 -1
  70. package/src/api/interop/utils.js +1 -9
  71. package/src/api/me.d.ts +3 -3
  72. package/src/api/platform/Factory.js +5 -9
  73. package/src/api/platform/Instance.d.ts +1 -1
  74. package/src/api/platform/Instance.js +1 -1
  75. package/src/api/platform/common-utils.d.ts +1 -1
  76. package/src/api/platform/layout/Factory.d.ts +1 -1
  77. package/src/api/platform/layout/Factory.js +11 -3
  78. package/src/api/platform/layout/Instance.d.ts +9 -3
  79. package/src/api/platform/layout/Instance.js +26 -1
  80. package/src/api/platform/layout/controllers/layout-content-cache.d.ts +9 -0
  81. package/src/api/platform/layout/controllers/layout-content-cache.js +54 -0
  82. package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +117 -0
  83. package/src/api/platform/layout/controllers/layout-entities-controller.js +270 -0
  84. package/src/api/platform/layout/controllers/splitter-controller.d.ts +1 -1
  85. package/src/api/platform/layout/entities/layout-entities.d.ts +144 -0
  86. package/src/api/platform/layout/entities/layout-entities.js +216 -0
  87. package/src/api/platform/layout/entities/shapes.d.ts +6 -0
  88. package/src/api/platform/layout/entities/shapes.js +2 -0
  89. package/src/api/platform/layout/layout.constants.d.ts +1 -0
  90. package/src/api/platform/layout/layout.constants.js +4 -0
  91. package/src/api/platform/layout/shapes.d.ts +4 -1
  92. package/src/api/platform/layout/utils/layout-traversal.d.ts +4 -0
  93. package/src/api/platform/layout/utils/layout-traversal.js +65 -0
  94. package/src/api/system/index.d.ts +13 -13
  95. package/src/api/view/Instance.d.ts +13 -3
  96. package/src/api/view/Instance.js +41 -4
  97. package/src/environment/browser.d.ts +1 -1
  98. package/src/environment/environment.d.ts +1 -1
  99. package/src/environment/node-env.d.ts +1 -1
  100. package/src/environment/openfin-env.d.ts +1 -1
  101. package/src/mock.d.ts +1 -1
  102. package/src/mock.js +5 -2
  103. package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -1
  104. package/src/shapes/protocol.d.ts +3 -3
  105. package/src/transport/transport-errors.d.ts +2 -2
  106. package/src/transport/transport.d.ts +3 -3
  107. package/src/transport/transport.js +1 -4
  108. package/src/transport/wire.d.ts +14 -13
  109. package/src/util/channel-api-relay.d.ts +13 -0
  110. package/src/util/channel-api-relay.js +37 -0
  111. package/src/util/errors.d.ts +2 -2
  112. package/src/util/http.js +4 -2
  113. package/src/util/lazy.d.ts +16 -0
  114. package/src/util/lazy.js +26 -0
  115. package/src/util/promises.d.ts +1 -1
  116. package/src/util/reversible-map.d.ts +11 -0
  117. package/src/util/reversible-map.js +49 -0
  118. package/src/util/utilTypes.d.ts +1 -1
@@ -4,47 +4,47 @@ import { BaseEvent } from './base';
4
4
  import { PropagatedViewEvent } from './view';
5
5
  import { PropagatedWindowEvent } from './window';
6
6
  import { AppVersionCompleteEvent, AppVersionErrorEvent, AppVersionProgressEvent, AppVersionRuntimeStatusEvent } from '../../OpenFin';
7
- export declare type NotRequested<EventType> = EventType extends `${infer U}-requested` ? never : EventType;
8
- export declare type ExcludeRequested<Event extends {
7
+ export type NotRequested<EventType> = EventType extends `${infer U}-requested` ? never : EventType;
8
+ export type ExcludeRequested<Event extends {
9
9
  type: string;
10
10
  }> = Extract<Event, {
11
11
  type: NotRequested<Event['type']>;
12
12
  }>;
13
- export declare type IdleEvent = {
13
+ export type IdleEvent = {
14
14
  type: 'idle-state-changed';
15
15
  elapsedTime: number;
16
16
  isIdle: boolean;
17
17
  };
18
- export declare type MonitorEvent = OpenFin.MonitorInfo & {
18
+ export type MonitorEvent = OpenFin.MonitorInfo & {
19
19
  type: 'monitor-info-changed';
20
20
  };
21
- export declare type SessionChangedEvent = {
21
+ export type SessionChangedEvent = {
22
22
  type: 'session-changed';
23
23
  reason: 'lock' | 'unlock' | 'remote-connect' | 'remote-disconnect' | 'unknown';
24
24
  };
25
- export declare type AppVersionEvent = AppVersionProgressEvent | AppVersionRuntimeStatusEvent | AppVersionCompleteEvent | AppVersionErrorEvent;
26
- export declare type AppVersionEventType = AppVersionEvent['type'];
27
- export declare type IdEventType = WithId<AppVersionEventType>;
28
- export declare type WithId<T extends AppVersionEventType> = `${T}.${string}`;
29
- export declare type WithoutId<T extends string> = T extends WithId<infer U> ? U : never;
30
- export declare type AppVersionTypeFromIdEvent<T extends IdEventType> = Extract<AppVersionEvent, {
25
+ export type AppVersionEvent = AppVersionProgressEvent | AppVersionRuntimeStatusEvent | AppVersionCompleteEvent | AppVersionErrorEvent;
26
+ export type AppVersionEventType = AppVersionEvent['type'];
27
+ export type IdEventType = WithId<AppVersionEventType>;
28
+ export type WithId<T extends AppVersionEventType> = `${T}.${string}`;
29
+ export type WithoutId<T extends string> = T extends WithId<infer U> ? U : never;
30
+ export type AppVersionTypeFromIdEvent<T extends IdEventType> = Extract<AppVersionEvent, {
31
31
  type: WithoutId<T>;
32
32
  }>;
33
- export declare type EventWithId<Event extends AppVersionEvent> = Event extends infer E extends {
33
+ export type EventWithId<Event extends AppVersionEvent> = Event extends infer E extends {
34
34
  type: AppVersionEventType;
35
35
  } ? Omit<E, 'type'> & {
36
36
  type: WithId<E['type']>;
37
37
  topic: 'system';
38
38
  appVersionId: string;
39
39
  } : never;
40
- export declare type AppVersionEventWithId = EventWithId<AppVersionEvent>;
41
- export declare type ApplicationCreatedEvent = BaseEvent & {
40
+ export type AppVersionEventWithId = EventWithId<AppVersionEvent>;
41
+ export type ApplicationCreatedEvent = BaseEvent & {
42
42
  type: 'application-created';
43
43
  };
44
- export declare type DesktopIconClickedEvent = BaseEvent & {
44
+ export type DesktopIconClickedEvent = BaseEvent & {
45
45
  type: 'desktop-icon-clicked';
46
46
  };
47
- export declare type SystemEvent = {
47
+ export type SystemEvent = {
48
48
  topic: 'system';
49
49
  } & (ExcludeRequested<PropagatedWindowEvent> | PropagatedViewEvent | PropagatedApplicationEvent | ApplicationCreatedEvent | DesktopIconClickedEvent | IdleEvent | MonitorEvent | SessionChangedEvent | AppVersionEventWithId);
50
- export declare type SystemEventType = SystemEvent['type'];
50
+ export type SystemEventType = SystemEvent['type'];
@@ -1,4 +1,4 @@
1
- export declare type Listener<T extends {
1
+ export type Listener<T extends {
2
2
  type: string;
3
3
  }> = (payload: T) => void;
4
4
  export interface TypedEventEmitter<Event extends {
@@ -1,40 +1,43 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { NonPropagatedWebContentsEvent, WillPropagateWebContentsEvent } from './webcontents';
3
3
  import { NamedEvent, PropagatedEvent } from './base';
4
- export declare type TargetChangedEvent = NamedEvent & {
4
+ export type BaseViewEvent = {
5
+ target: OpenFin.Identity;
6
+ viewIdentity: OpenFin.Identity;
7
+ };
8
+ export type TargetChangedEvent = NamedEvent & {
5
9
  type: 'target-changed';
6
10
  previousTarget: OpenFin.Identity;
7
- target: OpenFin.Identity;
8
11
  };
9
12
  /**
10
13
  * A View event that does not propagate to (republish on) parent topics.
11
14
  */
12
- export declare type NonPropagatedViewEvent = NonPropagatedWebContentsEvent;
13
- export declare type AttachedEvent = NamedEvent & {
15
+ export type NonPropagatedViewEvent = BaseViewEvent & NonPropagatedWebContentsEvent;
16
+ export type AttachedEvent = NamedEvent & {
14
17
  type: 'attached';
15
18
  };
16
- export declare type CreatedEvent = NamedEvent & {
19
+ export type CreatedEvent = NamedEvent & {
17
20
  type: 'created';
18
21
  };
19
- export declare type DestroyedEvent = NamedEvent & {
22
+ export type DestroyedEvent = NamedEvent & {
20
23
  type: 'destroyed';
21
24
  };
22
- export declare type HiddenEvent = NamedEvent & {
25
+ export type HiddenEvent = NamedEvent & {
23
26
  type: 'hidden';
24
27
  };
25
- export declare type HotkeyEvent = NamedEvent & {
28
+ export type HotkeyEvent = NamedEvent & {
26
29
  type: 'hotkey';
27
30
  };
28
- export declare type ShownEvent = NamedEvent & {
31
+ export type ShownEvent = NamedEvent & {
29
32
  type: 'shown';
30
33
  };
31
34
  /**
32
35
  * A View event that does propagate to (republish on) parent topics.
33
36
  */
34
- export declare type WillPropagateViewEvent = WillPropagateWebContentsEvent | AttachedEvent | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent;
35
- export declare type ViewEvent = {
37
+ export type WillPropagateViewEvent = BaseViewEvent & (WillPropagateWebContentsEvent | AttachedEvent | CreatedEvent | DestroyedEvent | HiddenEvent | HotkeyEvent | ShownEvent | TargetChangedEvent);
38
+ export type ViewEvent = {
36
39
  topic: 'view';
37
40
  } & (NonPropagatedViewEvent | WillPropagateViewEvent);
38
- export declare type ViewEventType = ViewEvent['type'];
39
- export declare type PropagatedViewEvent = PropagatedEvent<'view', WillPropagateViewEvent>;
40
- export declare type PropagatedViewEventType = PropagatedViewEvent['type'];
41
+ export type ViewEventType = ViewEvent['type'];
42
+ export type PropagatedViewEvent = PropagatedEvent<'view', WillPropagateViewEvent>;
43
+ export type PropagatedViewEventType = PropagatedViewEvent['type'];
@@ -1,16 +1,16 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { NamedEvent } from './base';
3
3
  import { CrashedEvent } from './application';
4
- declare type BaseLoadFailedEvent = NamedEvent & {
4
+ type BaseLoadFailedEvent = NamedEvent & {
5
5
  errorCode: number;
6
6
  errorDescription: string;
7
7
  validatedURL: string;
8
8
  isMainFrame: boolean;
9
9
  };
10
- export declare type ResourceLoadFailedEvent = BaseLoadFailedEvent & {
10
+ export type ResourceLoadFailedEvent = BaseLoadFailedEvent & {
11
11
  type: 'resource-load-failed';
12
12
  };
13
- export declare type ResourceResponseReceivedEvent = NamedEvent & {
13
+ export type ResourceResponseReceivedEvent = NamedEvent & {
14
14
  type: 'response-received';
15
15
  status: boolean;
16
16
  newUrl: string;
@@ -21,75 +21,77 @@ export declare type ResourceResponseReceivedEvent = NamedEvent & {
21
21
  headers: any;
22
22
  resourceType: 'mainFrame' | 'subFrame' | 'styleSheet' | 'script' | 'image' | 'object' | 'xhr' | 'other';
23
23
  };
24
- export declare type PageTitleUpdatedEvent = NamedEvent & {
24
+ export type PageTitleUpdatedEvent = NamedEvent & {
25
25
  type: 'page-title-updated';
26
26
  title: string;
27
27
  };
28
- export declare type CertificateErrorEvent = NamedEvent & {
28
+ export type CertificateErrorEvent = NamedEvent & {
29
29
  type: 'certificate-error';
30
30
  error: string;
31
31
  url: string;
32
32
  certificate: OpenFin.Certificate;
33
33
  };
34
- export declare type CertificateSelectionShownEvent = NamedEvent & {
34
+ export type CertificateSelectionShownEvent = NamedEvent & {
35
35
  type: 'certificate-selection-shown';
36
36
  url: string;
37
37
  certificates: OpenFin.Certificate[];
38
38
  };
39
- export declare type FaviconUpdatedEvent = NamedEvent & {
39
+ export type FaviconUpdatedEvent = NamedEvent & {
40
40
  type: 'page-favicon-updated';
41
41
  favicons: string[];
42
42
  };
43
- export declare type NavigationRejectedEvent = NamedEvent & {
43
+ export type NavigationRejectedEvent = NamedEvent & {
44
44
  type: 'navigation-rejected';
45
45
  sourceName?: string;
46
46
  url: string;
47
47
  };
48
- declare type BaseUrlEvent = NamedEvent & {
48
+ type BaseUrlEvent = NamedEvent & {
49
49
  type: 'url-changed';
50
50
  url: string;
51
51
  };
52
- export declare type UrlChangedEvent = BaseUrlEvent & ({
52
+ export type UrlChangedEvent = BaseUrlEvent & ({
53
53
  isInPage: true;
54
54
  } | {
55
55
  isInPage: false;
56
56
  httpResponseCode: number;
57
57
  httpStatusText: string;
58
58
  });
59
- export declare type DidFinishLoadEvent = NamedEvent & {
59
+ export type DidFinishLoadEvent = NamedEvent & {
60
60
  type: 'did-finish-load';
61
61
  };
62
- export declare type DidFailLoadEvent = BaseLoadFailedEvent & {
62
+ export type DidFailLoadEvent = BaseLoadFailedEvent & {
63
63
  type: 'did-fail-load';
64
64
  };
65
- export declare type FoundInPageEvent = NamedEvent & {
65
+ export type FoundInPageEvent = NamedEvent & {
66
66
  type: 'found-in-page';
67
+ } & {
68
+ result: OpenFin.FindInPageResult;
67
69
  };
68
70
  /**
69
71
  * A WebContents event that does not propagate to (republish on) parent topics.
70
72
  */
71
- export declare type NonPropagatedWebContentsEvent = FoundInPageEvent | CertificateErrorEvent;
72
- export declare type BlurredEvent = NamedEvent & {
73
+ export type NonPropagatedWebContentsEvent = FoundInPageEvent | CertificateErrorEvent;
74
+ export type BlurredEvent = NamedEvent & {
73
75
  type: 'blurred';
74
76
  };
75
- export declare type DidChangeThemeColorEvent = NamedEvent & {
77
+ export type DidChangeThemeColorEvent = NamedEvent & {
76
78
  type: 'did-change-theme-color';
77
79
  };
78
- export declare type FocusedEvent = NamedEvent & {
80
+ export type FocusedEvent = NamedEvent & {
79
81
  type: 'focused';
80
82
  };
81
- export declare type ChildContentBlockedEvent = NamedEvent & {
83
+ export type ChildContentBlockedEvent = NamedEvent & {
82
84
  type: 'child-content-blocked';
83
85
  };
84
- export declare type ChildContentOpenedInBrowserEvent = NamedEvent & {
86
+ export type ChildContentOpenedInBrowserEvent = NamedEvent & {
85
87
  type: 'child-content-opened-in-browser';
86
88
  };
87
- export declare type ChildViewCreatedEvent = NamedEvent & {
89
+ export type ChildViewCreatedEvent = NamedEvent & {
88
90
  type: 'child-view-created';
89
91
  };
90
92
  /**
91
93
  * A WebContents event that does propagate to (republish on) parent topics.
92
94
  */
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 type WillPropagateWebContentsEvent = BlurredEvent | CertificateSelectionShownEvent | CrashedEvent | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | FaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent;
96
+ export type WebContentsEvent = NonPropagatedWebContentsEvent | WillPropagateWebContentsEvent;
95
97
  export {};
@@ -1,13 +1,13 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { NamedEvent, PropagatedEvent } from './base';
3
- import { PropagatedViewEvent } from './view';
3
+ import { BaseViewEvent, PropagatedViewEvent, AttachedEvent as ViewAttachedEvent } from './view';
4
4
  import { NonPropagatedWebContentsEvent, WillPropagateWebContentsEvent } from './webcontents';
5
- export declare type AlertRequestedEvent = NamedEvent & {
5
+ export type AlertRequestedEvent = NamedEvent & {
6
6
  type: 'alert-requested';
7
7
  message: string;
8
8
  url: string;
9
9
  };
10
- export declare type AuthRequestedEvent = NamedEvent & {
10
+ export type AuthRequestedEvent = NamedEvent & {
11
11
  type: 'auth-requested';
12
12
  authInfo: {
13
13
  host: string;
@@ -17,56 +17,56 @@ export declare type AuthRequestedEvent = NamedEvent & {
17
17
  scheme: string;
18
18
  };
19
19
  };
20
- export declare type EndLoadEvent = NamedEvent & {
20
+ export type EndLoadEvent = NamedEvent & {
21
21
  type: 'end-load';
22
22
  documentName: string;
23
23
  isMain: boolean;
24
24
  };
25
- export declare type WillRedirectEvent = NamedEvent & {
25
+ export type WillRedirectEvent = NamedEvent & {
26
26
  type: 'will-redirect';
27
27
  blocked: boolean;
28
28
  isInPlace: boolean;
29
29
  url: string;
30
30
  };
31
- export declare type ReloadedEvent = NamedEvent & {
31
+ export type ReloadedEvent = NamedEvent & {
32
32
  type: 'reloaded';
33
33
  url: string;
34
34
  };
35
- export declare type WindowOptionsChangedEvent = NamedEvent & {
35
+ export type WindowOptionsChangedEvent = NamedEvent & {
36
36
  type: 'options-changed';
37
37
  options: OpenFin.WindowOptions;
38
38
  diff: OpenFin.WindowOptionDiff;
39
39
  };
40
- export declare type ExternalProcessExitedEvent = NamedEvent & {
40
+ export type ExternalProcessExitedEvent = NamedEvent & {
41
41
  type: 'external-process-exited';
42
42
  processUuid: string;
43
43
  exitCode: number;
44
44
  };
45
- export declare type ExternalProcessStartedEvent = NamedEvent & {
45
+ export type ExternalProcessStartedEvent = NamedEvent & {
46
46
  type: 'external-process-started';
47
47
  processUuid: string;
48
48
  };
49
- export declare type HiddenEvent = NamedEvent & {
49
+ export type HiddenEvent = NamedEvent & {
50
50
  type: 'hidden';
51
51
  reason: 'closing' | 'hide' | 'hide-on-close';
52
52
  };
53
- export declare type PreloadScriptInfoRunning = {
53
+ export type PreloadScriptInfoRunning = {
54
54
  state: 'load-started' | 'load-failed' | 'load-succeeded' | 'failed' | 'succeeded';
55
55
  };
56
- export declare type PreloadScriptInfo = {
56
+ export type PreloadScriptInfo = {
57
57
  state: 'load-failed' | 'failed' | 'succeeded';
58
58
  };
59
- export declare type PreloadScriptsStateChangeEvent = NamedEvent & {
59
+ export type PreloadScriptsStateChangeEvent = NamedEvent & {
60
60
  preloadScripts: (PreloadScriptInfoRunning & any)[];
61
61
  };
62
- export declare type UserBoundsChangeEvent = NamedEvent & {
62
+ export type UserBoundsChangeEvent = NamedEvent & {
63
63
  height: number;
64
64
  left: number;
65
65
  top: number;
66
66
  width: number;
67
67
  windowState: 'minimized' | 'normal' | 'maximized';
68
68
  };
69
- export declare type BoundsChangeEvent = NamedEvent & {
69
+ export type BoundsChangeEvent = NamedEvent & {
70
70
  changeType: 0 | 1 | 2;
71
71
  deferred: boolean;
72
72
  height: number;
@@ -74,23 +74,21 @@ export declare type BoundsChangeEvent = NamedEvent & {
74
74
  top: number;
75
75
  width: number;
76
76
  };
77
- export declare type WillMoveOrResizeEvent = NamedEvent & {
77
+ export type WillMoveOrResizeEvent = NamedEvent & {
78
78
  height: number;
79
79
  left: number;
80
80
  top: number;
81
81
  width: number;
82
82
  monitorScaleFactor: number;
83
83
  };
84
- export declare type PerformanceReportEvent = Performance & NamedEvent & {
84
+ export type PerformanceReportEvent = Performance & NamedEvent & {
85
85
  type: 'performance-report';
86
86
  };
87
- export declare type ViewDetachedEvent = NamedEvent & {
87
+ export type ViewDetachedEvent = NamedEvent & BaseViewEvent & {
88
88
  type: 'view-detached';
89
89
  previousTarget: OpenFin.Identity;
90
- target: OpenFin.Identity;
91
- viewIdentity: OpenFin.Identity;
92
90
  };
93
- export declare type InputEvent = {
91
+ export type InputEvent = {
94
92
  inputType: 'keyUp' | 'keyDown';
95
93
  ctrlKey: boolean;
96
94
  shiftKey: boolean;
@@ -101,92 +99,102 @@ export declare type InputEvent = {
101
99
  repeat: boolean;
102
100
  command?: string;
103
101
  };
102
+ export type LayoutInitializedEvent = NamedEvent & {
103
+ type: 'layout-initialized';
104
+ ofViews: (OpenFin.Identity & {
105
+ entityType: 'view';
106
+ })[];
107
+ };
108
+ export type LayoutReadyEvent = NamedEvent & {
109
+ type: 'layout-ready';
110
+ views: (OpenFin.Identity & {
111
+ success: boolean;
112
+ })[];
113
+ };
104
114
  /**
105
115
  * A Window event that does not propagate to (republish on) parent topics.
106
116
  */
107
- export declare type NonPropagatedWindowEvent = NonPropagatedWebContentsEvent;
108
- export declare type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
117
+ export type NonPropagatedWindowEvent = NonPropagatedWebContentsEvent;
118
+ export type BeginUserBoundsChangingEvent = UserBoundsChangeEvent & {
109
119
  type: 'begin-user-bounds-changing';
110
120
  };
111
- export declare type BoundsChangedEvent = BoundsChangeEvent & {
121
+ export type BoundsChangedEvent = BoundsChangeEvent & {
112
122
  type: 'bounds-changed';
113
123
  };
114
- export declare type BoundsChangingEvent = BoundsChangeEvent & {
124
+ export type BoundsChangingEvent = BoundsChangeEvent & {
115
125
  type: 'bounds-changing';
116
126
  };
117
- export declare type WindowCloseRequestedEvent = NamedEvent & {
127
+ export type WindowCloseRequestedEvent = NamedEvent & {
118
128
  type: 'close-requested';
119
129
  };
120
- export declare type WindowClosedEvent = NamedEvent & {
130
+ export type WindowClosedEvent = NamedEvent & {
121
131
  type: 'closed';
122
132
  };
123
- export declare type WindowClosingEvent = NamedEvent & {
133
+ export type WindowClosingEvent = NamedEvent & {
124
134
  type: 'closing';
125
135
  };
126
- export declare type DisabledMovementBoundsChangedEvent = BoundsChangeEvent & {
136
+ export type DisabledMovementBoundsChangedEvent = BoundsChangeEvent & {
127
137
  type: 'disabled-movement-bounds-changed';
128
138
  };
129
- export declare type DisabledMovementBoundsChangingEvent = BoundsChangeEvent & {
139
+ export type DisabledMovementBoundsChangingEvent = BoundsChangeEvent & {
130
140
  type: 'disabled-movement-bounds-changing';
131
141
  };
132
- export declare type EmbeddedEvent = NamedEvent & {
142
+ export type EmbeddedEvent = NamedEvent & {
133
143
  type: 'embedded';
134
144
  };
135
- export declare type EndUserBoundsChangingEvent = UserBoundsChangeEvent & {
145
+ export type EndUserBoundsChangingEvent = UserBoundsChangeEvent & {
136
146
  type: 'end-user-bounds-changing';
137
147
  };
138
- export declare type WindowHotkeyEvent = InputEvent & NamedEvent & {
148
+ export type WindowHotkeyEvent = InputEvent & NamedEvent & {
139
149
  type: 'hotkey';
140
150
  };
141
- export declare type WindowInitializedEvent = NamedEvent & {
151
+ export type WindowInitializedEvent = NamedEvent & {
142
152
  type: 'initialized';
143
153
  };
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 & {
154
+ export type MaximizedEvent = NamedEvent & {
151
155
  type: 'maximized';
152
156
  };
153
- export declare type MinimizedEvent = NamedEvent & {
157
+ export type MinimizedEvent = NamedEvent & {
154
158
  type: 'minimized';
155
159
  };
156
- export declare type PreloadScriptsStateChangedEvent = PreloadScriptsStateChangeEvent & {
160
+ export type PreloadScriptsStateChangedEvent = PreloadScriptsStateChangeEvent & {
157
161
  type: 'preload-script-state-changed';
158
162
  };
159
- export declare type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent & {
163
+ export type PreloadScriptsStateChangingEvent = PreloadScriptsStateChangeEvent & {
160
164
  type: 'preload-script-state-changing';
161
165
  };
162
- export declare type WindowRestoredEvent = NamedEvent & {
166
+ export type WindowRestoredEvent = NamedEvent & {
163
167
  type: 'restored';
164
168
  };
165
- export declare type WindowShowRequestedEvent = NamedEvent & {
169
+ export type WindowShowRequestedEvent = NamedEvent & {
166
170
  type: 'show-requested';
167
171
  };
168
- export declare type WindowShownEvent = NamedEvent & {
172
+ export type WindowShownEvent = NamedEvent & {
169
173
  type: 'shown';
170
174
  };
171
- export declare type UserMovementEnabledEvent = NamedEvent & {
175
+ export type UserMovementEnabledEvent = NamedEvent & {
172
176
  type: 'user-movement-enabled';
173
177
  };
174
- export declare type UserMovementDisabledEvent = NamedEvent & {
178
+ export type UserMovementDisabledEvent = NamedEvent & {
175
179
  type: 'user-movement-disabled';
176
180
  };
177
- export declare type WillMoveEvent = WillMoveOrResizeEvent & {
181
+ export type WillMoveEvent = WillMoveOrResizeEvent & {
178
182
  type: 'will-move';
179
183
  };
180
- export declare type WillResizeEvent = WillMoveOrResizeEvent & {
184
+ export type WillResizeEvent = WillMoveOrResizeEvent & {
181
185
  type: 'will-resize';
182
186
  };
187
+ /**
188
+ * A propagated view event that is re-propagated from window.
189
+ */
190
+ export type PropagatedViewAttachedEvent = PropagatedEvent<'view', ViewAttachedEvent>;
183
191
  /**
184
192
  * A Window event that does propagate to (republish on) parent topics.
185
193
  */
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 = {
194
+ export type WillPropagateWindowEvent = WillPropagateWebContentsEvent | PropagatedViewAttachedEvent | 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;
195
+ export type WindowEvent = {
188
196
  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'];
197
+ } & (WillPropagateWindowEvent | NonPropagatedWindowEvent | PropagatedViewEvent);
198
+ export type WindowEventType = WindowEvent['type'];
199
+ export type PropagatedWindowEvent = PropagatedEvent<'window', Exclude<WillPropagateWindowEvent, WindowCloseRequestedEvent>>;
200
+ export type PropagatedWindowEventType = PropagatedWindowEvent['type'];
package/src/api/fin.d.ts CHANGED
@@ -15,7 +15,7 @@ import PlatformModule from './platform/index';
15
15
  import { Me } from './me';
16
16
  import InteropModule from './interop';
17
17
  import SnapshotSourceModule from './snapshot-source';
18
- declare type EntityType = OpenFin.EntityType;
18
+ type EntityType = OpenFin.EntityType;
19
19
  export interface FinApi<MeType extends EntityType> {
20
20
  readonly System: System;
21
21
  readonly Window: _WindowModule;
@@ -1,7 +1,7 @@
1
1
  import type * as OpenFin from '../../OpenFin';
2
2
  import { EmitterBase } from '../base';
3
3
  import { Transport } from '../../transport/transport';
4
- declare type FrameEvents = OpenFin.FrameEvent;
4
+ 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,9 +1,9 @@
1
1
  import type * as OpenFin from '../../../OpenFin';
2
2
  import { Transport } from '../../../transport/transport';
3
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
4
- declare type ChannelMiddleware = OpenFin.ChannelMiddleware;
5
- declare type ErrorMiddleware = OpenFin.ErrorMiddleware;
6
- declare type ChannelAction = OpenFin.ChannelAction;
3
+ type ProviderIdentity = OpenFin.ProviderIdentity;
4
+ type ChannelMiddleware = OpenFin.ChannelMiddleware;
5
+ type ErrorMiddleware = OpenFin.ErrorMiddleware;
6
+ type ChannelAction = OpenFin.ChannelAction;
7
7
  export declare class ProtectedItems {
8
8
  providerIdentity: ProviderIdentity;
9
9
  wire: Transport;
@@ -13,12 +13,12 @@ class ProtectedItems {
13
13
  }
14
14
  exports.ProtectedItems = ProtectedItems;
15
15
  class ChannelBase {
16
- constructor() {
17
- this.subscriptions = new Map();
18
- }
19
16
  static defaultAction(topic) {
20
17
  throw new Error(`No action registered at target for ${topic}`);
21
18
  }
19
+ constructor() {
20
+ this.subscriptions = new Map();
21
+ }
22
22
  async processAction(topic, payload, senderIdentity) {
23
23
  try {
24
24
  const mainAction = this.subscriptions.has(topic)
@@ -2,8 +2,8 @@ import type * as OpenFin from '../../../OpenFin';
2
2
  import { ChannelBase } from './channel';
3
3
  import { Transport } from '../../../transport/transport';
4
4
  import { AnyStrategy } from './protocols/strategy-types';
5
- declare type ProviderIdentity = OpenFin.ProviderIdentity;
6
- declare type DisconnectionListener = (providerIdentity: ProviderIdentity) => any;
5
+ type ProviderIdentity = OpenFin.ProviderIdentity;
6
+ type DisconnectionListener = (providerIdentity: ProviderIdentity) => any;
7
7
  interface RoutingInfo extends ProviderIdentity {
8
8
  endpointId: string;
9
9
  }
@@ -1,20 +1,35 @@
1
1
  "use strict";
2
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
6
+ };
2
7
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
8
  if (kind === "m") throw new TypeError("Private method is not writable");
4
9
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
10
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
11
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
12
  };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
13
  var _ChannelClient_protectedObj, _ChannelClient_strategy, _ChannelClient_close;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const channel_1 = require("./channel");
16
16
  const channelClientsByEndpointId = new Map();
17
17
  class ChannelClient extends channel_1.ChannelBase {
18
+ static closeChannelByEndpointId(id) {
19
+ const channel = channelClientsByEndpointId.get(id);
20
+ if (channel) {
21
+ __classPrivateFieldGet(channel, _ChannelClient_close, "f").call(channel);
22
+ }
23
+ }
24
+ // closes the corresponding channel and invokes the disconnect listener if an event payload is passed.
25
+ static handleProviderDisconnect(eventPayload) {
26
+ for (const channelClient of channelClientsByEndpointId.values()) {
27
+ if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
28
+ channelClient.disconnectListener(eventPayload);
29
+ __classPrivateFieldGet(channelClient, _ChannelClient_close, "f").call(channelClient);
30
+ }
31
+ }
32
+ }
18
33
  constructor(routingInfo, wire, strategy) {
19
34
  super();
20
35
  _ChannelClient_protectedObj.set(this, void 0);
@@ -32,21 +47,6 @@ class ChannelClient extends channel_1.ChannelBase {
32
47
  channelClientsByEndpointId.set(this.endpointId, this);
33
48
  strategy.receive(this.processAction);
34
49
  }
35
- static closeChannelByEndpointId(id) {
36
- const channel = channelClientsByEndpointId.get(id);
37
- if (channel) {
38
- __classPrivateFieldGet(channel, _ChannelClient_close, "f").call(channel);
39
- }
40
- }
41
- // closes the corresponding channel and invokes the disconnect listener if an event payload is passed.
42
- static handleProviderDisconnect(eventPayload) {
43
- for (const channelClient of channelClientsByEndpointId.values()) {
44
- if (channelClient.providerIdentity.channelId === eventPayload.channelId) {
45
- channelClient.disconnectListener(eventPayload);
46
- __classPrivateFieldGet(channelClient, _ChannelClient_close, "f").call(channelClient);
47
- }
48
- }
49
- }
50
50
  get providerIdentity() {
51
51
  const protectedObj = __classPrivateFieldGet(this, _ChannelClient_protectedObj, "f");
52
52
  return protectedObj.providerIdentity;
@@ -6,7 +6,7 @@ import { ClientOffer, LocalSupportedProtocol } from './protocols/index';
6
6
  import { RTCPacket } from './protocols/rtc/endpoint';
7
7
  import { ChannelProvider } from './provider';
8
8
  import { AnyStrategy } from './protocols/strategy-types';
9
- export declare type ProviderEntry = {
9
+ export type ProviderEntry = {
10
10
  provider: ChannelProvider;
11
11
  strategy: AnyStrategy;
12
12
  supportedProtocols: LocalSupportedProtocol[];