@openfin/core 41.100.72 → 41.100.78

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.
@@ -1,4 +1,5 @@
1
- import OpenFin from './mock';
1
+ // eslint-disable-next-line import/no-named-as-default
2
+ import OpenFin from './stub';
2
3
 
3
4
  export = OpenFin;
4
5
  export as namespace OpenFin;
@@ -4676,6 +4676,15 @@ declare class EmitterBase<EmitterEvent extends BaseEvent, EmitterEventType exten
4676
4676
  eventNames: () => (string | symbol)[];
4677
4677
  /* Excluded from this release type: emit */
4678
4678
  private hasEmitter;
4679
+ /**
4680
+ * Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
4681
+ * `once` subscription.
4682
+ *
4683
+ * @remarks Implementing this as a `removeListener` handler ensures that direct removal of a listener
4684
+ * on the base emitter will not leak additional core handlers. We could do this in the forwarding method,
4685
+ * which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
4686
+ */
4687
+ private cleanUpRemovedListener;
4679
4688
  private getOrCreateEmitter;
4680
4689
  listeners: (type: string | symbol) => Function[];
4681
4690
  listenerCount: (type: string | symbol) => number;
@@ -5754,6 +5763,30 @@ declare type FrameProcessDetails = ProcessDetails & {
5754
5763
  entityType: string;
5755
5764
  };
5756
5765
 
5766
+ /**
5767
+ * @interface
5768
+ * Options for the {@link Window._Window.getBounds} method.
5769
+ */
5770
+ declare interface GetBoundsOptions {
5771
+ /**
5772
+ * Specifies the state of the window for which to retrieve the bounds.
5773
+ *
5774
+ * - `'normal'`: Returns the bounds of the window in its 'normal' state (not maximized or minimized).
5775
+ * - `'current'`: Returns the bounds of the window in its current state. For a minimized window, this returns the bounds from its previous state before being minimized.
5776
+ *
5777
+ * If a window is in `normal` state, `current` and `normal` will return the same bounds.
5778
+ *
5779
+ * If a window is `maximized`, `current` will return the dimensions of the screen while `normal` will return the bounds the window will be restored to.
5780
+ *
5781
+ * If a window is `minimized`, both `current` and `normal` will return the bounds of the window prior to it being minimized.
5782
+ *
5783
+ * **Edge case:** On MacOS, if a window is maximized, then minimized, calling `getBounds` with `boundsType: 'current'` will return the bounds of the window when it was maximized while `normal` will return the normal bounds.
5784
+ *
5785
+ * @default 'normal'
5786
+ */
5787
+ boundsType?: 'normal' | 'current';
5788
+ }
5789
+
5757
5790
  /**
5758
5791
  * @interface
5759
5792
  */
@@ -7661,7 +7694,7 @@ declare type LaunchIntoPlatformPayload = {
7661
7694
  *
7662
7695
  * @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
7663
7696
  *
7664
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
7697
+ * #### [addEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
7665
7698
  * Adds a listener to the end of the listeners array for the specified event.
7666
7699
  * @example
7667
7700
  * ```js
@@ -7678,7 +7711,7 @@ declare type LaunchIntoPlatformPayload = {
7678
7711
  * });
7679
7712
  * ```
7680
7713
  *
7681
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
7714
+ * #### [removeEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener)
7682
7715
  * Adds a listener to the end of the listeners array for the specified event.
7683
7716
  * @example
7684
7717
  * ```js
@@ -7942,7 +7975,7 @@ declare class Layout extends Base {
7942
7975
  */
7943
7976
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
7944
7977
  /**
7945
- * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
7978
+ * Adds a view to the platform layout. Behaves like {@link Platform#createView Platform.createView} with the current layout as the target.
7946
7979
  *
7947
7980
  * @param viewOptions - The options for creating the view.
7948
7981
  * @param options - Optional parameters for adding the view.
@@ -7958,7 +7991,7 @@ declare class Layout extends Base {
7958
7991
  }>;
7959
7992
  /**
7960
7993
  * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
7961
- * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
7994
+ * Behaves like {@link Platform#closeView Platform.closeView} but only closes the view if it belongs the current layout.
7962
7995
  *
7963
7996
  * @param viewIdentity - The identity of the view to close.
7964
7997
  * @returns A promise that resolves when the view is closed.
@@ -9405,6 +9438,7 @@ declare namespace OpenFin_2 {
9405
9438
  ScreenCapturePermission,
9406
9439
  Bounds,
9407
9440
  WindowBounds,
9441
+ GetBoundsOptions,
9408
9442
  Rectangle,
9409
9443
  ApplicationCreationOptions,
9410
9444
  TimeZones,
@@ -12127,7 +12161,9 @@ declare interface ProtocolMap extends ProtocolMapBase {
12127
12161
  options: OpenFin_2.TransitionOptions;
12128
12162
  }>;
12129
12163
  'get-all-frames': IdentityCall<{}, OpenFin_2.FrameInfo[]>;
12130
- 'get-window-bounds': IdentityCall<{}, OpenFin_2.WindowBounds>;
12164
+ 'get-window-bounds': IdentityCall<{
12165
+ options?: OpenFin_2.GetBoundsOptions;
12166
+ }, OpenFin_2.WindowBounds>;
12131
12167
  'center-window': IdentityCall;
12132
12168
  'blur-window': IdentityCall;
12133
12169
  'bring-window-to-front': IdentityCall;
@@ -13534,6 +13570,7 @@ declare type Snapshot = {
13534
13570
  declare type SnapshotAppliedEvent = BaseEvents.BaseEvent & {
13535
13571
  topic: 'application';
13536
13572
  type: 'platform-snapshot-applied';
13573
+ snapshot: Snapshot;
13537
13574
  };
13538
13575
 
13539
13576
  /**
@@ -17655,7 +17692,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
17655
17692
  * getBounds().then(bounds => console.log(bounds)).catch(err => console.log(err));
17656
17693
  * ```
17657
17694
  */
17658
- getBounds(): Promise<OpenFin_2.WindowBounds>;
17695
+ getBounds(options?: OpenFin_2.GetBoundsOptions): Promise<OpenFin_2.WindowBounds>;
17659
17696
  /**
17660
17697
  * Centers the window on its current screen.
17661
17698
  *
@@ -4676,6 +4676,15 @@ declare class EmitterBase<EmitterEvent extends BaseEvent, EmitterEventType exten
4676
4676
  eventNames: () => (string | symbol)[];
4677
4677
  /* Excluded from this release type: emit */
4678
4678
  private hasEmitter;
4679
+ /**
4680
+ * Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
4681
+ * `once` subscription.
4682
+ *
4683
+ * @remarks Implementing this as a `removeListener` handler ensures that direct removal of a listener
4684
+ * on the base emitter will not leak additional core handlers. We could do this in the forwarding method,
4685
+ * which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
4686
+ */
4687
+ private cleanUpRemovedListener;
4679
4688
  private getOrCreateEmitter;
4680
4689
  listeners: (type: string | symbol) => Function[];
4681
4690
  listenerCount: (type: string | symbol) => number;
@@ -5754,6 +5763,30 @@ declare type FrameProcessDetails = ProcessDetails & {
5754
5763
  entityType: string;
5755
5764
  };
5756
5765
 
5766
+ /**
5767
+ * @interface
5768
+ * Options for the {@link Window._Window.getBounds} method.
5769
+ */
5770
+ declare interface GetBoundsOptions {
5771
+ /**
5772
+ * Specifies the state of the window for which to retrieve the bounds.
5773
+ *
5774
+ * - `'normal'`: Returns the bounds of the window in its 'normal' state (not maximized or minimized).
5775
+ * - `'current'`: Returns the bounds of the window in its current state. For a minimized window, this returns the bounds from its previous state before being minimized.
5776
+ *
5777
+ * If a window is in `normal` state, `current` and `normal` will return the same bounds.
5778
+ *
5779
+ * If a window is `maximized`, `current` will return the dimensions of the screen while `normal` will return the bounds the window will be restored to.
5780
+ *
5781
+ * If a window is `minimized`, both `current` and `normal` will return the bounds of the window prior to it being minimized.
5782
+ *
5783
+ * **Edge case:** On MacOS, if a window is maximized, then minimized, calling `getBounds` with `boundsType: 'current'` will return the bounds of the window when it was maximized while `normal` will return the normal bounds.
5784
+ *
5785
+ * @default 'normal'
5786
+ */
5787
+ boundsType?: 'normal' | 'current';
5788
+ }
5789
+
5757
5790
  /**
5758
5791
  * @interface
5759
5792
  */
@@ -7661,7 +7694,7 @@ declare type LaunchIntoPlatformPayload = {
7661
7694
  *
7662
7695
  * @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
7663
7696
  *
7664
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
7697
+ * #### [addEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
7665
7698
  * Adds a listener to the end of the listeners array for the specified event.
7666
7699
  * @example
7667
7700
  * ```js
@@ -7678,7 +7711,7 @@ declare type LaunchIntoPlatformPayload = {
7678
7711
  * });
7679
7712
  * ```
7680
7713
  *
7681
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
7714
+ * #### [removeEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener)
7682
7715
  * Adds a listener to the end of the listeners array for the specified event.
7683
7716
  * @example
7684
7717
  * ```js
@@ -7942,7 +7975,7 @@ declare class Layout extends Base {
7942
7975
  */
7943
7976
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
7944
7977
  /**
7945
- * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
7978
+ * Adds a view to the platform layout. Behaves like {@link Platform#createView Platform.createView} with the current layout as the target.
7946
7979
  *
7947
7980
  * @param viewOptions - The options for creating the view.
7948
7981
  * @param options - Optional parameters for adding the view.
@@ -7958,7 +7991,7 @@ declare class Layout extends Base {
7958
7991
  }>;
7959
7992
  /**
7960
7993
  * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
7961
- * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
7994
+ * Behaves like {@link Platform#closeView Platform.closeView} but only closes the view if it belongs the current layout.
7962
7995
  *
7963
7996
  * @param viewIdentity - The identity of the view to close.
7964
7997
  * @returns A promise that resolves when the view is closed.
@@ -9405,6 +9438,7 @@ declare namespace OpenFin_2 {
9405
9438
  ScreenCapturePermission,
9406
9439
  Bounds,
9407
9440
  WindowBounds,
9441
+ GetBoundsOptions,
9408
9442
  Rectangle,
9409
9443
  ApplicationCreationOptions,
9410
9444
  TimeZones,
@@ -12127,7 +12161,9 @@ declare interface ProtocolMap extends ProtocolMapBase {
12127
12161
  options: OpenFin_2.TransitionOptions;
12128
12162
  }>;
12129
12163
  'get-all-frames': IdentityCall<{}, OpenFin_2.FrameInfo[]>;
12130
- 'get-window-bounds': IdentityCall<{}, OpenFin_2.WindowBounds>;
12164
+ 'get-window-bounds': IdentityCall<{
12165
+ options?: OpenFin_2.GetBoundsOptions;
12166
+ }, OpenFin_2.WindowBounds>;
12131
12167
  'center-window': IdentityCall;
12132
12168
  'blur-window': IdentityCall;
12133
12169
  'bring-window-to-front': IdentityCall;
@@ -13534,6 +13570,7 @@ declare type Snapshot = {
13534
13570
  declare type SnapshotAppliedEvent = BaseEvents.BaseEvent & {
13535
13571
  topic: 'application';
13536
13572
  type: 'platform-snapshot-applied';
13573
+ snapshot: Snapshot;
13537
13574
  };
13538
13575
 
13539
13576
  /**
@@ -17655,7 +17692,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
17655
17692
  * getBounds().then(bounds => console.log(bounds)).catch(err => console.log(err));
17656
17693
  * ```
17657
17694
  */
17658
- getBounds(): Promise<OpenFin_2.WindowBounds>;
17695
+ getBounds(options?: OpenFin_2.GetBoundsOptions): Promise<OpenFin_2.WindowBounds>;
17659
17696
  /**
17660
17697
  * Centers the window on its current screen.
17661
17698
  *
@@ -4676,6 +4676,15 @@ declare class EmitterBase<EmitterEvent extends BaseEvent, EmitterEventType exten
4676
4676
  eventNames: () => (string | symbol)[];
4677
4677
  /* Excluded from this release type: emit */
4678
4678
  private hasEmitter;
4679
+ /**
4680
+ * Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
4681
+ * `once` subscription.
4682
+ *
4683
+ * @remarks Implementing this as a `removeListener` handler ensures that direct removal of a listener
4684
+ * on the base emitter will not leak additional core handlers. We could do this in the forwarding method,
4685
+ * which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
4686
+ */
4687
+ private cleanUpRemovedListener;
4679
4688
  private getOrCreateEmitter;
4680
4689
  listeners: (type: string | symbol) => Function[];
4681
4690
  listenerCount: (type: string | symbol) => number;
@@ -5754,6 +5763,30 @@ declare type FrameProcessDetails = ProcessDetails & {
5754
5763
  entityType: string;
5755
5764
  };
5756
5765
 
5766
+ /**
5767
+ * @interface
5768
+ * Options for the {@link Window._Window.getBounds} method.
5769
+ */
5770
+ declare interface GetBoundsOptions {
5771
+ /**
5772
+ * Specifies the state of the window for which to retrieve the bounds.
5773
+ *
5774
+ * - `'normal'`: Returns the bounds of the window in its 'normal' state (not maximized or minimized).
5775
+ * - `'current'`: Returns the bounds of the window in its current state. For a minimized window, this returns the bounds from its previous state before being minimized.
5776
+ *
5777
+ * If a window is in `normal` state, `current` and `normal` will return the same bounds.
5778
+ *
5779
+ * If a window is `maximized`, `current` will return the dimensions of the screen while `normal` will return the bounds the window will be restored to.
5780
+ *
5781
+ * If a window is `minimized`, both `current` and `normal` will return the bounds of the window prior to it being minimized.
5782
+ *
5783
+ * **Edge case:** On MacOS, if a window is maximized, then minimized, calling `getBounds` with `boundsType: 'current'` will return the bounds of the window when it was maximized while `normal` will return the normal bounds.
5784
+ *
5785
+ * @default 'normal'
5786
+ */
5787
+ boundsType?: 'normal' | 'current';
5788
+ }
5789
+
5757
5790
  /**
5758
5791
  * @interface
5759
5792
  */
@@ -7661,7 +7694,7 @@ declare type LaunchIntoPlatformPayload = {
7661
7694
  *
7662
7695
  * @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
7663
7696
  *
7664
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
7697
+ * #### [addEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
7665
7698
  * Adds a listener to the end of the listeners array for the specified event.
7666
7699
  * @example
7667
7700
  * ```js
@@ -7678,7 +7711,7 @@ declare type LaunchIntoPlatformPayload = {
7678
7711
  * });
7679
7712
  * ```
7680
7713
  *
7681
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
7714
+ * #### [removeEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener)
7682
7715
  * Adds a listener to the end of the listeners array for the specified event.
7683
7716
  * @example
7684
7717
  * ```js
@@ -7942,7 +7975,7 @@ declare class Layout extends Base {
7942
7975
  */
7943
7976
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
7944
7977
  /**
7945
- * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
7978
+ * Adds a view to the platform layout. Behaves like {@link Platform#createView Platform.createView} with the current layout as the target.
7946
7979
  *
7947
7980
  * @param viewOptions - The options for creating the view.
7948
7981
  * @param options - Optional parameters for adding the view.
@@ -7958,7 +7991,7 @@ declare class Layout extends Base {
7958
7991
  }>;
7959
7992
  /**
7960
7993
  * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
7961
- * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
7994
+ * Behaves like {@link Platform#closeView Platform.closeView} but only closes the view if it belongs the current layout.
7962
7995
  *
7963
7996
  * @param viewIdentity - The identity of the view to close.
7964
7997
  * @returns A promise that resolves when the view is closed.
@@ -9405,6 +9438,7 @@ declare namespace OpenFin_2 {
9405
9438
  ScreenCapturePermission,
9406
9439
  Bounds,
9407
9440
  WindowBounds,
9441
+ GetBoundsOptions,
9408
9442
  Rectangle,
9409
9443
  ApplicationCreationOptions,
9410
9444
  TimeZones,
@@ -12127,7 +12161,9 @@ declare interface ProtocolMap extends ProtocolMapBase {
12127
12161
  options: OpenFin_2.TransitionOptions;
12128
12162
  }>;
12129
12163
  'get-all-frames': IdentityCall<{}, OpenFin_2.FrameInfo[]>;
12130
- 'get-window-bounds': IdentityCall<{}, OpenFin_2.WindowBounds>;
12164
+ 'get-window-bounds': IdentityCall<{
12165
+ options?: OpenFin_2.GetBoundsOptions;
12166
+ }, OpenFin_2.WindowBounds>;
12131
12167
  'center-window': IdentityCall;
12132
12168
  'blur-window': IdentityCall;
12133
12169
  'bring-window-to-front': IdentityCall;
@@ -13534,6 +13570,7 @@ declare type Snapshot = {
13534
13570
  declare type SnapshotAppliedEvent = BaseEvents.BaseEvent & {
13535
13571
  topic: 'application';
13536
13572
  type: 'platform-snapshot-applied';
13573
+ snapshot: Snapshot;
13537
13574
  };
13538
13575
 
13539
13576
  /**
@@ -17655,7 +17692,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
17655
17692
  * getBounds().then(bounds => console.log(bounds)).catch(err => console.log(err));
17656
17693
  * ```
17657
17694
  */
17658
- getBounds(): Promise<OpenFin_2.WindowBounds>;
17695
+ getBounds(options?: OpenFin_2.GetBoundsOptions): Promise<OpenFin_2.WindowBounds>;
17659
17696
  /**
17660
17697
  * Centers the window on its current screen.
17661
17698
  *
@@ -4740,6 +4740,15 @@ declare class EmitterBase<EmitterEvent extends BaseEvent, EmitterEventType exten
4740
4740
  type: EventType;
4741
4741
  }>, ...args: any[]) => boolean;
4742
4742
  private hasEmitter;
4743
+ /**
4744
+ * Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
4745
+ * `once` subscription.
4746
+ *
4747
+ * @remarks Implementing this as a `removeListener` handler ensures that direct removal of a listener
4748
+ * on the base emitter will not leak additional core handlers. We could do this in the forwarding method,
4749
+ * which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
4750
+ */
4751
+ private cleanUpRemovedListener;
4743
4752
  private getOrCreateEmitter;
4744
4753
  listeners: (type: string | symbol) => Function[];
4745
4754
  listenerCount: (type: string | symbol) => number;
@@ -5842,6 +5851,30 @@ declare type FrameProcessDetails = ProcessDetails & {
5842
5851
  entityType: string;
5843
5852
  };
5844
5853
 
5854
+ /**
5855
+ * @interface
5856
+ * Options for the {@link Window._Window.getBounds} method.
5857
+ */
5858
+ declare interface GetBoundsOptions {
5859
+ /**
5860
+ * Specifies the state of the window for which to retrieve the bounds.
5861
+ *
5862
+ * - `'normal'`: Returns the bounds of the window in its 'normal' state (not maximized or minimized).
5863
+ * - `'current'`: Returns the bounds of the window in its current state. For a minimized window, this returns the bounds from its previous state before being minimized.
5864
+ *
5865
+ * If a window is in `normal` state, `current` and `normal` will return the same bounds.
5866
+ *
5867
+ * If a window is `maximized`, `current` will return the dimensions of the screen while `normal` will return the bounds the window will be restored to.
5868
+ *
5869
+ * If a window is `minimized`, both `current` and `normal` will return the bounds of the window prior to it being minimized.
5870
+ *
5871
+ * **Edge case:** On MacOS, if a window is maximized, then minimized, calling `getBounds` with `boundsType: 'current'` will return the bounds of the window when it was maximized while `normal` will return the normal bounds.
5872
+ *
5873
+ * @default 'normal'
5874
+ */
5875
+ boundsType?: 'normal' | 'current';
5876
+ }
5877
+
5845
5878
  /**
5846
5879
  * @interface
5847
5880
  */
@@ -7778,7 +7811,7 @@ declare type LaunchIntoPlatformPayload = {
7778
7811
  *
7779
7812
  * @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
7780
7813
  *
7781
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
7814
+ * #### [addEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
7782
7815
  * Adds a listener to the end of the listeners array for the specified event.
7783
7816
  * @example
7784
7817
  * ```js
@@ -7795,7 +7828,7 @@ declare type LaunchIntoPlatformPayload = {
7795
7828
  * });
7796
7829
  * ```
7797
7830
  *
7798
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
7831
+ * #### [removeEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener)
7799
7832
  * Adds a listener to the end of the listeners array for the specified event.
7800
7833
  * @example
7801
7834
  * ```js
@@ -8068,7 +8101,7 @@ declare class Layout extends Base {
8068
8101
  */
8069
8102
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
8070
8103
  /**
8071
- * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
8104
+ * Adds a view to the platform layout. Behaves like {@link Platform#createView Platform.createView} with the current layout as the target.
8072
8105
  *
8073
8106
  * @param viewOptions - The options for creating the view.
8074
8107
  * @param options - Optional parameters for adding the view.
@@ -8084,7 +8117,7 @@ declare class Layout extends Base {
8084
8117
  }>;
8085
8118
  /**
8086
8119
  * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
8087
- * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
8120
+ * Behaves like {@link Platform#closeView Platform.closeView} but only closes the view if it belongs the current layout.
8088
8121
  *
8089
8122
  * @param viewIdentity - The identity of the view to close.
8090
8123
  * @returns A promise that resolves when the view is closed.
@@ -9723,6 +9756,7 @@ declare namespace OpenFin_2 {
9723
9756
  ScreenCapturePermission,
9724
9757
  Bounds,
9725
9758
  WindowBounds,
9759
+ GetBoundsOptions,
9726
9760
  Rectangle,
9727
9761
  ApplicationCreationOptions,
9728
9762
  TimeZones,
@@ -12528,7 +12562,9 @@ declare interface ProtocolMap extends ProtocolMapBase {
12528
12562
  options: OpenFin_2.TransitionOptions;
12529
12563
  }>;
12530
12564
  'get-all-frames': IdentityCall<{}, OpenFin_2.FrameInfo[]>;
12531
- 'get-window-bounds': IdentityCall<{}, OpenFin_2.WindowBounds>;
12565
+ 'get-window-bounds': IdentityCall<{
12566
+ options?: OpenFin_2.GetBoundsOptions;
12567
+ }, OpenFin_2.WindowBounds>;
12532
12568
  'center-window': IdentityCall;
12533
12569
  'blur-window': IdentityCall;
12534
12570
  'bring-window-to-front': IdentityCall;
@@ -13935,6 +13971,7 @@ declare type Snapshot = {
13935
13971
  declare type SnapshotAppliedEvent = BaseEvents.BaseEvent & {
13936
13972
  topic: 'application';
13937
13973
  type: 'platform-snapshot-applied';
13974
+ snapshot: Snapshot;
13938
13975
  };
13939
13976
 
13940
13977
  /**
@@ -18109,7 +18146,7 @@ declare class _Window extends WebContents<OpenFin_2.WindowEvent> {
18109
18146
  * getBounds().then(bounds => console.log(bounds)).catch(err => console.log(err));
18110
18147
  * ```
18111
18148
  */
18112
- getBounds(): Promise<OpenFin_2.WindowBounds>;
18149
+ getBounds(options?: OpenFin_2.GetBoundsOptions): Promise<OpenFin_2.WindowBounds>;
18113
18150
  /**
18114
18151
  * Centers the window on its current screen.
18115
18152
  *
@@ -372,7 +372,7 @@ var __classPrivateFieldGet$h = (commonjsGlobal && commonjsGlobal.__classPrivateF
372
372
  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");
373
373
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
374
374
  };
375
- var _EmitterBase_emitterAccessor;
375
+ var _EmitterBase_emitterAccessor, _EmitterBase_deregisterOnceListeners;
376
376
  Object.defineProperty(base, "__esModule", { value: true });
377
377
  base.Reply = base.EmitterBase = base.Base = void 0;
378
378
  const promises_1 = promises;
@@ -444,6 +444,7 @@ class EmitterBase extends Base {
444
444
  super(wire);
445
445
  this.topic = topic;
446
446
  _EmitterBase_emitterAccessor.set(this, void 0);
447
+ _EmitterBase_deregisterOnceListeners.set(this, void 0);
447
448
  this.eventNames = () => (this.hasEmitter() ? this.getOrCreateEmitter().eventNames() : []);
448
449
  /**
449
450
  * @internal
@@ -452,7 +453,28 @@ class EmitterBase extends Base {
452
453
  return this.hasEmitter() ? this.getOrCreateEmitter().emit(eventType, payload, ...args) : false;
453
454
  };
454
455
  this.hasEmitter = () => this.wire.eventAggregator.has(__classPrivateFieldGet$h(this, _EmitterBase_emitterAccessor, "f"));
455
- this.getOrCreateEmitter = () => this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$h(this, _EmitterBase_emitterAccessor, "f"));
456
+ /**
457
+ * Cleans up after removal of a listener, e.g. deleting any lingering deregistration handlers for a
458
+ * `once` subscription.
459
+ *
460
+ * @remarks Implementing this as a `removeListener` handler ensures that direct removal of a listener
461
+ * on the base emitter will not leak additional core handlers. We could do this in the forwarding method,
462
+ * which would involve less "magic," but would be more-vulnerable to accidental re-introduction of a leak.
463
+ */
464
+ this.cleanUpRemovedListener = (eventType, listener) => {
465
+ const deregister = __classPrivateFieldGet$h(this, _EmitterBase_deregisterOnceListeners, "f").get(listener);
466
+ if (deregister) {
467
+ const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$h(this, _EmitterBase_emitterAccessor, "f"));
468
+ emitter.removeListener(eventType, deregister);
469
+ }
470
+ };
471
+ this.getOrCreateEmitter = () => {
472
+ const emitter = this.wire.eventAggregator.getOrCreate(__classPrivateFieldGet$h(this, _EmitterBase_emitterAccessor, "f"));
473
+ if (!emitter.listeners('removeListener').includes(this.cleanUpRemovedListener)) {
474
+ emitter.on('removeListener', this.cleanUpRemovedListener);
475
+ }
476
+ return emitter;
477
+ };
456
478
  this.listeners = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(type) : [];
457
479
  this.listenerCount = (type) => this.hasEmitter() ? this.getOrCreateEmitter().listenerCount(type) : 0;
458
480
  this.registerEventListener = async (eventType, options = {}, applySubscription, undoSubscription) => {
@@ -484,13 +506,13 @@ class EmitterBase extends Base {
484
506
  type: eventType
485
507
  };
486
508
  await this.wire.sendAction('unsubscribe-to-desktop-event', runtimeEvent).catch(() => null);
487
- const emitter = this.getOrCreateEmitter();
488
- return emitter;
509
+ return this.getOrCreateEmitter();
489
510
  }
490
511
  // This will only be reached if unsubscribe from event that does not exist but do not want to error here
491
512
  return Promise.resolve();
492
513
  };
493
514
  __classPrivateFieldSet$g(this, _EmitterBase_emitterAccessor, [topic, ...additionalAccessors], "f");
515
+ __classPrivateFieldSet$g(this, _EmitterBase_deregisterOnceListeners, new WeakMap(), "f");
494
516
  this.listeners = (event) => this.hasEmitter() ? this.getOrCreateEmitter().listeners(event) : [];
495
517
  }
496
518
  /**
@@ -519,6 +541,7 @@ class EmitterBase extends Base {
519
541
  */
520
542
  async once(eventType, listener, options) {
521
543
  const deregister = () => this.deregisterEventListener(eventType);
544
+ __classPrivateFieldGet$h(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
522
545
  await this.registerEventListener(eventType, options, (emitter) => {
523
546
  emitter.once(eventType, deregister);
524
547
  emitter.once(eventType, listener);
@@ -549,6 +572,7 @@ class EmitterBase extends Base {
549
572
  */
550
573
  async prependOnceListener(eventType, listener, options) {
551
574
  const deregister = () => this.deregisterEventListener(eventType);
575
+ __classPrivateFieldGet$h(this, _EmitterBase_deregisterOnceListeners, "f").set(listener, deregister);
552
576
  await this.registerEventListener(eventType, options, (emitter) => {
553
577
  emitter.prependOnceListener(eventType, listener);
554
578
  emitter.once(eventType, deregister);
@@ -607,13 +631,13 @@ class EmitterBase extends Base {
607
631
  return this;
608
632
  }
609
633
  deleteEmitterIfNothingRegistered(emitter) {
610
- if (emitter.eventNames().length === 0) {
634
+ if (emitter.eventNames().every((type) => type === 'removeListener')) {
611
635
  this.wire.eventAggregator.delete(__classPrivateFieldGet$h(this, _EmitterBase_emitterAccessor, "f"));
612
636
  }
613
637
  }
614
638
  }
615
639
  base.EmitterBase = EmitterBase;
616
- _EmitterBase_emitterAccessor = new WeakMap();
640
+ _EmitterBase_emitterAccessor = new WeakMap(), _EmitterBase_deregisterOnceListeners = new WeakMap();
617
641
  class Reply {
618
642
  }
619
643
  base.Reply = Reply;
@@ -4039,9 +4063,9 @@ function requireInstance () {
4039
4063
  * getBounds().then(bounds => console.log(bounds)).catch(err => console.log(err));
4040
4064
  * ```
4041
4065
  */
4042
- getBounds() {
4066
+ getBounds(options) {
4043
4067
  return this.wire
4044
- .sendAction('get-window-bounds', this.identity)
4068
+ .sendAction('get-window-bounds', { ...this.identity, options })
4045
4069
  .then(({ payload }) => payload.data);
4046
4070
  }
4047
4071
  /**
@@ -11991,7 +12015,7 @@ const layout_constants_1$1 = layout_constants;
11991
12015
  *
11992
12016
  * @remarks The built-in event emitter is not an OpenFin event emitter so it doesn't share propagation semantics.
11993
12017
  *
11994
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener addEventListener(type, listener [, options]);}
12018
+ * #### [addEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener)
11995
12019
  * Adds a listener to the end of the listeners array for the specified event.
11996
12020
  * @example
11997
12021
  * ```js
@@ -12008,7 +12032,7 @@ const layout_constants_1$1 = layout_constants;
12008
12032
  * });
12009
12033
  * ```
12010
12034
  *
12011
- * #### {@link https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener removeEventListener(type, listener [, options]);}
12035
+ * #### [removeEventListener(type, listener [, options]);](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener)
12012
12036
  * Adds a listener to the end of the listeners array for the specified event.
12013
12037
  * @example
12014
12038
  * ```js
@@ -12359,7 +12383,7 @@ class Layout extends base_1$8.Base {
12359
12383
  return layout_entities_1.LayoutNode.getEntity(stack, client);
12360
12384
  }
12361
12385
  /**
12362
- * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
12386
+ * Adds a view to the platform layout. Behaves like {@link Platform#createView Platform.createView} with the current layout as the target.
12363
12387
  *
12364
12388
  * @param viewOptions - The options for creating the view.
12365
12389
  * @param options - Optional parameters for adding the view.
@@ -12380,7 +12404,7 @@ class Layout extends base_1$8.Base {
12380
12404
  }
12381
12405
  /**
12382
12406
  * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
12383
- * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
12407
+ * Behaves like {@link Platform#closeView Platform.closeView} but only closes the view if it belongs the current layout.
12384
12408
  *
12385
12409
  * @param viewIdentity - The identity of the view to close.
12386
12410
  * @returns A promise that resolves when the view is closed.
@@ -17603,12 +17627,12 @@ class Transport extends events_1$1.EventEmitter {
17603
17627
  Transport_1 = transport.Transport = Transport;
17604
17628
  _Transport_wire = new WeakMap(), _Transport_fin = new WeakMap();
17605
17629
 
17606
- var mockEnvironment = {};
17630
+ var stubEnvironment = {};
17607
17631
 
17608
- Object.defineProperty(mockEnvironment, "__esModule", { value: true });
17609
- var MockEnvironment_1 = mockEnvironment.MockEnvironment = void 0;
17632
+ Object.defineProperty(stubEnvironment, "__esModule", { value: true });
17633
+ var StubEnvironment_1 = stubEnvironment.StubEnvironment = void 0;
17610
17634
  const me_1 = me;
17611
- class MockEnvironment {
17635
+ class StubEnvironment {
17612
17636
  constructor() {
17613
17637
  this.type = 'other';
17614
17638
  this.childViews = true;
@@ -17689,15 +17713,15 @@ class MockEnvironment {
17689
17713
  throw new Error('Method not implemented.');
17690
17714
  }
17691
17715
  }
17692
- MockEnvironment_1 = mockEnvironment.MockEnvironment = MockEnvironment;
17716
+ StubEnvironment_1 = stubEnvironment.StubEnvironment = StubEnvironment;
17693
17717
 
17694
- var mockWire = {};
17718
+ var stubWire = {};
17695
17719
 
17696
- Object.defineProperty(mockWire, "__esModule", { value: true });
17697
- var MockWire_1 = mockWire.MockWire = void 0;
17720
+ Object.defineProperty(stubWire, "__esModule", { value: true });
17721
+ var StubWire_1 = stubWire.StubWire = void 0;
17698
17722
  /* eslint-disable @typescript-eslint/no-unused-vars */
17699
17723
  const events_1 = require$$0;
17700
- class MockWire extends events_1.EventEmitter {
17724
+ class StubWire extends events_1.EventEmitter {
17701
17725
  connect() {
17702
17726
  throw new Error('You are not running in OpenFin.');
17703
17727
  }
@@ -17718,12 +17742,12 @@ class MockWire extends events_1.EventEmitter {
17718
17742
  super();
17719
17743
  }
17720
17744
  }
17721
- MockWire_1 = mockWire.MockWire = MockWire;
17745
+ StubWire_1 = stubWire.StubWire = StubWire;
17722
17746
 
17723
17747
  const fin$1 = ((typeof window !== 'undefined' && window?.fin) ||
17724
17748
  (() => {
17725
- const environment = new MockEnvironment_1();
17726
- const transport = new Transport_1(MockWire_1, environment, {
17749
+ const environment = new StubEnvironment_1();
17750
+ const transport = new Transport_1(StubWire_1, environment, {
17727
17751
  uuid: '',
17728
17752
  name: ''
17729
17753
  });
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "41.100.72",
3
+ "version": "41.100.78",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
- "main": "out/mock.js",
7
- "types": "out/mock.d.ts",
6
+ "main": "out/stub.js",
7
+ "types": "out/stub.d.ts",
8
8
  "private": false,
9
9
  "scripts": {
10
10
  "prebuild": "rimraf ./out",