@openfin/node-adapter 36.78.5 → 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.
- package/out/node-adapter-alpha.d.ts +107 -3
- package/out/node-adapter-beta.d.ts +107 -3
- package/out/node-adapter-public.d.ts +107 -3
- package/out/node-adapter.d.ts +107 -3
- package/out/node-adapter.js +75 -0
- package/package.json +1 -1
@@ -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
|
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
|
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
|
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
|
*
|
package/out/node-adapter.d.ts
CHANGED
@@ -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
|
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
|
*
|
package/out/node-adapter.js
CHANGED
@@ -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;
|