@openfin/core 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.
- package/out/mock-alpha.d.ts +107 -3
- package/out/mock-beta.d.ts +107 -3
- package/out/mock-public.d.ts +107 -3
- package/out/mock.d.ts +107 -3
- package/out/mock.js +82 -26
- package/package.json +1 -1
package/out/mock-alpha.d.ts
CHANGED
@@ -774,6 +774,72 @@ declare class Application extends EmitterBase<OpenFin_2.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_2.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin_2.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
|
/**
|
@@ -3476,9 +3542,13 @@ declare type ConstViewOptions = {
|
|
3476
3542
|
/**
|
3477
3543
|
* Controls interaction of the view with its parent window's download shelf.
|
3478
3544
|
*/
|
3479
|
-
downloadShelf
|
3545
|
+
downloadShelf: {
|
3480
3546
|
/**
|
3481
|
-
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
|
3547
|
+
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
|
3548
|
+
*
|
3549
|
+
* @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
|
3550
|
+
* on the parent window even if that parent window's {@link DownloadShelfOptions} specify
|
3551
|
+
* `enabled: false`.
|
3482
3552
|
*/
|
3483
3553
|
enabled: boolean;
|
3484
3554
|
};
|
@@ -3594,6 +3664,12 @@ declare type ConstWindowOptions = {
|
|
3594
3664
|
* launches in favor of the cached value.
|
3595
3665
|
*/
|
3596
3666
|
defaultWidth: number;
|
3667
|
+
/**
|
3668
|
+
* Controls the styling and behavior of the window download shelf.
|
3669
|
+
*
|
3670
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
3671
|
+
* triggered by the window itself, or a view targeting the window.
|
3672
|
+
*/
|
3597
3673
|
downloadShelf: DownloadShelfOptions;
|
3598
3674
|
height: number;
|
3599
3675
|
layout: any;
|
@@ -4734,14 +4810,24 @@ declare type DownloadRule = {
|
|
4734
4810
|
* @interface
|
4735
4811
|
*
|
4736
4812
|
* Controls the styling and behavior of the window download shelf.
|
4813
|
+
*
|
4814
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
4815
|
+
* triggered by the window itself, or a view targeting the window.
|
4737
4816
|
*/
|
4738
4817
|
declare type DownloadShelfOptions = {
|
4739
4818
|
/**
|
4740
|
-
* Whether downloads in this window trigger
|
4819
|
+
* Whether downloads in this window trigger display of the download shelf.
|
4820
|
+
*
|
4821
|
+
* @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
|
4822
|
+
* with `downloadShelf: { enabled: true }` initiates a download.
|
4741
4823
|
*/
|
4742
4824
|
enabled: boolean;
|
4743
4825
|
/**
|
4744
4826
|
* Styling options for the download shelf border.
|
4827
|
+
*
|
4828
|
+
* @remarks These apply regardless of whether download shelf display was
|
4829
|
+
* triggered by this window itself, or a view targeting the window. Individual views
|
4830
|
+
* cannot control the rendering of their parent window's download shelf.
|
4745
4831
|
*/
|
4746
4832
|
border?: {
|
4747
4833
|
/**
|
@@ -9859,6 +9945,7 @@ declare namespace OpenFin_2 {
|
|
9859
9945
|
ClosedMenuResult,
|
9860
9946
|
MenuResult,
|
9861
9947
|
ShowPopupMenuOptions,
|
9948
|
+
ShowTrayIconPopupMenuOptions,
|
9862
9949
|
MenuItemTemplate,
|
9863
9950
|
NativeWindowIntegrationProviderAuthorization,
|
9864
9951
|
RuntimeInfo,
|
@@ -13094,6 +13181,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
|
|
13094
13181
|
type: 'show-requested';
|
13095
13182
|
};
|
13096
13183
|
|
13184
|
+
/**
|
13185
|
+
* Options for showing a tray icon popup menu
|
13186
|
+
*
|
13187
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
13188
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
13189
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
13190
|
+
* these with a "reducer" pattern.
|
13191
|
+
*
|
13192
|
+
* @interface
|
13193
|
+
*/
|
13194
|
+
declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
|
13195
|
+
/**
|
13196
|
+
* An array describing the menu to show.
|
13197
|
+
*/
|
13198
|
+
template: MenuItemTemplate<Data>[];
|
13199
|
+
};
|
13200
|
+
|
13097
13201
|
/**
|
13098
13202
|
* _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
13099
13203
|
*
|
package/out/mock-beta.d.ts
CHANGED
@@ -774,6 +774,72 @@ declare class Application extends EmitterBase<OpenFin_2.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_2.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin_2.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
|
/**
|
@@ -3476,9 +3542,13 @@ declare type ConstViewOptions = {
|
|
3476
3542
|
/**
|
3477
3543
|
* Controls interaction of the view with its parent window's download shelf.
|
3478
3544
|
*/
|
3479
|
-
downloadShelf
|
3545
|
+
downloadShelf: {
|
3480
3546
|
/**
|
3481
|
-
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
|
3547
|
+
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
|
3548
|
+
*
|
3549
|
+
* @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
|
3550
|
+
* on the parent window even if that parent window's {@link DownloadShelfOptions} specify
|
3551
|
+
* `enabled: false`.
|
3482
3552
|
*/
|
3483
3553
|
enabled: boolean;
|
3484
3554
|
};
|
@@ -3594,6 +3664,12 @@ declare type ConstWindowOptions = {
|
|
3594
3664
|
* launches in favor of the cached value.
|
3595
3665
|
*/
|
3596
3666
|
defaultWidth: number;
|
3667
|
+
/**
|
3668
|
+
* Controls the styling and behavior of the window download shelf.
|
3669
|
+
*
|
3670
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
3671
|
+
* triggered by the window itself, or a view targeting the window.
|
3672
|
+
*/
|
3597
3673
|
downloadShelf: DownloadShelfOptions;
|
3598
3674
|
height: number;
|
3599
3675
|
layout: any;
|
@@ -4734,14 +4810,24 @@ declare type DownloadRule = {
|
|
4734
4810
|
* @interface
|
4735
4811
|
*
|
4736
4812
|
* Controls the styling and behavior of the window download shelf.
|
4813
|
+
*
|
4814
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
4815
|
+
* triggered by the window itself, or a view targeting the window.
|
4737
4816
|
*/
|
4738
4817
|
declare type DownloadShelfOptions = {
|
4739
4818
|
/**
|
4740
|
-
* Whether downloads in this window trigger
|
4819
|
+
* Whether downloads in this window trigger display of the download shelf.
|
4820
|
+
*
|
4821
|
+
* @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
|
4822
|
+
* with `downloadShelf: { enabled: true }` initiates a download.
|
4741
4823
|
*/
|
4742
4824
|
enabled: boolean;
|
4743
4825
|
/**
|
4744
4826
|
* Styling options for the download shelf border.
|
4827
|
+
*
|
4828
|
+
* @remarks These apply regardless of whether download shelf display was
|
4829
|
+
* triggered by this window itself, or a view targeting the window. Individual views
|
4830
|
+
* cannot control the rendering of their parent window's download shelf.
|
4745
4831
|
*/
|
4746
4832
|
border?: {
|
4747
4833
|
/**
|
@@ -9859,6 +9945,7 @@ declare namespace OpenFin_2 {
|
|
9859
9945
|
ClosedMenuResult,
|
9860
9946
|
MenuResult,
|
9861
9947
|
ShowPopupMenuOptions,
|
9948
|
+
ShowTrayIconPopupMenuOptions,
|
9862
9949
|
MenuItemTemplate,
|
9863
9950
|
NativeWindowIntegrationProviderAuthorization,
|
9864
9951
|
RuntimeInfo,
|
@@ -13094,6 +13181,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
|
|
13094
13181
|
type: 'show-requested';
|
13095
13182
|
};
|
13096
13183
|
|
13184
|
+
/**
|
13185
|
+
* Options for showing a tray icon popup menu
|
13186
|
+
*
|
13187
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
13188
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
13189
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
13190
|
+
* these with a "reducer" pattern.
|
13191
|
+
*
|
13192
|
+
* @interface
|
13193
|
+
*/
|
13194
|
+
declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
|
13195
|
+
/**
|
13196
|
+
* An array describing the menu to show.
|
13197
|
+
*/
|
13198
|
+
template: MenuItemTemplate<Data>[];
|
13199
|
+
};
|
13200
|
+
|
13097
13201
|
/**
|
13098
13202
|
* _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
13099
13203
|
*
|
package/out/mock-public.d.ts
CHANGED
@@ -774,6 +774,72 @@ declare class Application extends EmitterBase<OpenFin_2.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_2.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin_2.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
|
/**
|
@@ -3476,9 +3542,13 @@ declare type ConstViewOptions = {
|
|
3476
3542
|
/**
|
3477
3543
|
* Controls interaction of the view with its parent window's download shelf.
|
3478
3544
|
*/
|
3479
|
-
downloadShelf
|
3545
|
+
downloadShelf: {
|
3480
3546
|
/**
|
3481
|
-
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
|
3547
|
+
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
|
3548
|
+
*
|
3549
|
+
* @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
|
3550
|
+
* on the parent window even if that parent window's {@link DownloadShelfOptions} specify
|
3551
|
+
* `enabled: false`.
|
3482
3552
|
*/
|
3483
3553
|
enabled: boolean;
|
3484
3554
|
};
|
@@ -3594,6 +3664,12 @@ declare type ConstWindowOptions = {
|
|
3594
3664
|
* launches in favor of the cached value.
|
3595
3665
|
*/
|
3596
3666
|
defaultWidth: number;
|
3667
|
+
/**
|
3668
|
+
* Controls the styling and behavior of the window download shelf.
|
3669
|
+
*
|
3670
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
3671
|
+
* triggered by the window itself, or a view targeting the window.
|
3672
|
+
*/
|
3597
3673
|
downloadShelf: DownloadShelfOptions;
|
3598
3674
|
height: number;
|
3599
3675
|
layout: any;
|
@@ -4734,14 +4810,24 @@ declare type DownloadRule = {
|
|
4734
4810
|
* @interface
|
4735
4811
|
*
|
4736
4812
|
* Controls the styling and behavior of the window download shelf.
|
4813
|
+
*
|
4814
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
4815
|
+
* triggered by the window itself, or a view targeting the window.
|
4737
4816
|
*/
|
4738
4817
|
declare type DownloadShelfOptions = {
|
4739
4818
|
/**
|
4740
|
-
* Whether downloads in this window trigger
|
4819
|
+
* Whether downloads in this window trigger display of the download shelf.
|
4820
|
+
*
|
4821
|
+
* @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
|
4822
|
+
* with `downloadShelf: { enabled: true }` initiates a download.
|
4741
4823
|
*/
|
4742
4824
|
enabled: boolean;
|
4743
4825
|
/**
|
4744
4826
|
* Styling options for the download shelf border.
|
4827
|
+
*
|
4828
|
+
* @remarks These apply regardless of whether download shelf display was
|
4829
|
+
* triggered by this window itself, or a view targeting the window. Individual views
|
4830
|
+
* cannot control the rendering of their parent window's download shelf.
|
4745
4831
|
*/
|
4746
4832
|
border?: {
|
4747
4833
|
/**
|
@@ -9859,6 +9945,7 @@ declare namespace OpenFin_2 {
|
|
9859
9945
|
ClosedMenuResult,
|
9860
9946
|
MenuResult,
|
9861
9947
|
ShowPopupMenuOptions,
|
9948
|
+
ShowTrayIconPopupMenuOptions,
|
9862
9949
|
MenuItemTemplate,
|
9863
9950
|
NativeWindowIntegrationProviderAuthorization,
|
9864
9951
|
RuntimeInfo,
|
@@ -13094,6 +13181,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
|
|
13094
13181
|
type: 'show-requested';
|
13095
13182
|
};
|
13096
13183
|
|
13184
|
+
/**
|
13185
|
+
* Options for showing a tray icon popup menu
|
13186
|
+
*
|
13187
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
13188
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
13189
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
13190
|
+
* these with a "reducer" pattern.
|
13191
|
+
*
|
13192
|
+
* @interface
|
13193
|
+
*/
|
13194
|
+
declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
|
13195
|
+
/**
|
13196
|
+
* An array describing the menu to show.
|
13197
|
+
*/
|
13198
|
+
template: MenuItemTemplate<Data>[];
|
13199
|
+
};
|
13200
|
+
|
13097
13201
|
/**
|
13098
13202
|
* _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
13099
13203
|
*
|
package/out/mock.d.ts
CHANGED
@@ -780,6 +780,72 @@ declare class Application extends EmitterBase<OpenFin_2.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_2.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin_2.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
|
/**
|
@@ -3519,9 +3585,13 @@ declare type ConstViewOptions = {
|
|
3519
3585
|
/**
|
3520
3586
|
* Controls interaction of the view with its parent window's download shelf.
|
3521
3587
|
*/
|
3522
|
-
downloadShelf
|
3588
|
+
downloadShelf: {
|
3523
3589
|
/**
|
3524
|
-
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
|
3590
|
+
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
|
3591
|
+
*
|
3592
|
+
* @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
|
3593
|
+
* on the parent window even if that parent window's {@link DownloadShelfOptions} specify
|
3594
|
+
* `enabled: false`.
|
3525
3595
|
*/
|
3526
3596
|
enabled: boolean;
|
3527
3597
|
};
|
@@ -3637,6 +3707,12 @@ declare type ConstWindowOptions = {
|
|
3637
3707
|
* launches in favor of the cached value.
|
3638
3708
|
*/
|
3639
3709
|
defaultWidth: number;
|
3710
|
+
/**
|
3711
|
+
* Controls the styling and behavior of the window download shelf.
|
3712
|
+
*
|
3713
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
3714
|
+
* triggered by the window itself, or a view targeting the window.
|
3715
|
+
*/
|
3640
3716
|
downloadShelf: DownloadShelfOptions;
|
3641
3717
|
height: number;
|
3642
3718
|
layout: any;
|
@@ -4777,14 +4853,24 @@ declare type DownloadRule = {
|
|
4777
4853
|
* @interface
|
4778
4854
|
*
|
4779
4855
|
* Controls the styling and behavior of the window download shelf.
|
4856
|
+
*
|
4857
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
4858
|
+
* triggered by the window itself, or a view targeting the window.
|
4780
4859
|
*/
|
4781
4860
|
declare type DownloadShelfOptions = {
|
4782
4861
|
/**
|
4783
|
-
* Whether downloads in this window trigger
|
4862
|
+
* Whether downloads in this window trigger display of the download shelf.
|
4863
|
+
*
|
4864
|
+
* @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
|
4865
|
+
* with `downloadShelf: { enabled: true }` initiates a download.
|
4784
4866
|
*/
|
4785
4867
|
enabled: boolean;
|
4786
4868
|
/**
|
4787
4869
|
* Styling options for the download shelf border.
|
4870
|
+
*
|
4871
|
+
* @remarks These apply regardless of whether download shelf display was
|
4872
|
+
* triggered by this window itself, or a view targeting the window. Individual views
|
4873
|
+
* cannot control the rendering of their parent window's download shelf.
|
4788
4874
|
*/
|
4789
4875
|
border?: {
|
4790
4876
|
/**
|
@@ -10154,6 +10240,7 @@ declare namespace OpenFin_2 {
|
|
10154
10240
|
ClosedMenuResult,
|
10155
10241
|
MenuResult,
|
10156
10242
|
ShowPopupMenuOptions,
|
10243
|
+
ShowTrayIconPopupMenuOptions,
|
10157
10244
|
MenuItemTemplate,
|
10158
10245
|
NativeWindowIntegrationProviderAuthorization,
|
10159
10246
|
RuntimeInfo,
|
@@ -13467,6 +13554,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
|
|
13467
13554
|
type: 'show-requested';
|
13468
13555
|
};
|
13469
13556
|
|
13557
|
+
/**
|
13558
|
+
* Options for showing a tray icon popup menu
|
13559
|
+
*
|
13560
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
13561
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
13562
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
13563
|
+
* these with a "reducer" pattern.
|
13564
|
+
*
|
13565
|
+
* @interface
|
13566
|
+
*/
|
13567
|
+
declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
|
13568
|
+
/**
|
13569
|
+
* An array describing the menu to show.
|
13570
|
+
*/
|
13571
|
+
template: MenuItemTemplate<Data>[];
|
13572
|
+
};
|
13573
|
+
|
13470
13574
|
/**
|
13471
13575
|
* _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
13472
13576
|
*
|
package/out/mock.js
CHANGED
@@ -3940,6 +3940,81 @@ function requireInstance$1 () {
|
|
3940
3940
|
const { payload: { data } } = await this.wire.sendAction('get-file-download-location', this.identity);
|
3941
3941
|
return data;
|
3942
3942
|
}
|
3943
|
+
/**
|
3944
|
+
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
3945
|
+
* @param options
|
3946
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
3947
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
3948
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
3949
|
+
* these with a "reducer" pattern.
|
3950
|
+
* @throws if the application has no tray icon set
|
3951
|
+
* @throws if the system tray is currently hidden
|
3952
|
+
* @example
|
3953
|
+
*
|
3954
|
+
* ```js
|
3955
|
+
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
3956
|
+
* const app = fin.Application.getCurrentSync();
|
3957
|
+
*
|
3958
|
+
* await app.setTrayIcon(iconUrl);
|
3959
|
+
*
|
3960
|
+
* const template = [
|
3961
|
+
* {
|
3962
|
+
* label: 'Menu Item 1',
|
3963
|
+
* data: 'hello from item 1'
|
3964
|
+
* },
|
3965
|
+
* { type: 'separator' },
|
3966
|
+
* {
|
3967
|
+
* label: 'Menu Item 2',
|
3968
|
+
* type: 'checkbox',
|
3969
|
+
* checked: true,
|
3970
|
+
* data: 'The user clicked the checkbox'
|
3971
|
+
* },
|
3972
|
+
* {
|
3973
|
+
* label: 'see more',
|
3974
|
+
* enabled: false,
|
3975
|
+
* submenu: [
|
3976
|
+
* { label: 'submenu 1', data: 'hello from submenu' }
|
3977
|
+
* ]
|
3978
|
+
* }
|
3979
|
+
* ];
|
3980
|
+
*
|
3981
|
+
* app.addListener('tray-icon-clicked', (event) => {
|
3982
|
+
* // right-click
|
3983
|
+
* if (event.button === 2) {
|
3984
|
+
* app.showTrayIconPopupMenu({ template }).then(r => {
|
3985
|
+
* if (r.result === 'closed') {
|
3986
|
+
* console.log('nothing happened');
|
3987
|
+
* } else {
|
3988
|
+
* console.log(r.data);
|
3989
|
+
* }
|
3990
|
+
* });
|
3991
|
+
* }
|
3992
|
+
* });
|
3993
|
+
* ```
|
3994
|
+
*/
|
3995
|
+
async showTrayIconPopupMenu(options) {
|
3996
|
+
const { name } = this.wire.me;
|
3997
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
3998
|
+
const { payload } = await this.wire.sendAction('show-tray-icon-popup-menu', { ...entityIdentity, options });
|
3999
|
+
return payload.data;
|
4000
|
+
}
|
4001
|
+
/**
|
4002
|
+
* CLoses the tray icon menu.
|
4003
|
+
*
|
4004
|
+
* @throws if the application has no tray icon set
|
4005
|
+
* @example
|
4006
|
+
*
|
4007
|
+
* ```js
|
4008
|
+
* const app = fin.Application.getCurrentSync();
|
4009
|
+
*
|
4010
|
+
* await app.closeTrayIconPopupMenu();
|
4011
|
+
* ```
|
4012
|
+
*/
|
4013
|
+
async closeTrayIconPopupMenu() {
|
4014
|
+
const { name } = this.wire.me;
|
4015
|
+
const entityIdentity = { uuid: this.identity.uuid, name };
|
4016
|
+
await this.wire.sendAction('close-tray-icon-popup-menu', { ...entityIdentity });
|
4017
|
+
}
|
3943
4018
|
}
|
3944
4019
|
Instance$6.Application = Application;
|
3945
4020
|
return Instance$6;
|
@@ -11880,7 +11955,7 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
|
|
11880
11955
|
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");
|
11881
11956
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
11882
11957
|
};
|
11883
|
-
var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager,
|
11958
|
+
var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getSafeLayoutManager;
|
11884
11959
|
Object.defineProperty(Factory$2, "__esModule", { value: true });
|
11885
11960
|
Factory$2.LayoutModule = void 0;
|
11886
11961
|
const base_1$5 = base;
|
@@ -11933,7 +12008,7 @@ class LayoutModule extends base_1$5.Base {
|
|
11933
12008
|
* ```
|
11934
12009
|
*/
|
11935
12010
|
this.init = async (options = {}) => {
|
11936
|
-
this.wire.sendAction('layout-init').catch((
|
12011
|
+
this.wire.sendAction('layout-init').catch(() => {
|
11937
12012
|
// don't expose
|
11938
12013
|
});
|
11939
12014
|
if (!this.fin.me.isWindow) {
|
@@ -11948,9 +12023,6 @@ class LayoutModule extends base_1$5.Base {
|
|
11948
12023
|
const platformClient = await this.fin.Platform.getCurrentSync().getClient();
|
11949
12024
|
const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
|
11950
12025
|
await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
|
11951
|
-
if (!options.layoutManagerOverride) {
|
11952
|
-
return __classPrivateFieldGet$4(this, _LayoutModule_getBackCompatLayoutManager, "f").call(this, this.fin);
|
11953
|
-
}
|
11954
12026
|
// warn user if they do not call create() in the next 30 seconds
|
11955
12027
|
setTimeout(() => {
|
11956
12028
|
if (__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")?.size() === 0) {
|
@@ -11960,22 +12032,6 @@ class LayoutModule extends base_1$5.Base {
|
|
11960
12032
|
}, 30000);
|
11961
12033
|
return this.wrapSync(this.fin.me.identity);
|
11962
12034
|
};
|
11963
|
-
_LayoutModule_getBackCompatLayoutManager.set(this, async (fin) => {
|
11964
|
-
let layoutManager;
|
11965
|
-
let resolve;
|
11966
|
-
const layoutResolved = new Promise((r) => {
|
11967
|
-
resolve = r;
|
11968
|
-
});
|
11969
|
-
// wait for a layout to be created
|
11970
|
-
await fin.me.once('layout-ready', async ({ layoutIdentity }) => {
|
11971
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
11972
|
-
layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
|
11973
|
-
// Backward compat - undocumented / not typed openfin-layout as layoutManager
|
11974
|
-
// TODO: eventually deprecate this
|
11975
|
-
resolve(Object.assign(this.wrapSync(layoutIdentity), { layoutManager }));
|
11976
|
-
});
|
11977
|
-
return layoutResolved;
|
11978
|
-
});
|
11979
12035
|
/**
|
11980
12036
|
* Returns the layout manager for the current window
|
11981
12037
|
* @returns
|
@@ -12010,7 +12066,7 @@ class LayoutModule extends base_1$5.Base {
|
|
12010
12066
|
* ```
|
12011
12067
|
*/
|
12012
12068
|
async wrap(identity) {
|
12013
|
-
this.wire.sendAction('layout-wrap').catch((
|
12069
|
+
this.wire.sendAction('layout-wrap').catch(() => {
|
12014
12070
|
// don't expose
|
12015
12071
|
});
|
12016
12072
|
return new Instance_1$2.Layout(identity, this.wire);
|
@@ -12035,7 +12091,7 @@ class LayoutModule extends base_1$5.Base {
|
|
12035
12091
|
* ```
|
12036
12092
|
*/
|
12037
12093
|
wrapSync(identity) {
|
12038
|
-
this.wire.sendAction('layout-wrap-sync').catch((
|
12094
|
+
this.wire.sendAction('layout-wrap-sync').catch(() => {
|
12039
12095
|
// don't expose
|
12040
12096
|
});
|
12041
12097
|
return new Instance_1$2.Layout(identity, this.wire);
|
@@ -12051,7 +12107,7 @@ class LayoutModule extends base_1$5.Base {
|
|
12051
12107
|
* ```
|
12052
12108
|
*/
|
12053
12109
|
async getCurrent() {
|
12054
|
-
this.wire.sendAction('layout-get-current').catch((
|
12110
|
+
this.wire.sendAction('layout-get-current').catch(() => {
|
12055
12111
|
// don't expose
|
12056
12112
|
});
|
12057
12113
|
if (!this.fin.me.isWindow) {
|
@@ -12074,7 +12130,7 @@ class LayoutModule extends base_1$5.Base {
|
|
12074
12130
|
* ```
|
12075
12131
|
*/
|
12076
12132
|
getCurrentSync() {
|
12077
|
-
this.wire.sendAction('layout-get-current-sync').catch((
|
12133
|
+
this.wire.sendAction('layout-get-current-sync').catch(() => {
|
12078
12134
|
// don't expose
|
12079
12135
|
});
|
12080
12136
|
if (!this.fin.me.isWindow) {
|
@@ -12085,7 +12141,7 @@ class LayoutModule extends base_1$5.Base {
|
|
12085
12141
|
}
|
12086
12142
|
}
|
12087
12143
|
Factory$2.LayoutModule = LayoutModule;
|
12088
|
-
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(),
|
12144
|
+
_LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
|
12089
12145
|
if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
|
12090
12146
|
throw new Error(`You must call init before using the API ${method}`);
|
12091
12147
|
}
|