@openfin/node-adapter 36.78.4 → 36.78.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -774,6 +774,72 @@ declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
774
774
  * ```
775
775
  */
776
776
  getFileDownloadLocation(): Promise<string>;
777
+ /**
778
+ * Shows a menu on the tray icon. Use with tray-icon-clicked event.
779
+ * @param options
780
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
781
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
782
+ * of all possible data shapes for the entire menu, and the click handler should process
783
+ * these with a "reducer" pattern.
784
+ * @throws if the application has no tray icon set
785
+ * @throws if the system tray is currently hidden
786
+ * @example
787
+ *
788
+ * ```js
789
+ * const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
790
+ * const app = fin.Application.getCurrentSync();
791
+ *
792
+ * await app.setTrayIcon(iconUrl);
793
+ *
794
+ * const template = [
795
+ * {
796
+ * label: 'Menu Item 1',
797
+ * data: 'hello from item 1'
798
+ * },
799
+ * { type: 'separator' },
800
+ * {
801
+ * label: 'Menu Item 2',
802
+ * type: 'checkbox',
803
+ * checked: true,
804
+ * data: 'The user clicked the checkbox'
805
+ * },
806
+ * {
807
+ * label: 'see more',
808
+ * enabled: false,
809
+ * submenu: [
810
+ * { label: 'submenu 1', data: 'hello from submenu' }
811
+ * ]
812
+ * }
813
+ * ];
814
+ *
815
+ * app.addListener('tray-icon-clicked', (event) => {
816
+ * // right-click
817
+ * if (event.button === 2) {
818
+ * app.showTrayIconPopupMenu({ template }).then(r => {
819
+ * if (r.result === 'closed') {
820
+ * console.log('nothing happened');
821
+ * } else {
822
+ * console.log(r.data);
823
+ * }
824
+ * });
825
+ * }
826
+ * });
827
+ * ```
828
+ */
829
+ showTrayIconPopupMenu<Data>(options: OpenFin.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin.MenuResult<Data>>;
830
+ /**
831
+ * CLoses the tray icon menu.
832
+ *
833
+ * @throws if the application has no tray icon set
834
+ * @example
835
+ *
836
+ * ```js
837
+ * const app = fin.Application.getCurrentSync();
838
+ *
839
+ * await app.closeTrayIconPopupMenu();
840
+ * ```
841
+ */
842
+ closeTrayIconPopupMenu(): Promise<void>;
777
843
  }
778
844
 
779
845
  /**
@@ -3480,9 +3546,13 @@ declare type ConstViewOptions = {
3480
3546
  /**
3481
3547
  * Controls interaction of the view with its parent window's download shelf.
3482
3548
  */
3483
- downloadShelf?: {
3549
+ downloadShelf: {
3484
3550
  /**
3485
- * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3551
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
3552
+ *
3553
+ * @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
3554
+ * on the parent window even if that parent window's {@link DownloadShelfOptions} specify
3555
+ * `enabled: false`.
3486
3556
  */
3487
3557
  enabled: boolean;
3488
3558
  };
@@ -3598,6 +3668,12 @@ declare type ConstWindowOptions = {
3598
3668
  * launches in favor of the cached value.
3599
3669
  */
3600
3670
  defaultWidth: number;
3671
+ /**
3672
+ * Controls the styling and behavior of the window download shelf.
3673
+ *
3674
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
3675
+ * triggered by the window itself, or a view targeting the window.
3676
+ */
3601
3677
  downloadShelf: DownloadShelfOptions;
3602
3678
  height: number;
3603
3679
  layout: any;
@@ -4738,14 +4814,24 @@ declare type DownloadRule = {
4738
4814
  * @interface
4739
4815
  *
4740
4816
  * Controls the styling and behavior of the window download shelf.
4817
+ *
4818
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
4819
+ * triggered by the window itself, or a view targeting the window.
4741
4820
  */
4742
4821
  declare type DownloadShelfOptions = {
4743
4822
  /**
4744
- * Whether downloads in this window trigger opening the download shelf.
4823
+ * Whether downloads in this window trigger display of the download shelf.
4824
+ *
4825
+ * @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
4826
+ * with `downloadShelf: { enabled: true }` initiates a download.
4745
4827
  */
4746
4828
  enabled: boolean;
4747
4829
  /**
4748
4830
  * Styling options for the download shelf border.
4831
+ *
4832
+ * @remarks These apply regardless of whether download shelf display was
4833
+ * triggered by this window itself, or a view targeting the window. Individual views
4834
+ * cannot control the rendering of their parent window's download shelf.
4749
4835
  */
4750
4836
  border?: {
4751
4837
  /**
@@ -9869,6 +9955,7 @@ declare namespace OpenFin {
9869
9955
  ClosedMenuResult,
9870
9956
  MenuResult,
9871
9957
  ShowPopupMenuOptions,
9958
+ ShowTrayIconPopupMenuOptions,
9872
9959
  MenuItemTemplate,
9873
9960
  NativeWindowIntegrationProviderAuthorization,
9874
9961
  RuntimeInfo,
@@ -13104,6 +13191,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
13104
13191
  type: 'show-requested';
13105
13192
  };
13106
13193
 
13194
+ /**
13195
+ * Options for showing a tray icon popup menu
13196
+ *
13197
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
13198
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
13199
+ * of all possible data shapes for the entire menu, and the click handler should process
13200
+ * these with a "reducer" pattern.
13201
+ *
13202
+ * @interface
13203
+ */
13204
+ declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
13205
+ /**
13206
+ * An array describing the menu to show.
13207
+ */
13208
+ template: MenuItemTemplate<Data>[];
13209
+ };
13210
+
13107
13211
  /**
13108
13212
  * _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
13109
13213
  *
@@ -774,6 +774,72 @@ declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
774
774
  * ```
775
775
  */
776
776
  getFileDownloadLocation(): Promise<string>;
777
+ /**
778
+ * Shows a menu on the tray icon. Use with tray-icon-clicked event.
779
+ * @param options
780
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
781
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
782
+ * of all possible data shapes for the entire menu, and the click handler should process
783
+ * these with a "reducer" pattern.
784
+ * @throws if the application has no tray icon set
785
+ * @throws if the system tray is currently hidden
786
+ * @example
787
+ *
788
+ * ```js
789
+ * const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
790
+ * const app = fin.Application.getCurrentSync();
791
+ *
792
+ * await app.setTrayIcon(iconUrl);
793
+ *
794
+ * const template = [
795
+ * {
796
+ * label: 'Menu Item 1',
797
+ * data: 'hello from item 1'
798
+ * },
799
+ * { type: 'separator' },
800
+ * {
801
+ * label: 'Menu Item 2',
802
+ * type: 'checkbox',
803
+ * checked: true,
804
+ * data: 'The user clicked the checkbox'
805
+ * },
806
+ * {
807
+ * label: 'see more',
808
+ * enabled: false,
809
+ * submenu: [
810
+ * { label: 'submenu 1', data: 'hello from submenu' }
811
+ * ]
812
+ * }
813
+ * ];
814
+ *
815
+ * app.addListener('tray-icon-clicked', (event) => {
816
+ * // right-click
817
+ * if (event.button === 2) {
818
+ * app.showTrayIconPopupMenu({ template }).then(r => {
819
+ * if (r.result === 'closed') {
820
+ * console.log('nothing happened');
821
+ * } else {
822
+ * console.log(r.data);
823
+ * }
824
+ * });
825
+ * }
826
+ * });
827
+ * ```
828
+ */
829
+ showTrayIconPopupMenu<Data>(options: OpenFin.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin.MenuResult<Data>>;
830
+ /**
831
+ * CLoses the tray icon menu.
832
+ *
833
+ * @throws if the application has no tray icon set
834
+ * @example
835
+ *
836
+ * ```js
837
+ * const app = fin.Application.getCurrentSync();
838
+ *
839
+ * await app.closeTrayIconPopupMenu();
840
+ * ```
841
+ */
842
+ closeTrayIconPopupMenu(): Promise<void>;
777
843
  }
778
844
 
779
845
  /**
@@ -3480,9 +3546,13 @@ declare type ConstViewOptions = {
3480
3546
  /**
3481
3547
  * Controls interaction of the view with its parent window's download shelf.
3482
3548
  */
3483
- downloadShelf?: {
3549
+ downloadShelf: {
3484
3550
  /**
3485
- * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3551
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
3552
+ *
3553
+ * @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
3554
+ * on the parent window even if that parent window's {@link DownloadShelfOptions} specify
3555
+ * `enabled: false`.
3486
3556
  */
3487
3557
  enabled: boolean;
3488
3558
  };
@@ -3598,6 +3668,12 @@ declare type ConstWindowOptions = {
3598
3668
  * launches in favor of the cached value.
3599
3669
  */
3600
3670
  defaultWidth: number;
3671
+ /**
3672
+ * Controls the styling and behavior of the window download shelf.
3673
+ *
3674
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
3675
+ * triggered by the window itself, or a view targeting the window.
3676
+ */
3601
3677
  downloadShelf: DownloadShelfOptions;
3602
3678
  height: number;
3603
3679
  layout: any;
@@ -4738,14 +4814,24 @@ declare type DownloadRule = {
4738
4814
  * @interface
4739
4815
  *
4740
4816
  * Controls the styling and behavior of the window download shelf.
4817
+ *
4818
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
4819
+ * triggered by the window itself, or a view targeting the window.
4741
4820
  */
4742
4821
  declare type DownloadShelfOptions = {
4743
4822
  /**
4744
- * Whether downloads in this window trigger opening the download shelf.
4823
+ * Whether downloads in this window trigger display of the download shelf.
4824
+ *
4825
+ * @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
4826
+ * with `downloadShelf: { enabled: true }` initiates a download.
4745
4827
  */
4746
4828
  enabled: boolean;
4747
4829
  /**
4748
4830
  * Styling options for the download shelf border.
4831
+ *
4832
+ * @remarks These apply regardless of whether download shelf display was
4833
+ * triggered by this window itself, or a view targeting the window. Individual views
4834
+ * cannot control the rendering of their parent window's download shelf.
4749
4835
  */
4750
4836
  border?: {
4751
4837
  /**
@@ -9869,6 +9955,7 @@ declare namespace OpenFin {
9869
9955
  ClosedMenuResult,
9870
9956
  MenuResult,
9871
9957
  ShowPopupMenuOptions,
9958
+ ShowTrayIconPopupMenuOptions,
9872
9959
  MenuItemTemplate,
9873
9960
  NativeWindowIntegrationProviderAuthorization,
9874
9961
  RuntimeInfo,
@@ -13104,6 +13191,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
13104
13191
  type: 'show-requested';
13105
13192
  };
13106
13193
 
13194
+ /**
13195
+ * Options for showing a tray icon popup menu
13196
+ *
13197
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
13198
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
13199
+ * of all possible data shapes for the entire menu, and the click handler should process
13200
+ * these with a "reducer" pattern.
13201
+ *
13202
+ * @interface
13203
+ */
13204
+ declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
13205
+ /**
13206
+ * An array describing the menu to show.
13207
+ */
13208
+ template: MenuItemTemplate<Data>[];
13209
+ };
13210
+
13107
13211
  /**
13108
13212
  * _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
13109
13213
  *
@@ -774,6 +774,72 @@ declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
774
774
  * ```
775
775
  */
776
776
  getFileDownloadLocation(): Promise<string>;
777
+ /**
778
+ * Shows a menu on the tray icon. Use with tray-icon-clicked event.
779
+ * @param options
780
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
781
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
782
+ * of all possible data shapes for the entire menu, and the click handler should process
783
+ * these with a "reducer" pattern.
784
+ * @throws if the application has no tray icon set
785
+ * @throws if the system tray is currently hidden
786
+ * @example
787
+ *
788
+ * ```js
789
+ * const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
790
+ * const app = fin.Application.getCurrentSync();
791
+ *
792
+ * await app.setTrayIcon(iconUrl);
793
+ *
794
+ * const template = [
795
+ * {
796
+ * label: 'Menu Item 1',
797
+ * data: 'hello from item 1'
798
+ * },
799
+ * { type: 'separator' },
800
+ * {
801
+ * label: 'Menu Item 2',
802
+ * type: 'checkbox',
803
+ * checked: true,
804
+ * data: 'The user clicked the checkbox'
805
+ * },
806
+ * {
807
+ * label: 'see more',
808
+ * enabled: false,
809
+ * submenu: [
810
+ * { label: 'submenu 1', data: 'hello from submenu' }
811
+ * ]
812
+ * }
813
+ * ];
814
+ *
815
+ * app.addListener('tray-icon-clicked', (event) => {
816
+ * // right-click
817
+ * if (event.button === 2) {
818
+ * app.showTrayIconPopupMenu({ template }).then(r => {
819
+ * if (r.result === 'closed') {
820
+ * console.log('nothing happened');
821
+ * } else {
822
+ * console.log(r.data);
823
+ * }
824
+ * });
825
+ * }
826
+ * });
827
+ * ```
828
+ */
829
+ showTrayIconPopupMenu<Data>(options: OpenFin.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin.MenuResult<Data>>;
830
+ /**
831
+ * CLoses the tray icon menu.
832
+ *
833
+ * @throws if the application has no tray icon set
834
+ * @example
835
+ *
836
+ * ```js
837
+ * const app = fin.Application.getCurrentSync();
838
+ *
839
+ * await app.closeTrayIconPopupMenu();
840
+ * ```
841
+ */
842
+ closeTrayIconPopupMenu(): Promise<void>;
777
843
  }
778
844
 
779
845
  /**
@@ -3480,9 +3546,13 @@ declare type ConstViewOptions = {
3480
3546
  /**
3481
3547
  * Controls interaction of the view with its parent window's download shelf.
3482
3548
  */
3483
- downloadShelf?: {
3549
+ downloadShelf: {
3484
3550
  /**
3485
- * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3551
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
3552
+ *
3553
+ * @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
3554
+ * on the parent window even if that parent window's {@link DownloadShelfOptions} specify
3555
+ * `enabled: false`.
3486
3556
  */
3487
3557
  enabled: boolean;
3488
3558
  };
@@ -3598,6 +3668,12 @@ declare type ConstWindowOptions = {
3598
3668
  * launches in favor of the cached value.
3599
3669
  */
3600
3670
  defaultWidth: number;
3671
+ /**
3672
+ * Controls the styling and behavior of the window download shelf.
3673
+ *
3674
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
3675
+ * triggered by the window itself, or a view targeting the window.
3676
+ */
3601
3677
  downloadShelf: DownloadShelfOptions;
3602
3678
  height: number;
3603
3679
  layout: any;
@@ -4738,14 +4814,24 @@ declare type DownloadRule = {
4738
4814
  * @interface
4739
4815
  *
4740
4816
  * Controls the styling and behavior of the window download shelf.
4817
+ *
4818
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
4819
+ * triggered by the window itself, or a view targeting the window.
4741
4820
  */
4742
4821
  declare type DownloadShelfOptions = {
4743
4822
  /**
4744
- * Whether downloads in this window trigger opening the download shelf.
4823
+ * Whether downloads in this window trigger display of the download shelf.
4824
+ *
4825
+ * @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
4826
+ * with `downloadShelf: { enabled: true }` initiates a download.
4745
4827
  */
4746
4828
  enabled: boolean;
4747
4829
  /**
4748
4830
  * Styling options for the download shelf border.
4831
+ *
4832
+ * @remarks These apply regardless of whether download shelf display was
4833
+ * triggered by this window itself, or a view targeting the window. Individual views
4834
+ * cannot control the rendering of their parent window's download shelf.
4749
4835
  */
4750
4836
  border?: {
4751
4837
  /**
@@ -9869,6 +9955,7 @@ declare namespace OpenFin {
9869
9955
  ClosedMenuResult,
9870
9956
  MenuResult,
9871
9957
  ShowPopupMenuOptions,
9958
+ ShowTrayIconPopupMenuOptions,
9872
9959
  MenuItemTemplate,
9873
9960
  NativeWindowIntegrationProviderAuthorization,
9874
9961
  RuntimeInfo,
@@ -13104,6 +13191,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
13104
13191
  type: 'show-requested';
13105
13192
  };
13106
13193
 
13194
+ /**
13195
+ * Options for showing a tray icon popup menu
13196
+ *
13197
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
13198
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
13199
+ * of all possible data shapes for the entire menu, and the click handler should process
13200
+ * these with a "reducer" pattern.
13201
+ *
13202
+ * @interface
13203
+ */
13204
+ declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
13205
+ /**
13206
+ * An array describing the menu to show.
13207
+ */
13208
+ template: MenuItemTemplate<Data>[];
13209
+ };
13210
+
13107
13211
  /**
13108
13212
  * _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
13109
13213
  *
@@ -780,6 +780,72 @@ declare class Application extends EmitterBase<OpenFin.ApplicationEvent> {
780
780
  * ```
781
781
  */
782
782
  getFileDownloadLocation(): Promise<string>;
783
+ /**
784
+ * Shows a menu on the tray icon. Use with tray-icon-clicked event.
785
+ * @param options
786
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
787
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
788
+ * of all possible data shapes for the entire menu, and the click handler should process
789
+ * these with a "reducer" pattern.
790
+ * @throws if the application has no tray icon set
791
+ * @throws if the system tray is currently hidden
792
+ * @example
793
+ *
794
+ * ```js
795
+ * const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
796
+ * const app = fin.Application.getCurrentSync();
797
+ *
798
+ * await app.setTrayIcon(iconUrl);
799
+ *
800
+ * const template = [
801
+ * {
802
+ * label: 'Menu Item 1',
803
+ * data: 'hello from item 1'
804
+ * },
805
+ * { type: 'separator' },
806
+ * {
807
+ * label: 'Menu Item 2',
808
+ * type: 'checkbox',
809
+ * checked: true,
810
+ * data: 'The user clicked the checkbox'
811
+ * },
812
+ * {
813
+ * label: 'see more',
814
+ * enabled: false,
815
+ * submenu: [
816
+ * { label: 'submenu 1', data: 'hello from submenu' }
817
+ * ]
818
+ * }
819
+ * ];
820
+ *
821
+ * app.addListener('tray-icon-clicked', (event) => {
822
+ * // right-click
823
+ * if (event.button === 2) {
824
+ * app.showTrayIconPopupMenu({ template }).then(r => {
825
+ * if (r.result === 'closed') {
826
+ * console.log('nothing happened');
827
+ * } else {
828
+ * console.log(r.data);
829
+ * }
830
+ * });
831
+ * }
832
+ * });
833
+ * ```
834
+ */
835
+ showTrayIconPopupMenu<Data>(options: OpenFin.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin.MenuResult<Data>>;
836
+ /**
837
+ * CLoses the tray icon menu.
838
+ *
839
+ * @throws if the application has no tray icon set
840
+ * @example
841
+ *
842
+ * ```js
843
+ * const app = fin.Application.getCurrentSync();
844
+ *
845
+ * await app.closeTrayIconPopupMenu();
846
+ * ```
847
+ */
848
+ closeTrayIconPopupMenu(): Promise<void>;
783
849
  }
784
850
 
785
851
  /**
@@ -3523,9 +3589,13 @@ declare type ConstViewOptions = {
3523
3589
  /**
3524
3590
  * Controls interaction of the view with its parent window's download shelf.
3525
3591
  */
3526
- downloadShelf?: {
3592
+ downloadShelf: {
3527
3593
  /**
3528
- * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3594
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
3595
+ *
3596
+ * @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
3597
+ * on the parent window even if that parent window's {@link DownloadShelfOptions} specify
3598
+ * `enabled: false`.
3529
3599
  */
3530
3600
  enabled: boolean;
3531
3601
  };
@@ -3641,6 +3711,12 @@ declare type ConstWindowOptions = {
3641
3711
  * launches in favor of the cached value.
3642
3712
  */
3643
3713
  defaultWidth: number;
3714
+ /**
3715
+ * Controls the styling and behavior of the window download shelf.
3716
+ *
3717
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
3718
+ * triggered by the window itself, or a view targeting the window.
3719
+ */
3644
3720
  downloadShelf: DownloadShelfOptions;
3645
3721
  height: number;
3646
3722
  layout: any;
@@ -4781,14 +4857,24 @@ declare type DownloadRule = {
4781
4857
  * @interface
4782
4858
  *
4783
4859
  * Controls the styling and behavior of the window download shelf.
4860
+ *
4861
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
4862
+ * triggered by the window itself, or a view targeting the window.
4784
4863
  */
4785
4864
  declare type DownloadShelfOptions = {
4786
4865
  /**
4787
- * Whether downloads in this window trigger opening the download shelf.
4866
+ * Whether downloads in this window trigger display of the download shelf.
4867
+ *
4868
+ * @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
4869
+ * with `downloadShelf: { enabled: true }` initiates a download.
4788
4870
  */
4789
4871
  enabled: boolean;
4790
4872
  /**
4791
4873
  * Styling options for the download shelf border.
4874
+ *
4875
+ * @remarks These apply regardless of whether download shelf display was
4876
+ * triggered by this window itself, or a view targeting the window. Individual views
4877
+ * cannot control the rendering of their parent window's download shelf.
4792
4878
  */
4793
4879
  border?: {
4794
4880
  /**
@@ -10186,6 +10272,7 @@ declare namespace OpenFin {
10186
10272
  ClosedMenuResult,
10187
10273
  MenuResult,
10188
10274
  ShowPopupMenuOptions,
10275
+ ShowTrayIconPopupMenuOptions,
10189
10276
  MenuItemTemplate,
10190
10277
  NativeWindowIntegrationProviderAuthorization,
10191
10278
  RuntimeInfo,
@@ -13499,6 +13586,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
13499
13586
  type: 'show-requested';
13500
13587
  };
13501
13588
 
13589
+ /**
13590
+ * Options for showing a tray icon popup menu
13591
+ *
13592
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
13593
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
13594
+ * of all possible data shapes for the entire menu, and the click handler should process
13595
+ * these with a "reducer" pattern.
13596
+ *
13597
+ * @interface
13598
+ */
13599
+ declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
13600
+ /**
13601
+ * An array describing the menu to show.
13602
+ */
13603
+ template: MenuItemTemplate<Data>[];
13604
+ };
13605
+
13502
13606
  /**
13503
13607
  * _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
13504
13608
  *
@@ -3720,6 +3720,81 @@ function requireInstance$1 () {
3720
3720
  const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
3721
3721
  return data;
3722
3722
  }
3723
+ /**
3724
+ * Shows a menu on the tray icon. Use with tray-icon-clicked event.
3725
+ * @param options
3726
+ * @typeParam Data User-defined shape for data returned upon menu item click. Should be a
3727
+ * [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
3728
+ * of all possible data shapes for the entire menu, and the click handler should process
3729
+ * these with a "reducer" pattern.
3730
+ * @throws if the application has no tray icon set
3731
+ * @throws if the system tray is currently hidden
3732
+ * @example
3733
+ *
3734
+ * ```js
3735
+ * const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
3736
+ * const app = fin.Application.getCurrentSync();
3737
+ *
3738
+ * await app.setTrayIcon(iconUrl);
3739
+ *
3740
+ * const template = [
3741
+ * {
3742
+ * label: 'Menu Item 1',
3743
+ * data: 'hello from item 1'
3744
+ * },
3745
+ * { type: 'separator' },
3746
+ * {
3747
+ * label: 'Menu Item 2',
3748
+ * type: 'checkbox',
3749
+ * checked: true,
3750
+ * data: 'The user clicked the checkbox'
3751
+ * },
3752
+ * {
3753
+ * label: 'see more',
3754
+ * enabled: false,
3755
+ * submenu: [
3756
+ * { label: 'submenu 1', data: 'hello from submenu' }
3757
+ * ]
3758
+ * }
3759
+ * ];
3760
+ *
3761
+ * app.addListener('tray-icon-clicked', (event) => {
3762
+ * // right-click
3763
+ * if (event.button === 2) {
3764
+ * app.showTrayIconPopupMenu({ template }).then(r => {
3765
+ * if (r.result === 'closed') {
3766
+ * console.log('nothing happened');
3767
+ * } else {
3768
+ * console.log(r.data);
3769
+ * }
3770
+ * });
3771
+ * }
3772
+ * });
3773
+ * ```
3774
+ */
3775
+ async showTrayIconPopupMenu(options) {
3776
+ const { name } = this.wire.me;
3777
+ const entityIdentity = { uuid: this.identity.uuid, name };
3778
+ const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
3779
+ return payload.data;
3780
+ }
3781
+ /**
3782
+ * CLoses the tray icon menu.
3783
+ *
3784
+ * @throws if the application has no tray icon set
3785
+ * @example
3786
+ *
3787
+ * ```js
3788
+ * const app = fin.Application.getCurrentSync();
3789
+ *
3790
+ * await app.closeTrayIconPopupMenu();
3791
+ * ```
3792
+ */
3793
+ async closeTrayIconPopupMenu() {
3794
+ const { name } = this.wire.me;
3795
+ const entityIdentity = { uuid: this.identity.uuid, name };
3796
+ await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
3797
+ }
3723
3798
  }
3724
3799
  Instance$6.Application = Application;
3725
3800
  return Instance$6;
@@ -11660,7 +11735,7 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
11660
11735
  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");
11661
11736
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11662
11737
  };
11663
- var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getBackCompatLayoutManager, _LayoutModule_getSafeLayoutManager;
11738
+ var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getSafeLayoutManager;
11664
11739
  Object.defineProperty(Factory$2, "__esModule", { value: true });
11665
11740
  Factory$2.LayoutModule = void 0;
11666
11741
  const base_1$5 = base$1;
@@ -11713,7 +11788,7 @@ class LayoutModule extends base_1$5.Base {
11713
11788
  * ```
11714
11789
  */
11715
11790
  this.init = async (options = {}) => {
11716
- this.wire.sendAction('layout-init').catch((e) => {
11791
+ this.wire.sendAction('layout-init').catch(() => {
11717
11792
  // don't expose
11718
11793
  });
11719
11794
  if (!this.fin.me.isWindow) {
@@ -11728,9 +11803,6 @@ class LayoutModule extends base_1$5.Base {
11728
11803
  const platformClient = await this.fin.Platform.getCurrentSync().getClient();
11729
11804
  const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
11730
11805
  await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
11731
- if (!options.layoutManagerOverride) {
11732
- return __classPrivateFieldGet$4(this, _LayoutModule_getBackCompatLayoutManager, "f").call(this, this.fin);
11733
- }
11734
11806
  // warn user if they do not call create() in the next 30 seconds
11735
11807
  setTimeout(() => {
11736
11808
  if (__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")?.size() === 0) {
@@ -11740,22 +11812,6 @@ class LayoutModule extends base_1$5.Base {
11740
11812
  }, 30000);
11741
11813
  return this.wrapSync(this.fin.me.identity);
11742
11814
  };
11743
- _LayoutModule_getBackCompatLayoutManager.set(this, async (fin) => {
11744
- let layoutManager;
11745
- let resolve;
11746
- const layoutResolved = new Promise((r) => {
11747
- resolve = r;
11748
- });
11749
- // wait for a layout to be created
11750
- await fin.me.once('layout-ready', async ({ layoutIdentity }) => {
11751
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11752
- layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11753
- // Backward compat - undocumented / not typed openfin-layout as layoutManager
11754
- // TODO: eventually deprecate this
11755
- resolve(Object.assign(this.wrapSync(layoutIdentity), { layoutManager }));
11756
- });
11757
- return layoutResolved;
11758
- });
11759
11815
  /**
11760
11816
  * Returns the layout manager for the current window
11761
11817
  * @returns
@@ -11790,7 +11846,7 @@ class LayoutModule extends base_1$5.Base {
11790
11846
  * ```
11791
11847
  */
11792
11848
  async wrap(identity) {
11793
- this.wire.sendAction('layout-wrap').catch((e) => {
11849
+ this.wire.sendAction('layout-wrap').catch(() => {
11794
11850
  // don't expose
11795
11851
  });
11796
11852
  return new Instance_1$2.Layout(identity, this.wire);
@@ -11815,7 +11871,7 @@ class LayoutModule extends base_1$5.Base {
11815
11871
  * ```
11816
11872
  */
11817
11873
  wrapSync(identity) {
11818
- this.wire.sendAction('layout-wrap-sync').catch((e) => {
11874
+ this.wire.sendAction('layout-wrap-sync').catch(() => {
11819
11875
  // don't expose
11820
11876
  });
11821
11877
  return new Instance_1$2.Layout(identity, this.wire);
@@ -11831,7 +11887,7 @@ class LayoutModule extends base_1$5.Base {
11831
11887
  * ```
11832
11888
  */
11833
11889
  async getCurrent() {
11834
- this.wire.sendAction('layout-get-current').catch((e) => {
11890
+ this.wire.sendAction('layout-get-current').catch(() => {
11835
11891
  // don't expose
11836
11892
  });
11837
11893
  if (!this.fin.me.isWindow) {
@@ -11854,7 +11910,7 @@ class LayoutModule extends base_1$5.Base {
11854
11910
  * ```
11855
11911
  */
11856
11912
  getCurrentSync() {
11857
- this.wire.sendAction('layout-get-current-sync').catch((e) => {
11913
+ this.wire.sendAction('layout-get-current-sync').catch(() => {
11858
11914
  // don't expose
11859
11915
  });
11860
11916
  if (!this.fin.me.isWindow) {
@@ -11865,7 +11921,7 @@ class LayoutModule extends base_1$5.Base {
11865
11921
  }
11866
11922
  }
11867
11923
  Factory$2.LayoutModule = LayoutModule;
11868
- _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
11924
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
11869
11925
  if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
11870
11926
  throw new Error(`You must call init before using the API ${method}`);
11871
11927
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "36.78.4",
3
+ "version": "36.78.6",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",