@openfin/core 36.78.5 → 36.78.7
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 +151 -16
- package/out/mock-beta.d.ts +151 -16
- package/out/mock-public.d.ts +151 -16
- package/out/mock.d.ts +151 -16
- package/out/mock.js +75 -0
- package/package.json +1 -1
package/out/mock-alpha.d.ts
CHANGED
@@ -111,6 +111,13 @@ declare type ApiClient<T extends Record<any, any>> = {
|
|
111
111
|
[key in keyof PickOfType<T, Function>]: (...args: Parameters<T[key]>) => ReturnType<T[key]> extends Promise<any> ? ReturnType<T[key]> : Promise<ReturnType<T[key]>>;
|
112
112
|
};
|
113
113
|
|
114
|
+
/**
|
115
|
+
* @interface
|
116
|
+
*/
|
117
|
+
declare type ApiInjection = {
|
118
|
+
fin: InjectionType;
|
119
|
+
};
|
120
|
+
|
114
121
|
/**
|
115
122
|
* Generated when a new Platform's API becomes responsive.
|
116
123
|
* @interface
|
@@ -774,6 +781,72 @@ declare class Application extends EmitterBase<OpenFin_2.ApplicationEvent> {
|
|
774
781
|
* ```
|
775
782
|
*/
|
776
783
|
getFileDownloadLocation(): Promise<string>;
|
784
|
+
/**
|
785
|
+
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
786
|
+
* @param options
|
787
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
788
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
789
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
790
|
+
* these with a "reducer" pattern.
|
791
|
+
* @throws if the application has no tray icon set
|
792
|
+
* @throws if the system tray is currently hidden
|
793
|
+
* @example
|
794
|
+
*
|
795
|
+
* ```js
|
796
|
+
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
797
|
+
* const app = fin.Application.getCurrentSync();
|
798
|
+
*
|
799
|
+
* await app.setTrayIcon(iconUrl);
|
800
|
+
*
|
801
|
+
* const template = [
|
802
|
+
* {
|
803
|
+
* label: 'Menu Item 1',
|
804
|
+
* data: 'hello from item 1'
|
805
|
+
* },
|
806
|
+
* { type: 'separator' },
|
807
|
+
* {
|
808
|
+
* label: 'Menu Item 2',
|
809
|
+
* type: 'checkbox',
|
810
|
+
* checked: true,
|
811
|
+
* data: 'The user clicked the checkbox'
|
812
|
+
* },
|
813
|
+
* {
|
814
|
+
* label: 'see more',
|
815
|
+
* enabled: false,
|
816
|
+
* submenu: [
|
817
|
+
* { label: 'submenu 1', data: 'hello from submenu' }
|
818
|
+
* ]
|
819
|
+
* }
|
820
|
+
* ];
|
821
|
+
*
|
822
|
+
* app.addListener('tray-icon-clicked', (event) => {
|
823
|
+
* // right-click
|
824
|
+
* if (event.button === 2) {
|
825
|
+
* app.showTrayIconPopupMenu({ template }).then(r => {
|
826
|
+
* if (r.result === 'closed') {
|
827
|
+
* console.log('nothing happened');
|
828
|
+
* } else {
|
829
|
+
* console.log(r.data);
|
830
|
+
* }
|
831
|
+
* });
|
832
|
+
* }
|
833
|
+
* });
|
834
|
+
* ```
|
835
|
+
*/
|
836
|
+
showTrayIconPopupMenu<Data>(options: OpenFin_2.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin_2.MenuResult<Data>>;
|
837
|
+
/**
|
838
|
+
* CLoses the tray icon menu.
|
839
|
+
*
|
840
|
+
* @throws if the application has no tray icon set
|
841
|
+
* @example
|
842
|
+
*
|
843
|
+
* ```js
|
844
|
+
* const app = fin.Application.getCurrentSync();
|
845
|
+
*
|
846
|
+
* await app.closeTrayIconPopupMenu();
|
847
|
+
* ```
|
848
|
+
*/
|
849
|
+
closeTrayIconPopupMenu(): Promise<void>;
|
777
850
|
}
|
778
851
|
|
779
852
|
/**
|
@@ -1178,10 +1251,13 @@ declare type ApplicationOptions = LegacyWinOptionsInAppOptions & {
|
|
1178
1251
|
*/
|
1179
1252
|
apiDiagnostics: boolean;
|
1180
1253
|
/**
|
1181
|
-
*
|
1182
|
-
* See [here](https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads) for more details.
|
1254
|
+
* @deprecated Please use {@link domainSettings} instead
|
1183
1255
|
*/
|
1184
1256
|
defaultDomainSettings: DefaultDomainSettings;
|
1257
|
+
/**
|
1258
|
+
* Define the {@link https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads file download rules} and domain-based api injection rules.
|
1259
|
+
*/
|
1260
|
+
domainSettings: DomainSettings;
|
1185
1261
|
/**
|
1186
1262
|
* @defaultValue false
|
1187
1263
|
*
|
@@ -3476,9 +3552,13 @@ declare type ConstViewOptions = {
|
|
3476
3552
|
/**
|
3477
3553
|
* Controls interaction of the view with its parent window's download shelf.
|
3478
3554
|
*/
|
3479
|
-
downloadShelf
|
3555
|
+
downloadShelf: {
|
3480
3556
|
/**
|
3481
|
-
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
|
3557
|
+
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
|
3558
|
+
*
|
3559
|
+
* @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
|
3560
|
+
* on the parent window even if that parent window's {@link DownloadShelfOptions} specify
|
3561
|
+
* `enabled: false`.
|
3482
3562
|
*/
|
3483
3563
|
enabled: boolean;
|
3484
3564
|
};
|
@@ -3594,6 +3674,12 @@ declare type ConstWindowOptions = {
|
|
3594
3674
|
* launches in favor of the cached value.
|
3595
3675
|
*/
|
3596
3676
|
defaultWidth: number;
|
3677
|
+
/**
|
3678
|
+
* Controls the styling and behavior of the window download shelf.
|
3679
|
+
*
|
3680
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
3681
|
+
* triggered by the window itself, or a view targeting the window.
|
3682
|
+
*/
|
3597
3683
|
downloadShelf: DownloadShelfOptions;
|
3598
3684
|
height: number;
|
3599
3685
|
layout: any;
|
@@ -4431,21 +4517,15 @@ declare type CustomRequestHeaders = {
|
|
4431
4517
|
declare type DataChannelReadyState = RTCDataChannel['readyState'];
|
4432
4518
|
|
4433
4519
|
/**
|
4520
|
+
* @deprecated Use {@link OpenFin.DomainSettings} instead.
|
4434
4521
|
* @interface
|
4435
4522
|
*/
|
4436
|
-
declare type DefaultDomainSettings =
|
4437
|
-
rules: DefaultDomainSettingsRule[];
|
4438
|
-
};
|
4523
|
+
declare type DefaultDomainSettings = DomainSettings;
|
4439
4524
|
|
4440
4525
|
/**
|
4441
|
-
* @
|
4526
|
+
* @deprecated Use {@link OpenFin.DomainSettingsRule} instead.
|
4442
4527
|
*/
|
4443
|
-
declare type DefaultDomainSettingsRule =
|
4444
|
-
match: string[];
|
4445
|
-
options: {
|
4446
|
-
downloadSettings: FileDownloadSettings;
|
4447
|
-
};
|
4448
|
-
};
|
4528
|
+
declare type DefaultDomainSettingsRule = DomainSettingsRule;
|
4449
4529
|
|
4450
4530
|
declare interface DesktopAgent {
|
4451
4531
|
open(app: TargetApp, context?: Context): Promise<void>;
|
@@ -4690,6 +4770,25 @@ declare type DisplayMetadata_3 = {
|
|
4690
4770
|
readonly glyph?: string;
|
4691
4771
|
};
|
4692
4772
|
|
4773
|
+
/**
|
4774
|
+
* @interface
|
4775
|
+
* Define the {@link https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads file download rules} and domain-based api injection rules.
|
4776
|
+
*/
|
4777
|
+
declare type DomainSettings = {
|
4778
|
+
rules: DomainSettingsRule[];
|
4779
|
+
};
|
4780
|
+
|
4781
|
+
/**
|
4782
|
+
* @interface
|
4783
|
+
*/
|
4784
|
+
declare type DomainSettingsRule = {
|
4785
|
+
match: string[];
|
4786
|
+
options: {
|
4787
|
+
downloadSettings?: FileDownloadSettings;
|
4788
|
+
api?: ApiInjection;
|
4789
|
+
};
|
4790
|
+
};
|
4791
|
+
|
4693
4792
|
/**
|
4694
4793
|
* Metadata returned from a preload script download request.
|
4695
4794
|
*
|
@@ -4734,14 +4833,24 @@ declare type DownloadRule = {
|
|
4734
4833
|
* @interface
|
4735
4834
|
*
|
4736
4835
|
* Controls the styling and behavior of the window download shelf.
|
4836
|
+
*
|
4837
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
4838
|
+
* triggered by the window itself, or a view targeting the window.
|
4737
4839
|
*/
|
4738
4840
|
declare type DownloadShelfOptions = {
|
4739
4841
|
/**
|
4740
|
-
* Whether downloads in this window trigger
|
4842
|
+
* Whether downloads in this window trigger display of the download shelf.
|
4843
|
+
*
|
4844
|
+
* @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
|
4845
|
+
* with `downloadShelf: { enabled: true }` initiates a download.
|
4741
4846
|
*/
|
4742
4847
|
enabled: boolean;
|
4743
4848
|
/**
|
4744
4849
|
* Styling options for the download shelf border.
|
4850
|
+
*
|
4851
|
+
* @remarks These apply regardless of whether download shelf display was
|
4852
|
+
* triggered by this window itself, or a view targeting the window. Individual views
|
4853
|
+
* cannot control the rendering of their parent window's download shelf.
|
4745
4854
|
*/
|
4746
4855
|
border?: {
|
4747
4856
|
/**
|
@@ -6560,6 +6669,11 @@ declare type InitPlatformOptions = {
|
|
6560
6669
|
interopOverride?: OverrideCallback<InteropBroker> | ConstructorOverride<InteropBroker>[];
|
6561
6670
|
};
|
6562
6671
|
|
6672
|
+
/**
|
6673
|
+
* * 'none': The `fin` API will be not available from within this context.
|
6674
|
+
* * 'global': The entire `fin` API will be available from within this context.
|
6675
|
+
* @defaultValue 'global'
|
6676
|
+
*/
|
6563
6677
|
declare type InjectionType = 'none' | 'global';
|
6564
6678
|
|
6565
6679
|
/**
|
@@ -8813,7 +8927,7 @@ declare type LayoutOptions = {
|
|
8813
8927
|
declare type LayoutPosition = 'top' | 'bottom' | 'left' | 'right';
|
8814
8928
|
|
8815
8929
|
/**
|
8816
|
-
*
|
8930
|
+
* Layout preset type.
|
8817
8931
|
*/
|
8818
8932
|
declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
|
8819
8933
|
|
@@ -9859,11 +9973,15 @@ declare namespace OpenFin_2 {
|
|
9859
9973
|
ClosedMenuResult,
|
9860
9974
|
MenuResult,
|
9861
9975
|
ShowPopupMenuOptions,
|
9976
|
+
ShowTrayIconPopupMenuOptions,
|
9862
9977
|
MenuItemTemplate,
|
9863
9978
|
NativeWindowIntegrationProviderAuthorization,
|
9864
9979
|
RuntimeInfo,
|
9865
9980
|
DefaultDomainSettings,
|
9866
9981
|
DefaultDomainSettingsRule,
|
9982
|
+
DomainSettings,
|
9983
|
+
ApiInjection,
|
9984
|
+
DomainSettingsRule,
|
9867
9985
|
FileDownloadBehaviorNames,
|
9868
9986
|
FileDownloadSettings,
|
9869
9987
|
DownloadRule,
|
@@ -13094,6 +13212,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
|
|
13094
13212
|
type: 'show-requested';
|
13095
13213
|
};
|
13096
13214
|
|
13215
|
+
/**
|
13216
|
+
* Options for showing a tray icon popup menu
|
13217
|
+
*
|
13218
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
13219
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
13220
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
13221
|
+
* these with a "reducer" pattern.
|
13222
|
+
*
|
13223
|
+
* @interface
|
13224
|
+
*/
|
13225
|
+
declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
|
13226
|
+
/**
|
13227
|
+
* An array describing the menu to show.
|
13228
|
+
*/
|
13229
|
+
template: MenuItemTemplate<Data>[];
|
13230
|
+
};
|
13231
|
+
|
13097
13232
|
/**
|
13098
13233
|
* _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
13099
13234
|
*
|
package/out/mock-beta.d.ts
CHANGED
@@ -111,6 +111,13 @@ declare type ApiClient<T extends Record<any, any>> = {
|
|
111
111
|
[key in keyof PickOfType<T, Function>]: (...args: Parameters<T[key]>) => ReturnType<T[key]> extends Promise<any> ? ReturnType<T[key]> : Promise<ReturnType<T[key]>>;
|
112
112
|
};
|
113
113
|
|
114
|
+
/**
|
115
|
+
* @interface
|
116
|
+
*/
|
117
|
+
declare type ApiInjection = {
|
118
|
+
fin: InjectionType;
|
119
|
+
};
|
120
|
+
|
114
121
|
/**
|
115
122
|
* Generated when a new Platform's API becomes responsive.
|
116
123
|
* @interface
|
@@ -774,6 +781,72 @@ declare class Application extends EmitterBase<OpenFin_2.ApplicationEvent> {
|
|
774
781
|
* ```
|
775
782
|
*/
|
776
783
|
getFileDownloadLocation(): Promise<string>;
|
784
|
+
/**
|
785
|
+
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
786
|
+
* @param options
|
787
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
788
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
789
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
790
|
+
* these with a "reducer" pattern.
|
791
|
+
* @throws if the application has no tray icon set
|
792
|
+
* @throws if the system tray is currently hidden
|
793
|
+
* @example
|
794
|
+
*
|
795
|
+
* ```js
|
796
|
+
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
797
|
+
* const app = fin.Application.getCurrentSync();
|
798
|
+
*
|
799
|
+
* await app.setTrayIcon(iconUrl);
|
800
|
+
*
|
801
|
+
* const template = [
|
802
|
+
* {
|
803
|
+
* label: 'Menu Item 1',
|
804
|
+
* data: 'hello from item 1'
|
805
|
+
* },
|
806
|
+
* { type: 'separator' },
|
807
|
+
* {
|
808
|
+
* label: 'Menu Item 2',
|
809
|
+
* type: 'checkbox',
|
810
|
+
* checked: true,
|
811
|
+
* data: 'The user clicked the checkbox'
|
812
|
+
* },
|
813
|
+
* {
|
814
|
+
* label: 'see more',
|
815
|
+
* enabled: false,
|
816
|
+
* submenu: [
|
817
|
+
* { label: 'submenu 1', data: 'hello from submenu' }
|
818
|
+
* ]
|
819
|
+
* }
|
820
|
+
* ];
|
821
|
+
*
|
822
|
+
* app.addListener('tray-icon-clicked', (event) => {
|
823
|
+
* // right-click
|
824
|
+
* if (event.button === 2) {
|
825
|
+
* app.showTrayIconPopupMenu({ template }).then(r => {
|
826
|
+
* if (r.result === 'closed') {
|
827
|
+
* console.log('nothing happened');
|
828
|
+
* } else {
|
829
|
+
* console.log(r.data);
|
830
|
+
* }
|
831
|
+
* });
|
832
|
+
* }
|
833
|
+
* });
|
834
|
+
* ```
|
835
|
+
*/
|
836
|
+
showTrayIconPopupMenu<Data>(options: OpenFin_2.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin_2.MenuResult<Data>>;
|
837
|
+
/**
|
838
|
+
* CLoses the tray icon menu.
|
839
|
+
*
|
840
|
+
* @throws if the application has no tray icon set
|
841
|
+
* @example
|
842
|
+
*
|
843
|
+
* ```js
|
844
|
+
* const app = fin.Application.getCurrentSync();
|
845
|
+
*
|
846
|
+
* await app.closeTrayIconPopupMenu();
|
847
|
+
* ```
|
848
|
+
*/
|
849
|
+
closeTrayIconPopupMenu(): Promise<void>;
|
777
850
|
}
|
778
851
|
|
779
852
|
/**
|
@@ -1178,10 +1251,13 @@ declare type ApplicationOptions = LegacyWinOptionsInAppOptions & {
|
|
1178
1251
|
*/
|
1179
1252
|
apiDiagnostics: boolean;
|
1180
1253
|
/**
|
1181
|
-
*
|
1182
|
-
* See [here](https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads) for more details.
|
1254
|
+
* @deprecated Please use {@link domainSettings} instead
|
1183
1255
|
*/
|
1184
1256
|
defaultDomainSettings: DefaultDomainSettings;
|
1257
|
+
/**
|
1258
|
+
* Define the {@link https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads file download rules} and domain-based api injection rules.
|
1259
|
+
*/
|
1260
|
+
domainSettings: DomainSettings;
|
1185
1261
|
/**
|
1186
1262
|
* @defaultValue false
|
1187
1263
|
*
|
@@ -3476,9 +3552,13 @@ declare type ConstViewOptions = {
|
|
3476
3552
|
/**
|
3477
3553
|
* Controls interaction of the view with its parent window's download shelf.
|
3478
3554
|
*/
|
3479
|
-
downloadShelf
|
3555
|
+
downloadShelf: {
|
3480
3556
|
/**
|
3481
|
-
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
|
3557
|
+
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
|
3558
|
+
*
|
3559
|
+
* @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
|
3560
|
+
* on the parent window even if that parent window's {@link DownloadShelfOptions} specify
|
3561
|
+
* `enabled: false`.
|
3482
3562
|
*/
|
3483
3563
|
enabled: boolean;
|
3484
3564
|
};
|
@@ -3594,6 +3674,12 @@ declare type ConstWindowOptions = {
|
|
3594
3674
|
* launches in favor of the cached value.
|
3595
3675
|
*/
|
3596
3676
|
defaultWidth: number;
|
3677
|
+
/**
|
3678
|
+
* Controls the styling and behavior of the window download shelf.
|
3679
|
+
*
|
3680
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
3681
|
+
* triggered by the window itself, or a view targeting the window.
|
3682
|
+
*/
|
3597
3683
|
downloadShelf: DownloadShelfOptions;
|
3598
3684
|
height: number;
|
3599
3685
|
layout: any;
|
@@ -4431,21 +4517,15 @@ declare type CustomRequestHeaders = {
|
|
4431
4517
|
declare type DataChannelReadyState = RTCDataChannel['readyState'];
|
4432
4518
|
|
4433
4519
|
/**
|
4520
|
+
* @deprecated Use {@link OpenFin.DomainSettings} instead.
|
4434
4521
|
* @interface
|
4435
4522
|
*/
|
4436
|
-
declare type DefaultDomainSettings =
|
4437
|
-
rules: DefaultDomainSettingsRule[];
|
4438
|
-
};
|
4523
|
+
declare type DefaultDomainSettings = DomainSettings;
|
4439
4524
|
|
4440
4525
|
/**
|
4441
|
-
* @
|
4526
|
+
* @deprecated Use {@link OpenFin.DomainSettingsRule} instead.
|
4442
4527
|
*/
|
4443
|
-
declare type DefaultDomainSettingsRule =
|
4444
|
-
match: string[];
|
4445
|
-
options: {
|
4446
|
-
downloadSettings: FileDownloadSettings;
|
4447
|
-
};
|
4448
|
-
};
|
4528
|
+
declare type DefaultDomainSettingsRule = DomainSettingsRule;
|
4449
4529
|
|
4450
4530
|
declare interface DesktopAgent {
|
4451
4531
|
open(app: TargetApp, context?: Context): Promise<void>;
|
@@ -4690,6 +4770,25 @@ declare type DisplayMetadata_3 = {
|
|
4690
4770
|
readonly glyph?: string;
|
4691
4771
|
};
|
4692
4772
|
|
4773
|
+
/**
|
4774
|
+
* @interface
|
4775
|
+
* Define the {@link https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads file download rules} and domain-based api injection rules.
|
4776
|
+
*/
|
4777
|
+
declare type DomainSettings = {
|
4778
|
+
rules: DomainSettingsRule[];
|
4779
|
+
};
|
4780
|
+
|
4781
|
+
/**
|
4782
|
+
* @interface
|
4783
|
+
*/
|
4784
|
+
declare type DomainSettingsRule = {
|
4785
|
+
match: string[];
|
4786
|
+
options: {
|
4787
|
+
downloadSettings?: FileDownloadSettings;
|
4788
|
+
api?: ApiInjection;
|
4789
|
+
};
|
4790
|
+
};
|
4791
|
+
|
4693
4792
|
/**
|
4694
4793
|
* Metadata returned from a preload script download request.
|
4695
4794
|
*
|
@@ -4734,14 +4833,24 @@ declare type DownloadRule = {
|
|
4734
4833
|
* @interface
|
4735
4834
|
*
|
4736
4835
|
* Controls the styling and behavior of the window download shelf.
|
4836
|
+
*
|
4837
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
4838
|
+
* triggered by the window itself, or a view targeting the window.
|
4737
4839
|
*/
|
4738
4840
|
declare type DownloadShelfOptions = {
|
4739
4841
|
/**
|
4740
|
-
* Whether downloads in this window trigger
|
4842
|
+
* Whether downloads in this window trigger display of the download shelf.
|
4843
|
+
*
|
4844
|
+
* @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
|
4845
|
+
* with `downloadShelf: { enabled: true }` initiates a download.
|
4741
4846
|
*/
|
4742
4847
|
enabled: boolean;
|
4743
4848
|
/**
|
4744
4849
|
* Styling options for the download shelf border.
|
4850
|
+
*
|
4851
|
+
* @remarks These apply regardless of whether download shelf display was
|
4852
|
+
* triggered by this window itself, or a view targeting the window. Individual views
|
4853
|
+
* cannot control the rendering of their parent window's download shelf.
|
4745
4854
|
*/
|
4746
4855
|
border?: {
|
4747
4856
|
/**
|
@@ -6560,6 +6669,11 @@ declare type InitPlatformOptions = {
|
|
6560
6669
|
interopOverride?: OverrideCallback<InteropBroker> | ConstructorOverride<InteropBroker>[];
|
6561
6670
|
};
|
6562
6671
|
|
6672
|
+
/**
|
6673
|
+
* * 'none': The `fin` API will be not available from within this context.
|
6674
|
+
* * 'global': The entire `fin` API will be available from within this context.
|
6675
|
+
* @defaultValue 'global'
|
6676
|
+
*/
|
6563
6677
|
declare type InjectionType = 'none' | 'global';
|
6564
6678
|
|
6565
6679
|
/**
|
@@ -8813,7 +8927,7 @@ declare type LayoutOptions = {
|
|
8813
8927
|
declare type LayoutPosition = 'top' | 'bottom' | 'left' | 'right';
|
8814
8928
|
|
8815
8929
|
/**
|
8816
|
-
*
|
8930
|
+
* Layout preset type.
|
8817
8931
|
*/
|
8818
8932
|
declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
|
8819
8933
|
|
@@ -9859,11 +9973,15 @@ declare namespace OpenFin_2 {
|
|
9859
9973
|
ClosedMenuResult,
|
9860
9974
|
MenuResult,
|
9861
9975
|
ShowPopupMenuOptions,
|
9976
|
+
ShowTrayIconPopupMenuOptions,
|
9862
9977
|
MenuItemTemplate,
|
9863
9978
|
NativeWindowIntegrationProviderAuthorization,
|
9864
9979
|
RuntimeInfo,
|
9865
9980
|
DefaultDomainSettings,
|
9866
9981
|
DefaultDomainSettingsRule,
|
9982
|
+
DomainSettings,
|
9983
|
+
ApiInjection,
|
9984
|
+
DomainSettingsRule,
|
9867
9985
|
FileDownloadBehaviorNames,
|
9868
9986
|
FileDownloadSettings,
|
9869
9987
|
DownloadRule,
|
@@ -13094,6 +13212,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
|
|
13094
13212
|
type: 'show-requested';
|
13095
13213
|
};
|
13096
13214
|
|
13215
|
+
/**
|
13216
|
+
* Options for showing a tray icon popup menu
|
13217
|
+
*
|
13218
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
13219
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
13220
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
13221
|
+
* these with a "reducer" pattern.
|
13222
|
+
*
|
13223
|
+
* @interface
|
13224
|
+
*/
|
13225
|
+
declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
|
13226
|
+
/**
|
13227
|
+
* An array describing the menu to show.
|
13228
|
+
*/
|
13229
|
+
template: MenuItemTemplate<Data>[];
|
13230
|
+
};
|
13231
|
+
|
13097
13232
|
/**
|
13098
13233
|
* _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
13099
13234
|
*
|
package/out/mock-public.d.ts
CHANGED
@@ -111,6 +111,13 @@ declare type ApiClient<T extends Record<any, any>> = {
|
|
111
111
|
[key in keyof PickOfType<T, Function>]: (...args: Parameters<T[key]>) => ReturnType<T[key]> extends Promise<any> ? ReturnType<T[key]> : Promise<ReturnType<T[key]>>;
|
112
112
|
};
|
113
113
|
|
114
|
+
/**
|
115
|
+
* @interface
|
116
|
+
*/
|
117
|
+
declare type ApiInjection = {
|
118
|
+
fin: InjectionType;
|
119
|
+
};
|
120
|
+
|
114
121
|
/**
|
115
122
|
* Generated when a new Platform's API becomes responsive.
|
116
123
|
* @interface
|
@@ -774,6 +781,72 @@ declare class Application extends EmitterBase<OpenFin_2.ApplicationEvent> {
|
|
774
781
|
* ```
|
775
782
|
*/
|
776
783
|
getFileDownloadLocation(): Promise<string>;
|
784
|
+
/**
|
785
|
+
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
786
|
+
* @param options
|
787
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
788
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
789
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
790
|
+
* these with a "reducer" pattern.
|
791
|
+
* @throws if the application has no tray icon set
|
792
|
+
* @throws if the system tray is currently hidden
|
793
|
+
* @example
|
794
|
+
*
|
795
|
+
* ```js
|
796
|
+
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
797
|
+
* const app = fin.Application.getCurrentSync();
|
798
|
+
*
|
799
|
+
* await app.setTrayIcon(iconUrl);
|
800
|
+
*
|
801
|
+
* const template = [
|
802
|
+
* {
|
803
|
+
* label: 'Menu Item 1',
|
804
|
+
* data: 'hello from item 1'
|
805
|
+
* },
|
806
|
+
* { type: 'separator' },
|
807
|
+
* {
|
808
|
+
* label: 'Menu Item 2',
|
809
|
+
* type: 'checkbox',
|
810
|
+
* checked: true,
|
811
|
+
* data: 'The user clicked the checkbox'
|
812
|
+
* },
|
813
|
+
* {
|
814
|
+
* label: 'see more',
|
815
|
+
* enabled: false,
|
816
|
+
* submenu: [
|
817
|
+
* { label: 'submenu 1', data: 'hello from submenu' }
|
818
|
+
* ]
|
819
|
+
* }
|
820
|
+
* ];
|
821
|
+
*
|
822
|
+
* app.addListener('tray-icon-clicked', (event) => {
|
823
|
+
* // right-click
|
824
|
+
* if (event.button === 2) {
|
825
|
+
* app.showTrayIconPopupMenu({ template }).then(r => {
|
826
|
+
* if (r.result === 'closed') {
|
827
|
+
* console.log('nothing happened');
|
828
|
+
* } else {
|
829
|
+
* console.log(r.data);
|
830
|
+
* }
|
831
|
+
* });
|
832
|
+
* }
|
833
|
+
* });
|
834
|
+
* ```
|
835
|
+
*/
|
836
|
+
showTrayIconPopupMenu<Data>(options: OpenFin_2.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin_2.MenuResult<Data>>;
|
837
|
+
/**
|
838
|
+
* CLoses the tray icon menu.
|
839
|
+
*
|
840
|
+
* @throws if the application has no tray icon set
|
841
|
+
* @example
|
842
|
+
*
|
843
|
+
* ```js
|
844
|
+
* const app = fin.Application.getCurrentSync();
|
845
|
+
*
|
846
|
+
* await app.closeTrayIconPopupMenu();
|
847
|
+
* ```
|
848
|
+
*/
|
849
|
+
closeTrayIconPopupMenu(): Promise<void>;
|
777
850
|
}
|
778
851
|
|
779
852
|
/**
|
@@ -1178,10 +1251,13 @@ declare type ApplicationOptions = LegacyWinOptionsInAppOptions & {
|
|
1178
1251
|
*/
|
1179
1252
|
apiDiagnostics: boolean;
|
1180
1253
|
/**
|
1181
|
-
*
|
1182
|
-
* See [here](https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads) for more details.
|
1254
|
+
* @deprecated Please use {@link domainSettings} instead
|
1183
1255
|
*/
|
1184
1256
|
defaultDomainSettings: DefaultDomainSettings;
|
1257
|
+
/**
|
1258
|
+
* Define the {@link https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads file download rules} and domain-based api injection rules.
|
1259
|
+
*/
|
1260
|
+
domainSettings: DomainSettings;
|
1185
1261
|
/**
|
1186
1262
|
* @defaultValue false
|
1187
1263
|
*
|
@@ -3476,9 +3552,13 @@ declare type ConstViewOptions = {
|
|
3476
3552
|
/**
|
3477
3553
|
* Controls interaction of the view with its parent window's download shelf.
|
3478
3554
|
*/
|
3479
|
-
downloadShelf
|
3555
|
+
downloadShelf: {
|
3480
3556
|
/**
|
3481
|
-
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
|
3557
|
+
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
|
3558
|
+
*
|
3559
|
+
* @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
|
3560
|
+
* on the parent window even if that parent window's {@link DownloadShelfOptions} specify
|
3561
|
+
* `enabled: false`.
|
3482
3562
|
*/
|
3483
3563
|
enabled: boolean;
|
3484
3564
|
};
|
@@ -3594,6 +3674,12 @@ declare type ConstWindowOptions = {
|
|
3594
3674
|
* launches in favor of the cached value.
|
3595
3675
|
*/
|
3596
3676
|
defaultWidth: number;
|
3677
|
+
/**
|
3678
|
+
* Controls the styling and behavior of the window download shelf.
|
3679
|
+
*
|
3680
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
3681
|
+
* triggered by the window itself, or a view targeting the window.
|
3682
|
+
*/
|
3597
3683
|
downloadShelf: DownloadShelfOptions;
|
3598
3684
|
height: number;
|
3599
3685
|
layout: any;
|
@@ -4431,21 +4517,15 @@ declare type CustomRequestHeaders = {
|
|
4431
4517
|
declare type DataChannelReadyState = RTCDataChannel['readyState'];
|
4432
4518
|
|
4433
4519
|
/**
|
4520
|
+
* @deprecated Use {@link OpenFin.DomainSettings} instead.
|
4434
4521
|
* @interface
|
4435
4522
|
*/
|
4436
|
-
declare type DefaultDomainSettings =
|
4437
|
-
rules: DefaultDomainSettingsRule[];
|
4438
|
-
};
|
4523
|
+
declare type DefaultDomainSettings = DomainSettings;
|
4439
4524
|
|
4440
4525
|
/**
|
4441
|
-
* @
|
4526
|
+
* @deprecated Use {@link OpenFin.DomainSettingsRule} instead.
|
4442
4527
|
*/
|
4443
|
-
declare type DefaultDomainSettingsRule =
|
4444
|
-
match: string[];
|
4445
|
-
options: {
|
4446
|
-
downloadSettings: FileDownloadSettings;
|
4447
|
-
};
|
4448
|
-
};
|
4528
|
+
declare type DefaultDomainSettingsRule = DomainSettingsRule;
|
4449
4529
|
|
4450
4530
|
declare interface DesktopAgent {
|
4451
4531
|
open(app: TargetApp, context?: Context): Promise<void>;
|
@@ -4690,6 +4770,25 @@ declare type DisplayMetadata_3 = {
|
|
4690
4770
|
readonly glyph?: string;
|
4691
4771
|
};
|
4692
4772
|
|
4773
|
+
/**
|
4774
|
+
* @interface
|
4775
|
+
* Define the {@link https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads file download rules} and domain-based api injection rules.
|
4776
|
+
*/
|
4777
|
+
declare type DomainSettings = {
|
4778
|
+
rules: DomainSettingsRule[];
|
4779
|
+
};
|
4780
|
+
|
4781
|
+
/**
|
4782
|
+
* @interface
|
4783
|
+
*/
|
4784
|
+
declare type DomainSettingsRule = {
|
4785
|
+
match: string[];
|
4786
|
+
options: {
|
4787
|
+
downloadSettings?: FileDownloadSettings;
|
4788
|
+
api?: ApiInjection;
|
4789
|
+
};
|
4790
|
+
};
|
4791
|
+
|
4693
4792
|
/**
|
4694
4793
|
* Metadata returned from a preload script download request.
|
4695
4794
|
*
|
@@ -4734,14 +4833,24 @@ declare type DownloadRule = {
|
|
4734
4833
|
* @interface
|
4735
4834
|
*
|
4736
4835
|
* Controls the styling and behavior of the window download shelf.
|
4836
|
+
*
|
4837
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
4838
|
+
* triggered by the window itself, or a view targeting the window.
|
4737
4839
|
*/
|
4738
4840
|
declare type DownloadShelfOptions = {
|
4739
4841
|
/**
|
4740
|
-
* Whether downloads in this window trigger
|
4842
|
+
* Whether downloads in this window trigger display of the download shelf.
|
4843
|
+
*
|
4844
|
+
* @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
|
4845
|
+
* with `downloadShelf: { enabled: true }` initiates a download.
|
4741
4846
|
*/
|
4742
4847
|
enabled: boolean;
|
4743
4848
|
/**
|
4744
4849
|
* Styling options for the download shelf border.
|
4850
|
+
*
|
4851
|
+
* @remarks These apply regardless of whether download shelf display was
|
4852
|
+
* triggered by this window itself, or a view targeting the window. Individual views
|
4853
|
+
* cannot control the rendering of their parent window's download shelf.
|
4745
4854
|
*/
|
4746
4855
|
border?: {
|
4747
4856
|
/**
|
@@ -6560,6 +6669,11 @@ declare type InitPlatformOptions = {
|
|
6560
6669
|
interopOverride?: OverrideCallback<InteropBroker> | ConstructorOverride<InteropBroker>[];
|
6561
6670
|
};
|
6562
6671
|
|
6672
|
+
/**
|
6673
|
+
* * 'none': The `fin` API will be not available from within this context.
|
6674
|
+
* * 'global': The entire `fin` API will be available from within this context.
|
6675
|
+
* @defaultValue 'global'
|
6676
|
+
*/
|
6563
6677
|
declare type InjectionType = 'none' | 'global';
|
6564
6678
|
|
6565
6679
|
/**
|
@@ -8813,7 +8927,7 @@ declare type LayoutOptions = {
|
|
8813
8927
|
declare type LayoutPosition = 'top' | 'bottom' | 'left' | 'right';
|
8814
8928
|
|
8815
8929
|
/**
|
8816
|
-
*
|
8930
|
+
* Layout preset type.
|
8817
8931
|
*/
|
8818
8932
|
declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
|
8819
8933
|
|
@@ -9859,11 +9973,15 @@ declare namespace OpenFin_2 {
|
|
9859
9973
|
ClosedMenuResult,
|
9860
9974
|
MenuResult,
|
9861
9975
|
ShowPopupMenuOptions,
|
9976
|
+
ShowTrayIconPopupMenuOptions,
|
9862
9977
|
MenuItemTemplate,
|
9863
9978
|
NativeWindowIntegrationProviderAuthorization,
|
9864
9979
|
RuntimeInfo,
|
9865
9980
|
DefaultDomainSettings,
|
9866
9981
|
DefaultDomainSettingsRule,
|
9982
|
+
DomainSettings,
|
9983
|
+
ApiInjection,
|
9984
|
+
DomainSettingsRule,
|
9867
9985
|
FileDownloadBehaviorNames,
|
9868
9986
|
FileDownloadSettings,
|
9869
9987
|
DownloadRule,
|
@@ -13094,6 +13212,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
|
|
13094
13212
|
type: 'show-requested';
|
13095
13213
|
};
|
13096
13214
|
|
13215
|
+
/**
|
13216
|
+
* Options for showing a tray icon popup menu
|
13217
|
+
*
|
13218
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
13219
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
13220
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
13221
|
+
* these with a "reducer" pattern.
|
13222
|
+
*
|
13223
|
+
* @interface
|
13224
|
+
*/
|
13225
|
+
declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
|
13226
|
+
/**
|
13227
|
+
* An array describing the menu to show.
|
13228
|
+
*/
|
13229
|
+
template: MenuItemTemplate<Data>[];
|
13230
|
+
};
|
13231
|
+
|
13097
13232
|
/**
|
13098
13233
|
* _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
13099
13234
|
*
|
package/out/mock.d.ts
CHANGED
@@ -111,6 +111,13 @@ declare type ApiClient<T extends Record<any, any>> = {
|
|
111
111
|
[key in keyof PickOfType<T, Function>]: (...args: Parameters<T[key]>) => ReturnType<T[key]> extends Promise<any> ? ReturnType<T[key]> : Promise<ReturnType<T[key]>>;
|
112
112
|
};
|
113
113
|
|
114
|
+
/**
|
115
|
+
* @interface
|
116
|
+
*/
|
117
|
+
declare type ApiInjection = {
|
118
|
+
fin: InjectionType;
|
119
|
+
};
|
120
|
+
|
114
121
|
/**
|
115
122
|
* Generated when a new Platform's API becomes responsive.
|
116
123
|
* @interface
|
@@ -780,6 +787,72 @@ declare class Application extends EmitterBase<OpenFin_2.ApplicationEvent> {
|
|
780
787
|
* ```
|
781
788
|
*/
|
782
789
|
getFileDownloadLocation(): Promise<string>;
|
790
|
+
/**
|
791
|
+
* Shows a menu on the tray icon. Use with tray-icon-clicked event.
|
792
|
+
* @param options
|
793
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
794
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
795
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
796
|
+
* these with a "reducer" pattern.
|
797
|
+
* @throws if the application has no tray icon set
|
798
|
+
* @throws if the system tray is currently hidden
|
799
|
+
* @example
|
800
|
+
*
|
801
|
+
* ```js
|
802
|
+
* const iconUrl = 'http://cdn.openfin.co/assets/testing/icons/circled-digit-one.png';
|
803
|
+
* const app = fin.Application.getCurrentSync();
|
804
|
+
*
|
805
|
+
* await app.setTrayIcon(iconUrl);
|
806
|
+
*
|
807
|
+
* const template = [
|
808
|
+
* {
|
809
|
+
* label: 'Menu Item 1',
|
810
|
+
* data: 'hello from item 1'
|
811
|
+
* },
|
812
|
+
* { type: 'separator' },
|
813
|
+
* {
|
814
|
+
* label: 'Menu Item 2',
|
815
|
+
* type: 'checkbox',
|
816
|
+
* checked: true,
|
817
|
+
* data: 'The user clicked the checkbox'
|
818
|
+
* },
|
819
|
+
* {
|
820
|
+
* label: 'see more',
|
821
|
+
* enabled: false,
|
822
|
+
* submenu: [
|
823
|
+
* { label: 'submenu 1', data: 'hello from submenu' }
|
824
|
+
* ]
|
825
|
+
* }
|
826
|
+
* ];
|
827
|
+
*
|
828
|
+
* app.addListener('tray-icon-clicked', (event) => {
|
829
|
+
* // right-click
|
830
|
+
* if (event.button === 2) {
|
831
|
+
* app.showTrayIconPopupMenu({ template }).then(r => {
|
832
|
+
* if (r.result === 'closed') {
|
833
|
+
* console.log('nothing happened');
|
834
|
+
* } else {
|
835
|
+
* console.log(r.data);
|
836
|
+
* }
|
837
|
+
* });
|
838
|
+
* }
|
839
|
+
* });
|
840
|
+
* ```
|
841
|
+
*/
|
842
|
+
showTrayIconPopupMenu<Data>(options: OpenFin_2.ShowTrayIconPopupMenuOptions<Data>): Promise<OpenFin_2.MenuResult<Data>>;
|
843
|
+
/**
|
844
|
+
* CLoses the tray icon menu.
|
845
|
+
*
|
846
|
+
* @throws if the application has no tray icon set
|
847
|
+
* @example
|
848
|
+
*
|
849
|
+
* ```js
|
850
|
+
* const app = fin.Application.getCurrentSync();
|
851
|
+
*
|
852
|
+
* await app.closeTrayIconPopupMenu();
|
853
|
+
* ```
|
854
|
+
*/
|
855
|
+
closeTrayIconPopupMenu(): Promise<void>;
|
783
856
|
}
|
784
857
|
|
785
858
|
/**
|
@@ -1184,10 +1257,13 @@ declare type ApplicationOptions = LegacyWinOptionsInAppOptions & {
|
|
1184
1257
|
*/
|
1185
1258
|
apiDiagnostics: boolean;
|
1186
1259
|
/**
|
1187
|
-
*
|
1188
|
-
* See [here](https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads) for more details.
|
1260
|
+
* @deprecated Please use {@link domainSettings} instead
|
1189
1261
|
*/
|
1190
1262
|
defaultDomainSettings: DefaultDomainSettings;
|
1263
|
+
/**
|
1264
|
+
* Define the {@link https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads file download rules} and domain-based api injection rules.
|
1265
|
+
*/
|
1266
|
+
domainSettings: DomainSettings;
|
1191
1267
|
/**
|
1192
1268
|
* @defaultValue false
|
1193
1269
|
*
|
@@ -3519,9 +3595,13 @@ declare type ConstViewOptions = {
|
|
3519
3595
|
/**
|
3520
3596
|
* Controls interaction of the view with its parent window's download shelf.
|
3521
3597
|
*/
|
3522
|
-
downloadShelf
|
3598
|
+
downloadShelf: {
|
3523
3599
|
/**
|
3524
|
-
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
|
3600
|
+
* Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
|
3601
|
+
*
|
3602
|
+
* @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
|
3603
|
+
* on the parent window even if that parent window's {@link DownloadShelfOptions} specify
|
3604
|
+
* `enabled: false`.
|
3525
3605
|
*/
|
3526
3606
|
enabled: boolean;
|
3527
3607
|
};
|
@@ -3637,6 +3717,12 @@ declare type ConstWindowOptions = {
|
|
3637
3717
|
* launches in favor of the cached value.
|
3638
3718
|
*/
|
3639
3719
|
defaultWidth: number;
|
3720
|
+
/**
|
3721
|
+
* Controls the styling and behavior of the window download shelf.
|
3722
|
+
*
|
3723
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
3724
|
+
* triggered by the window itself, or a view targeting the window.
|
3725
|
+
*/
|
3640
3726
|
downloadShelf: DownloadShelfOptions;
|
3641
3727
|
height: number;
|
3642
3728
|
layout: any;
|
@@ -4474,21 +4560,15 @@ declare type CustomRequestHeaders = {
|
|
4474
4560
|
declare type DataChannelReadyState = RTCDataChannel['readyState'];
|
4475
4561
|
|
4476
4562
|
/**
|
4563
|
+
* @deprecated Use {@link OpenFin.DomainSettings} instead.
|
4477
4564
|
* @interface
|
4478
4565
|
*/
|
4479
|
-
declare type DefaultDomainSettings =
|
4480
|
-
rules: DefaultDomainSettingsRule[];
|
4481
|
-
};
|
4566
|
+
declare type DefaultDomainSettings = DomainSettings;
|
4482
4567
|
|
4483
4568
|
/**
|
4484
|
-
* @
|
4569
|
+
* @deprecated Use {@link OpenFin.DomainSettingsRule} instead.
|
4485
4570
|
*/
|
4486
|
-
declare type DefaultDomainSettingsRule =
|
4487
|
-
match: string[];
|
4488
|
-
options: {
|
4489
|
-
downloadSettings: FileDownloadSettings;
|
4490
|
-
};
|
4491
|
-
};
|
4571
|
+
declare type DefaultDomainSettingsRule = DomainSettingsRule;
|
4492
4572
|
|
4493
4573
|
declare interface DesktopAgent {
|
4494
4574
|
open(app: TargetApp, context?: Context): Promise<void>;
|
@@ -4733,6 +4813,25 @@ declare type DisplayMetadata_3 = {
|
|
4733
4813
|
readonly glyph?: string;
|
4734
4814
|
};
|
4735
4815
|
|
4816
|
+
/**
|
4817
|
+
* @interface
|
4818
|
+
* Define the {@link https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads file download rules} and domain-based api injection rules.
|
4819
|
+
*/
|
4820
|
+
declare type DomainSettings = {
|
4821
|
+
rules: DomainSettingsRule[];
|
4822
|
+
};
|
4823
|
+
|
4824
|
+
/**
|
4825
|
+
* @interface
|
4826
|
+
*/
|
4827
|
+
declare type DomainSettingsRule = {
|
4828
|
+
match: string[];
|
4829
|
+
options: {
|
4830
|
+
downloadSettings?: FileDownloadSettings;
|
4831
|
+
api?: ApiInjection;
|
4832
|
+
};
|
4833
|
+
};
|
4834
|
+
|
4736
4835
|
/**
|
4737
4836
|
* Metadata returned from a preload script download request.
|
4738
4837
|
*
|
@@ -4777,14 +4876,24 @@ declare type DownloadRule = {
|
|
4777
4876
|
* @interface
|
4778
4877
|
*
|
4779
4878
|
* Controls the styling and behavior of the window download shelf.
|
4879
|
+
*
|
4880
|
+
* @remarks This will control the styling for the download shelf regardless of whether its display was
|
4881
|
+
* triggered by the window itself, or a view targeting the window.
|
4780
4882
|
*/
|
4781
4883
|
declare type DownloadShelfOptions = {
|
4782
4884
|
/**
|
4783
|
-
* Whether downloads in this window trigger
|
4885
|
+
* Whether downloads in this window trigger display of the download shelf.
|
4886
|
+
*
|
4887
|
+
* @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
|
4888
|
+
* with `downloadShelf: { enabled: true }` initiates a download.
|
4784
4889
|
*/
|
4785
4890
|
enabled: boolean;
|
4786
4891
|
/**
|
4787
4892
|
* Styling options for the download shelf border.
|
4893
|
+
*
|
4894
|
+
* @remarks These apply regardless of whether download shelf display was
|
4895
|
+
* triggered by this window itself, or a view targeting the window. Individual views
|
4896
|
+
* cannot control the rendering of their parent window's download shelf.
|
4788
4897
|
*/
|
4789
4898
|
border?: {
|
4790
4899
|
/**
|
@@ -6638,6 +6747,11 @@ declare type InitPlatformOptions = {
|
|
6638
6747
|
interopOverride?: OverrideCallback<InteropBroker> | ConstructorOverride<InteropBroker>[];
|
6639
6748
|
};
|
6640
6749
|
|
6750
|
+
/**
|
6751
|
+
* * 'none': The `fin` API will be not available from within this context.
|
6752
|
+
* * 'global': The entire `fin` API will be available from within this context.
|
6753
|
+
* @defaultValue 'global'
|
6754
|
+
*/
|
6641
6755
|
declare type InjectionType = 'none' | 'global';
|
6642
6756
|
|
6643
6757
|
/**
|
@@ -9090,7 +9204,7 @@ declare type LayoutOptions = {
|
|
9090
9204
|
declare type LayoutPosition = 'top' | 'bottom' | 'left' | 'right';
|
9091
9205
|
|
9092
9206
|
/**
|
9093
|
-
*
|
9207
|
+
* Layout preset type.
|
9094
9208
|
*/
|
9095
9209
|
declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
|
9096
9210
|
|
@@ -10154,11 +10268,15 @@ declare namespace OpenFin_2 {
|
|
10154
10268
|
ClosedMenuResult,
|
10155
10269
|
MenuResult,
|
10156
10270
|
ShowPopupMenuOptions,
|
10271
|
+
ShowTrayIconPopupMenuOptions,
|
10157
10272
|
MenuItemTemplate,
|
10158
10273
|
NativeWindowIntegrationProviderAuthorization,
|
10159
10274
|
RuntimeInfo,
|
10160
10275
|
DefaultDomainSettings,
|
10161
10276
|
DefaultDomainSettingsRule,
|
10277
|
+
DomainSettings,
|
10278
|
+
ApiInjection,
|
10279
|
+
DomainSettingsRule,
|
10162
10280
|
FileDownloadBehaviorNames,
|
10163
10281
|
FileDownloadSettings,
|
10164
10282
|
DownloadRule,
|
@@ -13467,6 +13585,23 @@ declare type ShowRequestedEvent = BaseEvent_5 & {
|
|
13467
13585
|
type: 'show-requested';
|
13468
13586
|
};
|
13469
13587
|
|
13588
|
+
/**
|
13589
|
+
* Options for showing a tray icon popup menu
|
13590
|
+
*
|
13591
|
+
* @typeParam Data User-defined shape for data returned upon menu item click. Should be a
|
13592
|
+
* [union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types)
|
13593
|
+
* of all possible data shapes for the entire menu, and the click handler should process
|
13594
|
+
* these with a "reducer" pattern.
|
13595
|
+
*
|
13596
|
+
* @interface
|
13597
|
+
*/
|
13598
|
+
declare type ShowTrayIconPopupMenuOptions<Data extends unknown = unknown> = {
|
13599
|
+
/**
|
13600
|
+
* An array describing the menu to show.
|
13601
|
+
*/
|
13602
|
+
template: MenuItemTemplate<Data>[];
|
13603
|
+
};
|
13604
|
+
|
13470
13605
|
/**
|
13471
13606
|
* _Platform Windows Only_. Enables views to be shown when a Platform Window is being resized by the user.
|
13472
13607
|
*
|
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;
|