@openfin/core 35.78.29 → 35.79.2

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.
@@ -97,9 +97,9 @@ declare type Api = {
97
97
  enableDeprecatedSharedName?: boolean;
98
98
  };
99
99
  /**
100
- * Prevent fin API injection. If true `fin` won't be available in this context.
100
+ * Prevent fin API injection. If 'none', `fin` won't be available in this context.
101
101
  */
102
- preventInjection?: boolean;
102
+ fin?: InjectionType;
103
103
  };
104
104
 
105
105
  declare type ApiCall<Request, Response> = {
@@ -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
@@ -1178,10 +1185,13 @@ declare type ApplicationOptions = LegacyWinOptionsInAppOptions & {
1178
1185
  */
1179
1186
  apiDiagnostics: boolean;
1180
1187
  /**
1181
- * Define the file download rules.
1182
- * See [here](https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads) for more details.
1188
+ * @deprecated Please use {@link domainSettings} instead
1183
1189
  */
1184
1190
  defaultDomainSettings: DefaultDomainSettings;
1191
+ /**
1192
+ * 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.
1193
+ */
1194
+ domainSettings: DomainSettings;
1185
1195
  /**
1186
1196
  * @defaultValue false
1187
1197
  *
@@ -3476,9 +3486,13 @@ declare type ConstViewOptions = {
3476
3486
  /**
3477
3487
  * Controls interaction of the view with its parent window's download shelf.
3478
3488
  */
3479
- downloadShelf?: {
3489
+ downloadShelf: {
3480
3490
  /**
3481
- * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3491
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
3492
+ *
3493
+ * @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
3494
+ * on the parent window even if that parent window's {@link DownloadShelfOptions} specify
3495
+ * `enabled: false`.
3482
3496
  */
3483
3497
  enabled: boolean;
3484
3498
  };
@@ -3594,6 +3608,12 @@ declare type ConstWindowOptions = {
3594
3608
  * launches in favor of the cached value.
3595
3609
  */
3596
3610
  defaultWidth: number;
3611
+ /**
3612
+ * Controls the styling and behavior of the window download shelf.
3613
+ *
3614
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
3615
+ * triggered by the window itself, or a view targeting the window.
3616
+ */
3597
3617
  downloadShelf: DownloadShelfOptions;
3598
3618
  height: number;
3599
3619
  layout: any;
@@ -4431,21 +4451,15 @@ declare type CustomRequestHeaders = {
4431
4451
  declare type DataChannelReadyState = RTCDataChannel['readyState'];
4432
4452
 
4433
4453
  /**
4454
+ * @deprecated Use {@link OpenFin.DomainSettings} instead.
4434
4455
  * @interface
4435
4456
  */
4436
- declare type DefaultDomainSettings = {
4437
- rules: DefaultDomainSettingsRule[];
4438
- };
4457
+ declare type DefaultDomainSettings = DomainSettings;
4439
4458
 
4440
4459
  /**
4441
- * @interface
4460
+ * @deprecated Use {@link OpenFin.DomainSettingsRule} instead.
4442
4461
  */
4443
- declare type DefaultDomainSettingsRule = {
4444
- match: string[];
4445
- options: {
4446
- downloadSettings: FileDownloadSettings;
4447
- };
4448
- };
4462
+ declare type DefaultDomainSettingsRule = DomainSettingsRule;
4449
4463
 
4450
4464
  declare interface DesktopAgent {
4451
4465
  open(app: TargetApp, context?: Context): Promise<void>;
@@ -4690,6 +4704,25 @@ declare type DisplayMetadata_3 = {
4690
4704
  readonly glyph?: string;
4691
4705
  };
4692
4706
 
4707
+ /**
4708
+ * @interface
4709
+ * 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.
4710
+ */
4711
+ declare type DomainSettings = {
4712
+ rules: DomainSettingsRule[];
4713
+ };
4714
+
4715
+ /**
4716
+ * @interface
4717
+ */
4718
+ declare type DomainSettingsRule = {
4719
+ match: string[];
4720
+ options: {
4721
+ downloadSettings?: FileDownloadSettings;
4722
+ api?: ApiInjection;
4723
+ };
4724
+ };
4725
+
4693
4726
  /**
4694
4727
  * Metadata returned from a preload script download request.
4695
4728
  *
@@ -4734,14 +4767,24 @@ declare type DownloadRule = {
4734
4767
  * @interface
4735
4768
  *
4736
4769
  * Controls the styling and behavior of the window download shelf.
4770
+ *
4771
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
4772
+ * triggered by the window itself, or a view targeting the window.
4737
4773
  */
4738
4774
  declare type DownloadShelfOptions = {
4739
4775
  /**
4740
- * Whether downloads in this window trigger opening the download shelf.
4776
+ * Whether downloads in this window trigger display of the download shelf.
4777
+ *
4778
+ * @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
4779
+ * with `downloadShelf: { enabled: true }` initiates a download.
4741
4780
  */
4742
4781
  enabled: boolean;
4743
4782
  /**
4744
4783
  * Styling options for the download shelf border.
4784
+ *
4785
+ * @remarks These apply regardless of whether download shelf display was
4786
+ * triggered by this window itself, or a view targeting the window. Individual views
4787
+ * cannot control the rendering of their parent window's download shelf.
4745
4788
  */
4746
4789
  border?: {
4747
4790
  /**
@@ -4751,7 +4794,7 @@ declare type DownloadShelfOptions = {
4751
4794
  */
4752
4795
  size?: number;
4753
4796
  /**
4754
- * Color of the border, either a string name or a hex code. Defaults to chromium theme
4797
+ * Color of the border. Must be a 6-character hex code prefixed by #. Defaults to chromium theme
4755
4798
  * if absent.
4756
4799
  */
4757
4800
  color?: string;
@@ -4971,6 +5014,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
4971
5014
 
4972
5015
  declare interface Environment {
4973
5016
  initLayoutManager(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
5017
+ applyLayoutSnapshot(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.InitLayoutOptions): Promise<void>;
4974
5018
  createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
4975
5019
  destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
4976
5020
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
@@ -6560,6 +6604,13 @@ declare type InitPlatformOptions = {
6560
6604
  interopOverride?: OverrideCallback<InteropBroker> | ConstructorOverride<InteropBroker>[];
6561
6605
  };
6562
6606
 
6607
+ /**
6608
+ * * 'none': The `fin` API will be not available from within this context.
6609
+ * * 'global': The entire `fin` API will be available from within this context.
6610
+ * @defaultValue 'global'
6611
+ */
6612
+ declare type InjectionType = 'none' | 'global';
6613
+
6563
6614
  /**
6564
6615
  * Generated when the value of the element changes.
6565
6616
  * @interface
@@ -7404,8 +7455,6 @@ declare type InteropBrokerOptions = {
7404
7455
  };
7405
7456
 
7406
7457
  /**
7407
- * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
7408
- *
7409
7458
  * The Interop Client API is broken up into two groups:
7410
7459
  *
7411
7460
  * **Content Facing APIs** - For Application Developers putting Views into a Platform Window, who care about Context. These are APIs that send out and receive the Context data that flows between applications. Think of this as the Water in the Interop Pipes.
@@ -7808,7 +7857,7 @@ declare class InteropClient extends Base {
7808
7857
  * ```
7809
7858
  */
7810
7859
  onDisconnection(listener: OpenFin_2.InteropClientOnDisconnectionListener): Promise<void>;
7811
- static ferryFdc3Call(interopClient: OpenFin_2.InteropClient, action: string, payload?: any): Promise<any>;
7860
+ /* Excluded from this release type: ferryFdc3Call */
7812
7861
  }
7813
7862
 
7814
7863
  /**
@@ -8447,16 +8496,17 @@ declare type LayoutIdentity = Identity_5 & {
8447
8496
  };
8448
8497
 
8449
8498
  /**
8450
- * Generated when the window is created, and all of its layout's views have either finished or failed
8451
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8499
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8500
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8452
8501
  * @interface
8453
8502
  */
8454
8503
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8455
8504
  type: 'layout-initialized';
8456
8505
  layoutIdentity: OpenFin_2.LayoutIdentity;
8457
- ofViews: (OpenFin_2.Identity & {
8506
+ ofViews: {
8507
+ identity: OpenFin_2.Identity;
8458
8508
  entityType: 'view';
8459
- })[];
8509
+ }[];
8460
8510
  };
8461
8511
 
8462
8512
  /**
@@ -8813,7 +8863,7 @@ declare type LayoutOptions = {
8813
8863
  declare type LayoutPosition = 'top' | 'bottom' | 'left' | 'right';
8814
8864
 
8815
8865
  /**
8816
- * @interface
8866
+ * Layout preset type.
8817
8867
  */
8818
8868
  declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8819
8869
 
@@ -8824,9 +8874,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8824
8874
  declare type LayoutReadyEvent = BaseEvent_5 & {
8825
8875
  type: 'layout-ready';
8826
8876
  layoutIdentity: OpenFin_2.LayoutIdentity;
8827
- views: (OpenFin_2.Identity & {
8877
+ views: {
8878
+ identity: OpenFin_2.Identity;
8828
8879
  success: boolean;
8829
- })[];
8880
+ error?: Error;
8881
+ }[];
8830
8882
  };
8831
8883
 
8832
8884
  /**
@@ -9528,7 +9580,7 @@ declare type MutableWindowOptions = {
9528
9580
  showTaskbarIcon: boolean;
9529
9581
  interop: InteropConfig;
9530
9582
  /* Excluded from this release type: _internalWorkspaceData */
9531
- workspacePlatform: unknown;
9583
+ /* Excluded from this release type: workspacePlatform */
9532
9584
  };
9533
9585
 
9534
9586
  declare type NackHandler = (payloadOrMessage: RuntimeErrorPayload | string) => void;
@@ -9716,6 +9768,7 @@ declare namespace OpenFin_2 {
9716
9768
  ResizeRegion,
9717
9769
  Accelerator,
9718
9770
  Api,
9771
+ InjectionType,
9719
9772
  NavigationRules,
9720
9773
  ContentNavigation,
9721
9774
  ContentRedirect,
@@ -9863,6 +9916,9 @@ declare namespace OpenFin_2 {
9863
9916
  RuntimeInfo,
9864
9917
  DefaultDomainSettings,
9865
9918
  DefaultDomainSettingsRule,
9919
+ DomainSettings,
9920
+ ApiInjection,
9921
+ DomainSettingsRule,
9866
9922
  FileDownloadBehaviorNames,
9867
9923
  FileDownloadSettings,
9868
9924
  DownloadRule,
@@ -97,9 +97,9 @@ declare type Api = {
97
97
  enableDeprecatedSharedName?: boolean;
98
98
  };
99
99
  /**
100
- * Prevent fin API injection. If true `fin` won't be available in this context.
100
+ * Prevent fin API injection. If 'none', `fin` won't be available in this context.
101
101
  */
102
- preventInjection?: boolean;
102
+ fin?: InjectionType;
103
103
  };
104
104
 
105
105
  declare type ApiCall<Request, Response> = {
@@ -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
@@ -1178,10 +1185,13 @@ declare type ApplicationOptions = LegacyWinOptionsInAppOptions & {
1178
1185
  */
1179
1186
  apiDiagnostics: boolean;
1180
1187
  /**
1181
- * Define the file download rules.
1182
- * See [here](https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads) for more details.
1188
+ * @deprecated Please use {@link domainSettings} instead
1183
1189
  */
1184
1190
  defaultDomainSettings: DefaultDomainSettings;
1191
+ /**
1192
+ * 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.
1193
+ */
1194
+ domainSettings: DomainSettings;
1185
1195
  /**
1186
1196
  * @defaultValue false
1187
1197
  *
@@ -3476,9 +3486,13 @@ declare type ConstViewOptions = {
3476
3486
  /**
3477
3487
  * Controls interaction of the view with its parent window's download shelf.
3478
3488
  */
3479
- downloadShelf?: {
3489
+ downloadShelf: {
3480
3490
  /**
3481
- * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3491
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
3492
+ *
3493
+ * @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
3494
+ * on the parent window even if that parent window's {@link DownloadShelfOptions} specify
3495
+ * `enabled: false`.
3482
3496
  */
3483
3497
  enabled: boolean;
3484
3498
  };
@@ -3594,6 +3608,12 @@ declare type ConstWindowOptions = {
3594
3608
  * launches in favor of the cached value.
3595
3609
  */
3596
3610
  defaultWidth: number;
3611
+ /**
3612
+ * Controls the styling and behavior of the window download shelf.
3613
+ *
3614
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
3615
+ * triggered by the window itself, or a view targeting the window.
3616
+ */
3597
3617
  downloadShelf: DownloadShelfOptions;
3598
3618
  height: number;
3599
3619
  layout: any;
@@ -4431,21 +4451,15 @@ declare type CustomRequestHeaders = {
4431
4451
  declare type DataChannelReadyState = RTCDataChannel['readyState'];
4432
4452
 
4433
4453
  /**
4454
+ * @deprecated Use {@link OpenFin.DomainSettings} instead.
4434
4455
  * @interface
4435
4456
  */
4436
- declare type DefaultDomainSettings = {
4437
- rules: DefaultDomainSettingsRule[];
4438
- };
4457
+ declare type DefaultDomainSettings = DomainSettings;
4439
4458
 
4440
4459
  /**
4441
- * @interface
4460
+ * @deprecated Use {@link OpenFin.DomainSettingsRule} instead.
4442
4461
  */
4443
- declare type DefaultDomainSettingsRule = {
4444
- match: string[];
4445
- options: {
4446
- downloadSettings: FileDownloadSettings;
4447
- };
4448
- };
4462
+ declare type DefaultDomainSettingsRule = DomainSettingsRule;
4449
4463
 
4450
4464
  declare interface DesktopAgent {
4451
4465
  open(app: TargetApp, context?: Context): Promise<void>;
@@ -4690,6 +4704,25 @@ declare type DisplayMetadata_3 = {
4690
4704
  readonly glyph?: string;
4691
4705
  };
4692
4706
 
4707
+ /**
4708
+ * @interface
4709
+ * 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.
4710
+ */
4711
+ declare type DomainSettings = {
4712
+ rules: DomainSettingsRule[];
4713
+ };
4714
+
4715
+ /**
4716
+ * @interface
4717
+ */
4718
+ declare type DomainSettingsRule = {
4719
+ match: string[];
4720
+ options: {
4721
+ downloadSettings?: FileDownloadSettings;
4722
+ api?: ApiInjection;
4723
+ };
4724
+ };
4725
+
4693
4726
  /**
4694
4727
  * Metadata returned from a preload script download request.
4695
4728
  *
@@ -4734,14 +4767,24 @@ declare type DownloadRule = {
4734
4767
  * @interface
4735
4768
  *
4736
4769
  * Controls the styling and behavior of the window download shelf.
4770
+ *
4771
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
4772
+ * triggered by the window itself, or a view targeting the window.
4737
4773
  */
4738
4774
  declare type DownloadShelfOptions = {
4739
4775
  /**
4740
- * Whether downloads in this window trigger opening the download shelf.
4776
+ * Whether downloads in this window trigger display of the download shelf.
4777
+ *
4778
+ * @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
4779
+ * with `downloadShelf: { enabled: true }` initiates a download.
4741
4780
  */
4742
4781
  enabled: boolean;
4743
4782
  /**
4744
4783
  * Styling options for the download shelf border.
4784
+ *
4785
+ * @remarks These apply regardless of whether download shelf display was
4786
+ * triggered by this window itself, or a view targeting the window. Individual views
4787
+ * cannot control the rendering of their parent window's download shelf.
4745
4788
  */
4746
4789
  border?: {
4747
4790
  /**
@@ -4751,7 +4794,7 @@ declare type DownloadShelfOptions = {
4751
4794
  */
4752
4795
  size?: number;
4753
4796
  /**
4754
- * Color of the border, either a string name or a hex code. Defaults to chromium theme
4797
+ * Color of the border. Must be a 6-character hex code prefixed by #. Defaults to chromium theme
4755
4798
  * if absent.
4756
4799
  */
4757
4800
  color?: string;
@@ -4971,6 +5014,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
4971
5014
 
4972
5015
  declare interface Environment {
4973
5016
  initLayoutManager(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
5017
+ applyLayoutSnapshot(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.InitLayoutOptions): Promise<void>;
4974
5018
  createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
4975
5019
  destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
4976
5020
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
@@ -6560,6 +6604,13 @@ declare type InitPlatformOptions = {
6560
6604
  interopOverride?: OverrideCallback<InteropBroker> | ConstructorOverride<InteropBroker>[];
6561
6605
  };
6562
6606
 
6607
+ /**
6608
+ * * 'none': The `fin` API will be not available from within this context.
6609
+ * * 'global': The entire `fin` API will be available from within this context.
6610
+ * @defaultValue 'global'
6611
+ */
6612
+ declare type InjectionType = 'none' | 'global';
6613
+
6563
6614
  /**
6564
6615
  * Generated when the value of the element changes.
6565
6616
  * @interface
@@ -7404,8 +7455,6 @@ declare type InteropBrokerOptions = {
7404
7455
  };
7405
7456
 
7406
7457
  /**
7407
- * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
7408
- *
7409
7458
  * The Interop Client API is broken up into two groups:
7410
7459
  *
7411
7460
  * **Content Facing APIs** - For Application Developers putting Views into a Platform Window, who care about Context. These are APIs that send out and receive the Context data that flows between applications. Think of this as the Water in the Interop Pipes.
@@ -7808,7 +7857,7 @@ declare class InteropClient extends Base {
7808
7857
  * ```
7809
7858
  */
7810
7859
  onDisconnection(listener: OpenFin_2.InteropClientOnDisconnectionListener): Promise<void>;
7811
- static ferryFdc3Call(interopClient: OpenFin_2.InteropClient, action: string, payload?: any): Promise<any>;
7860
+ /* Excluded from this release type: ferryFdc3Call */
7812
7861
  }
7813
7862
 
7814
7863
  /**
@@ -8447,16 +8496,17 @@ declare type LayoutIdentity = Identity_5 & {
8447
8496
  };
8448
8497
 
8449
8498
  /**
8450
- * Generated when the window is created, and all of its layout's views have either finished or failed
8451
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8499
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8500
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8452
8501
  * @interface
8453
8502
  */
8454
8503
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8455
8504
  type: 'layout-initialized';
8456
8505
  layoutIdentity: OpenFin_2.LayoutIdentity;
8457
- ofViews: (OpenFin_2.Identity & {
8506
+ ofViews: {
8507
+ identity: OpenFin_2.Identity;
8458
8508
  entityType: 'view';
8459
- })[];
8509
+ }[];
8460
8510
  };
8461
8511
 
8462
8512
  /**
@@ -8813,7 +8863,7 @@ declare type LayoutOptions = {
8813
8863
  declare type LayoutPosition = 'top' | 'bottom' | 'left' | 'right';
8814
8864
 
8815
8865
  /**
8816
- * @interface
8866
+ * Layout preset type.
8817
8867
  */
8818
8868
  declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8819
8869
 
@@ -8824,9 +8874,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8824
8874
  declare type LayoutReadyEvent = BaseEvent_5 & {
8825
8875
  type: 'layout-ready';
8826
8876
  layoutIdentity: OpenFin_2.LayoutIdentity;
8827
- views: (OpenFin_2.Identity & {
8877
+ views: {
8878
+ identity: OpenFin_2.Identity;
8828
8879
  success: boolean;
8829
- })[];
8880
+ error?: Error;
8881
+ }[];
8830
8882
  };
8831
8883
 
8832
8884
  /**
@@ -9528,7 +9580,7 @@ declare type MutableWindowOptions = {
9528
9580
  showTaskbarIcon: boolean;
9529
9581
  interop: InteropConfig;
9530
9582
  /* Excluded from this release type: _internalWorkspaceData */
9531
- workspacePlatform: unknown;
9583
+ /* Excluded from this release type: workspacePlatform */
9532
9584
  };
9533
9585
 
9534
9586
  declare type NackHandler = (payloadOrMessage: RuntimeErrorPayload | string) => void;
@@ -9716,6 +9768,7 @@ declare namespace OpenFin_2 {
9716
9768
  ResizeRegion,
9717
9769
  Accelerator,
9718
9770
  Api,
9771
+ InjectionType,
9719
9772
  NavigationRules,
9720
9773
  ContentNavigation,
9721
9774
  ContentRedirect,
@@ -9863,6 +9916,9 @@ declare namespace OpenFin_2 {
9863
9916
  RuntimeInfo,
9864
9917
  DefaultDomainSettings,
9865
9918
  DefaultDomainSettingsRule,
9919
+ DomainSettings,
9920
+ ApiInjection,
9921
+ DomainSettingsRule,
9866
9922
  FileDownloadBehaviorNames,
9867
9923
  FileDownloadSettings,
9868
9924
  DownloadRule,
@@ -97,9 +97,9 @@ declare type Api = {
97
97
  enableDeprecatedSharedName?: boolean;
98
98
  };
99
99
  /**
100
- * Prevent fin API injection. If true `fin` won't be available in this context.
100
+ * Prevent fin API injection. If 'none', `fin` won't be available in this context.
101
101
  */
102
- preventInjection?: boolean;
102
+ fin?: InjectionType;
103
103
  };
104
104
 
105
105
  declare type ApiCall<Request, Response> = {
@@ -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
@@ -1178,10 +1185,13 @@ declare type ApplicationOptions = LegacyWinOptionsInAppOptions & {
1178
1185
  */
1179
1186
  apiDiagnostics: boolean;
1180
1187
  /**
1181
- * Define the file download rules.
1182
- * See [here](https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads) for more details.
1188
+ * @deprecated Please use {@link domainSettings} instead
1183
1189
  */
1184
1190
  defaultDomainSettings: DefaultDomainSettings;
1191
+ /**
1192
+ * 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.
1193
+ */
1194
+ domainSettings: DomainSettings;
1185
1195
  /**
1186
1196
  * @defaultValue false
1187
1197
  *
@@ -3476,9 +3486,13 @@ declare type ConstViewOptions = {
3476
3486
  /**
3477
3487
  * Controls interaction of the view with its parent window's download shelf.
3478
3488
  */
3479
- downloadShelf?: {
3489
+ downloadShelf: {
3480
3490
  /**
3481
- * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3491
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
3492
+ *
3493
+ * @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
3494
+ * on the parent window even if that parent window's {@link DownloadShelfOptions} specify
3495
+ * `enabled: false`.
3482
3496
  */
3483
3497
  enabled: boolean;
3484
3498
  };
@@ -3594,6 +3608,12 @@ declare type ConstWindowOptions = {
3594
3608
  * launches in favor of the cached value.
3595
3609
  */
3596
3610
  defaultWidth: number;
3611
+ /**
3612
+ * Controls the styling and behavior of the window download shelf.
3613
+ *
3614
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
3615
+ * triggered by the window itself, or a view targeting the window.
3616
+ */
3597
3617
  downloadShelf: DownloadShelfOptions;
3598
3618
  height: number;
3599
3619
  layout: any;
@@ -4431,21 +4451,15 @@ declare type CustomRequestHeaders = {
4431
4451
  declare type DataChannelReadyState = RTCDataChannel['readyState'];
4432
4452
 
4433
4453
  /**
4454
+ * @deprecated Use {@link OpenFin.DomainSettings} instead.
4434
4455
  * @interface
4435
4456
  */
4436
- declare type DefaultDomainSettings = {
4437
- rules: DefaultDomainSettingsRule[];
4438
- };
4457
+ declare type DefaultDomainSettings = DomainSettings;
4439
4458
 
4440
4459
  /**
4441
- * @interface
4460
+ * @deprecated Use {@link OpenFin.DomainSettingsRule} instead.
4442
4461
  */
4443
- declare type DefaultDomainSettingsRule = {
4444
- match: string[];
4445
- options: {
4446
- downloadSettings: FileDownloadSettings;
4447
- };
4448
- };
4462
+ declare type DefaultDomainSettingsRule = DomainSettingsRule;
4449
4463
 
4450
4464
  declare interface DesktopAgent {
4451
4465
  open(app: TargetApp, context?: Context): Promise<void>;
@@ -4690,6 +4704,25 @@ declare type DisplayMetadata_3 = {
4690
4704
  readonly glyph?: string;
4691
4705
  };
4692
4706
 
4707
+ /**
4708
+ * @interface
4709
+ * 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.
4710
+ */
4711
+ declare type DomainSettings = {
4712
+ rules: DomainSettingsRule[];
4713
+ };
4714
+
4715
+ /**
4716
+ * @interface
4717
+ */
4718
+ declare type DomainSettingsRule = {
4719
+ match: string[];
4720
+ options: {
4721
+ downloadSettings?: FileDownloadSettings;
4722
+ api?: ApiInjection;
4723
+ };
4724
+ };
4725
+
4693
4726
  /**
4694
4727
  * Metadata returned from a preload script download request.
4695
4728
  *
@@ -4734,14 +4767,24 @@ declare type DownloadRule = {
4734
4767
  * @interface
4735
4768
  *
4736
4769
  * Controls the styling and behavior of the window download shelf.
4770
+ *
4771
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
4772
+ * triggered by the window itself, or a view targeting the window.
4737
4773
  */
4738
4774
  declare type DownloadShelfOptions = {
4739
4775
  /**
4740
- * Whether downloads in this window trigger opening the download shelf.
4776
+ * Whether downloads in this window trigger display of the download shelf.
4777
+ *
4778
+ * @remarks Setting this to false will *not* prevent the download shelf from opening if a child view
4779
+ * with `downloadShelf: { enabled: true }` initiates a download.
4741
4780
  */
4742
4781
  enabled: boolean;
4743
4782
  /**
4744
4783
  * Styling options for the download shelf border.
4784
+ *
4785
+ * @remarks These apply regardless of whether download shelf display was
4786
+ * triggered by this window itself, or a view targeting the window. Individual views
4787
+ * cannot control the rendering of their parent window's download shelf.
4745
4788
  */
4746
4789
  border?: {
4747
4790
  /**
@@ -4751,7 +4794,7 @@ declare type DownloadShelfOptions = {
4751
4794
  */
4752
4795
  size?: number;
4753
4796
  /**
4754
- * Color of the border, either a string name or a hex code. Defaults to chromium theme
4797
+ * Color of the border. Must be a 6-character hex code prefixed by #. Defaults to chromium theme
4755
4798
  * if absent.
4756
4799
  */
4757
4800
  color?: string;
@@ -4971,6 +5014,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
4971
5014
 
4972
5015
  declare interface Environment {
4973
5016
  initLayoutManager(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
5017
+ applyLayoutSnapshot(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.InitLayoutOptions): Promise<void>;
4974
5018
  createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
4975
5019
  destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
4976
5020
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
@@ -6560,6 +6604,13 @@ declare type InitPlatformOptions = {
6560
6604
  interopOverride?: OverrideCallback<InteropBroker> | ConstructorOverride<InteropBroker>[];
6561
6605
  };
6562
6606
 
6607
+ /**
6608
+ * * 'none': The `fin` API will be not available from within this context.
6609
+ * * 'global': The entire `fin` API will be available from within this context.
6610
+ * @defaultValue 'global'
6611
+ */
6612
+ declare type InjectionType = 'none' | 'global';
6613
+
6563
6614
  /**
6564
6615
  * Generated when the value of the element changes.
6565
6616
  * @interface
@@ -7404,8 +7455,6 @@ declare type InteropBrokerOptions = {
7404
7455
  };
7405
7456
 
7406
7457
  /**
7407
- * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
7408
- *
7409
7458
  * The Interop Client API is broken up into two groups:
7410
7459
  *
7411
7460
  * **Content Facing APIs** - For Application Developers putting Views into a Platform Window, who care about Context. These are APIs that send out and receive the Context data that flows between applications. Think of this as the Water in the Interop Pipes.
@@ -7808,7 +7857,7 @@ declare class InteropClient extends Base {
7808
7857
  * ```
7809
7858
  */
7810
7859
  onDisconnection(listener: OpenFin_2.InteropClientOnDisconnectionListener): Promise<void>;
7811
- static ferryFdc3Call(interopClient: OpenFin_2.InteropClient, action: string, payload?: any): Promise<any>;
7860
+ /* Excluded from this release type: ferryFdc3Call */
7812
7861
  }
7813
7862
 
7814
7863
  /**
@@ -8447,16 +8496,17 @@ declare type LayoutIdentity = Identity_5 & {
8447
8496
  };
8448
8497
 
8449
8498
  /**
8450
- * Generated when the window is created, and all of its layout's views have either finished or failed
8451
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8499
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8500
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8452
8501
  * @interface
8453
8502
  */
8454
8503
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8455
8504
  type: 'layout-initialized';
8456
8505
  layoutIdentity: OpenFin_2.LayoutIdentity;
8457
- ofViews: (OpenFin_2.Identity & {
8506
+ ofViews: {
8507
+ identity: OpenFin_2.Identity;
8458
8508
  entityType: 'view';
8459
- })[];
8509
+ }[];
8460
8510
  };
8461
8511
 
8462
8512
  /**
@@ -8813,7 +8863,7 @@ declare type LayoutOptions = {
8813
8863
  declare type LayoutPosition = 'top' | 'bottom' | 'left' | 'right';
8814
8864
 
8815
8865
  /**
8816
- * @interface
8866
+ * Layout preset type.
8817
8867
  */
8818
8868
  declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8819
8869
 
@@ -8824,9 +8874,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
8824
8874
  declare type LayoutReadyEvent = BaseEvent_5 & {
8825
8875
  type: 'layout-ready';
8826
8876
  layoutIdentity: OpenFin_2.LayoutIdentity;
8827
- views: (OpenFin_2.Identity & {
8877
+ views: {
8878
+ identity: OpenFin_2.Identity;
8828
8879
  success: boolean;
8829
- })[];
8880
+ error?: Error;
8881
+ }[];
8830
8882
  };
8831
8883
 
8832
8884
  /**
@@ -9528,7 +9580,7 @@ declare type MutableWindowOptions = {
9528
9580
  showTaskbarIcon: boolean;
9529
9581
  interop: InteropConfig;
9530
9582
  /* Excluded from this release type: _internalWorkspaceData */
9531
- workspacePlatform: unknown;
9583
+ /* Excluded from this release type: workspacePlatform */
9532
9584
  };
9533
9585
 
9534
9586
  declare type NackHandler = (payloadOrMessage: RuntimeErrorPayload | string) => void;
@@ -9716,6 +9768,7 @@ declare namespace OpenFin_2 {
9716
9768
  ResizeRegion,
9717
9769
  Accelerator,
9718
9770
  Api,
9771
+ InjectionType,
9719
9772
  NavigationRules,
9720
9773
  ContentNavigation,
9721
9774
  ContentRedirect,
@@ -9863,6 +9916,9 @@ declare namespace OpenFin_2 {
9863
9916
  RuntimeInfo,
9864
9917
  DefaultDomainSettings,
9865
9918
  DefaultDomainSettingsRule,
9919
+ DomainSettings,
9920
+ ApiInjection,
9921
+ DomainSettingsRule,
9866
9922
  FileDownloadBehaviorNames,
9867
9923
  FileDownloadSettings,
9868
9924
  DownloadRule,
package/out/mock.d.ts CHANGED
@@ -97,9 +97,9 @@ declare type Api = {
97
97
  enableDeprecatedSharedName?: boolean;
98
98
  };
99
99
  /**
100
- * Prevent fin API injection. If true `fin` won't be available in this context.
100
+ * Prevent fin API injection. If 'none', `fin` won't be available in this context.
101
101
  */
102
- preventInjection?: boolean;
102
+ fin?: InjectionType;
103
103
  };
104
104
 
105
105
  declare type ApiCall<Request, Response> = {
@@ -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
@@ -1184,10 +1191,13 @@ declare type ApplicationOptions = LegacyWinOptionsInAppOptions & {
1184
1191
  */
1185
1192
  apiDiagnostics: boolean;
1186
1193
  /**
1187
- * Define the file download rules.
1188
- * See [here](https://developers.openfin.co/of-docs/docs/file-download#manifest-properties-for-file-downloads) for more details.
1194
+ * @deprecated Please use {@link domainSettings} instead
1189
1195
  */
1190
1196
  defaultDomainSettings: DefaultDomainSettings;
1197
+ /**
1198
+ * 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.
1199
+ */
1200
+ domainSettings: DomainSettings;
1191
1201
  /**
1192
1202
  * @defaultValue false
1193
1203
  *
@@ -3519,9 +3529,13 @@ declare type ConstViewOptions = {
3519
3529
  /**
3520
3530
  * Controls interaction of the view with its parent window's download shelf.
3521
3531
  */
3522
- downloadShelf?: {
3532
+ downloadShelf: {
3523
3533
  /**
3524
- * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow
3534
+ * Whether downloads in this view trigger opening the download shelf on its parent BrowserWindow.
3535
+ *
3536
+ * @remarks If `enabled: true`, downloads from this view will cause the download shelf to display
3537
+ * on the parent window even if that parent window's {@link DownloadShelfOptions} specify
3538
+ * `enabled: false`.
3525
3539
  */
3526
3540
  enabled: boolean;
3527
3541
  };
@@ -3637,6 +3651,12 @@ declare type ConstWindowOptions = {
3637
3651
  * launches in favor of the cached value.
3638
3652
  */
3639
3653
  defaultWidth: number;
3654
+ /**
3655
+ * Controls the styling and behavior of the window download shelf.
3656
+ *
3657
+ * @remarks This will control the styling for the download shelf regardless of whether its display was
3658
+ * triggered by the window itself, or a view targeting the window.
3659
+ */
3640
3660
  downloadShelf: DownloadShelfOptions;
3641
3661
  height: number;
3642
3662
  layout: any;
@@ -4474,21 +4494,15 @@ declare type CustomRequestHeaders = {
4474
4494
  declare type DataChannelReadyState = RTCDataChannel['readyState'];
4475
4495
 
4476
4496
  /**
4497
+ * @deprecated Use {@link OpenFin.DomainSettings} instead.
4477
4498
  * @interface
4478
4499
  */
4479
- declare type DefaultDomainSettings = {
4480
- rules: DefaultDomainSettingsRule[];
4481
- };
4500
+ declare type DefaultDomainSettings = DomainSettings;
4482
4501
 
4483
4502
  /**
4484
- * @interface
4503
+ * @deprecated Use {@link OpenFin.DomainSettingsRule} instead.
4485
4504
  */
4486
- declare type DefaultDomainSettingsRule = {
4487
- match: string[];
4488
- options: {
4489
- downloadSettings: FileDownloadSettings;
4490
- };
4491
- };
4505
+ declare type DefaultDomainSettingsRule = DomainSettingsRule;
4492
4506
 
4493
4507
  declare interface DesktopAgent {
4494
4508
  open(app: TargetApp, context?: Context): Promise<void>;
@@ -4733,6 +4747,25 @@ declare type DisplayMetadata_3 = {
4733
4747
  readonly glyph?: string;
4734
4748
  };
4735
4749
 
4750
+ /**
4751
+ * @interface
4752
+ * 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.
4753
+ */
4754
+ declare type DomainSettings = {
4755
+ rules: DomainSettingsRule[];
4756
+ };
4757
+
4758
+ /**
4759
+ * @interface
4760
+ */
4761
+ declare type DomainSettingsRule = {
4762
+ match: string[];
4763
+ options: {
4764
+ downloadSettings?: FileDownloadSettings;
4765
+ api?: ApiInjection;
4766
+ };
4767
+ };
4768
+
4736
4769
  /**
4737
4770
  * Metadata returned from a preload script download request.
4738
4771
  *
@@ -4777,14 +4810,24 @@ declare type DownloadRule = {
4777
4810
  * @interface
4778
4811
  *
4779
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.
4780
4816
  */
4781
4817
  declare type DownloadShelfOptions = {
4782
4818
  /**
4783
- * Whether downloads in this window trigger opening the download shelf.
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.
4784
4823
  */
4785
4824
  enabled: boolean;
4786
4825
  /**
4787
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.
4788
4831
  */
4789
4832
  border?: {
4790
4833
  /**
@@ -4794,7 +4837,7 @@ declare type DownloadShelfOptions = {
4794
4837
  */
4795
4838
  size?: number;
4796
4839
  /**
4797
- * Color of the border, either a string name or a hex code. Defaults to chromium theme
4840
+ * Color of the border. Must be a 6-character hex code prefixed by #. Defaults to chromium theme
4798
4841
  * if absent.
4799
4842
  */
4800
4843
  color?: string;
@@ -5019,6 +5062,7 @@ declare type EntityTypeHelpers<T extends EntityType_2> = T extends 'view' ? {
5019
5062
 
5020
5063
  declare interface Environment {
5021
5064
  initLayoutManager(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, wire: Transport, options: OpenFin_2.InitLayoutOptions): Promise<OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>>;
5065
+ applyLayoutSnapshot(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.InitLayoutOptions): Promise<void>;
5022
5066
  createLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, options: OpenFin_2.CreateLayoutOptions): Promise<void>;
5023
5067
  destroyLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<void>;
5024
5068
  resolveLayout(layoutManager: OpenFin_2.LayoutManager<OpenFin_2.LayoutSnapshot>, layoutIdentity: OpenFin_2.LayoutIdentity): Promise<any>;
@@ -6638,6 +6682,13 @@ declare type InitPlatformOptions = {
6638
6682
  interopOverride?: OverrideCallback<InteropBroker> | ConstructorOverride<InteropBroker>[];
6639
6683
  };
6640
6684
 
6685
+ /**
6686
+ * * 'none': The `fin` API will be not available from within this context.
6687
+ * * 'global': The entire `fin` API will be available from within this context.
6688
+ * @defaultValue 'global'
6689
+ */
6690
+ declare type InjectionType = 'none' | 'global';
6691
+
6641
6692
  /**
6642
6693
  * Generated when the value of the element changes.
6643
6694
  * @interface
@@ -7497,8 +7548,6 @@ declare type InteropBrokerOptions = {
7497
7548
  };
7498
7549
 
7499
7550
  /**
7500
- * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
7501
- *
7502
7551
  * The Interop Client API is broken up into two groups:
7503
7552
  *
7504
7553
  * **Content Facing APIs** - For Application Developers putting Views into a Platform Window, who care about Context. These are APIs that send out and receive the Context data that flows between applications. Think of this as the Water in the Interop Pipes.
@@ -7904,6 +7953,11 @@ declare class InteropClient extends Base {
7904
7953
  * ```
7905
7954
  */
7906
7955
  onDisconnection(listener: OpenFin_2.InteropClientOnDisconnectionListener): Promise<void>;
7956
+ /**
7957
+ * @internal
7958
+ *
7959
+ * Used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
7960
+ */
7907
7961
  static ferryFdc3Call(interopClient: OpenFin_2.InteropClient, action: string, payload?: any): Promise<any>;
7908
7962
  }
7909
7963
 
@@ -8549,16 +8603,17 @@ declare type LayoutIdentity = Identity_5 & {
8549
8603
  };
8550
8604
 
8551
8605
  /**
8552
- * Generated when the window is created, and all of its layout's views have either finished or failed
8553
- * navigation, once per layout. Does not emit for any layouts added via Layout.create() call.
8606
+ * Generated after a layout is created and all of its views have either finished or failed navigation
8607
+ * once per layout. Does not emit for layouts created using Layout.replace() API.
8554
8608
  * @interface
8555
8609
  */
8556
8610
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8557
8611
  type: 'layout-initialized';
8558
8612
  layoutIdentity: OpenFin_2.LayoutIdentity;
8559
- ofViews: (OpenFin_2.Identity & {
8613
+ ofViews: {
8614
+ identity: OpenFin_2.Identity;
8560
8615
  entityType: 'view';
8561
- })[];
8616
+ }[];
8562
8617
  };
8563
8618
 
8564
8619
  /**
@@ -9085,7 +9140,7 @@ declare type LayoutOptions = {
9085
9140
  declare type LayoutPosition = 'top' | 'bottom' | 'left' | 'right';
9086
9141
 
9087
9142
  /**
9088
- * @interface
9143
+ * Layout preset type.
9089
9144
  */
9090
9145
  declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
9091
9146
 
@@ -9096,9 +9151,11 @@ declare type LayoutPresetType = 'columns' | 'grid' | 'rows' | 'tabs';
9096
9151
  declare type LayoutReadyEvent = BaseEvent_5 & {
9097
9152
  type: 'layout-ready';
9098
9153
  layoutIdentity: OpenFin_2.LayoutIdentity;
9099
- views: (OpenFin_2.Identity & {
9154
+ views: {
9155
+ identity: OpenFin_2.Identity;
9100
9156
  success: boolean;
9101
- })[];
9157
+ error?: Error;
9158
+ }[];
9102
9159
  };
9103
9160
 
9104
9161
  /**
@@ -9808,7 +9865,11 @@ declare type MutableWindowOptions = {
9808
9865
  * Used by Workspace to store custom data. Overwriting or modifying this field may impact the functionality of Workspace
9809
9866
  */
9810
9867
  _internalWorkspaceData: any;
9811
- workspacePlatform: unknown;
9868
+ /**
9869
+ * @internal
9870
+ * Used by workspace to stork platform specific options. Overwriting or modifying this field may impact the functionality of Workspace
9871
+ */
9872
+ workspacePlatform: WorkspacePlatformOptions;
9812
9873
  };
9813
9874
 
9814
9875
  declare type NackHandler = (payloadOrMessage: RuntimeErrorPayload | string) => void;
@@ -10006,6 +10067,7 @@ declare namespace OpenFin_2 {
10006
10067
  ResizeRegion,
10007
10068
  Accelerator,
10008
10069
  Api,
10070
+ InjectionType,
10009
10071
  NavigationRules,
10010
10072
  ContentNavigation,
10011
10073
  ContentRedirect,
@@ -10153,6 +10215,9 @@ declare namespace OpenFin_2 {
10153
10215
  RuntimeInfo,
10154
10216
  DefaultDomainSettings,
10155
10217
  DefaultDomainSettingsRule,
10218
+ DomainSettings,
10219
+ ApiInjection,
10220
+ DomainSettingsRule,
10156
10221
  FileDownloadBehaviorNames,
10157
10222
  FileDownloadSettings,
10158
10223
  DownloadRule,
package/out/mock.js CHANGED
@@ -8274,7 +8274,8 @@ function errorToPOJO(error) {
8274
8274
  stack: error.stack,
8275
8275
  name: error.name,
8276
8276
  message: error.message,
8277
- toString: error.toString
8277
+ // support the case where stack is empty or missing
8278
+ toString: () => error.stack || error.toString()
8278
8279
  };
8279
8280
  }
8280
8281
  errors.errorToPOJO = errorToPOJO;
@@ -11506,7 +11507,7 @@ const validate_1 = validate;
11506
11507
  const base_1$6 = base;
11507
11508
  const common_utils_1 = commonUtils;
11508
11509
  const layout_entities_1 = layoutEntities;
11509
- const layout_constants_1 = layout_constants;
11510
+ const layout_constants_1$1 = layout_constants;
11510
11511
  /**
11511
11512
  *
11512
11513
  * Layouts give app providers the ability to embed multiple views in a single window. The Layout namespace
@@ -11651,7 +11652,7 @@ class Layout extends base_1$6.Base {
11651
11652
  * Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
11652
11653
  * The client is for {@link LayoutEntitiesController}
11653
11654
  */
11654
- _Layout_layoutClient.set(this, new lazy_1.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1.LAYOUT_CONTROLLER_ID, this.identity)));
11655
+ _Layout_layoutClient.set(this, new lazy_1.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1$1.LAYOUT_CONTROLLER_ID, this.identity)));
11655
11656
  /**
11656
11657
  * Replaces a Platform window's layout with a new layout.
11657
11658
  *
@@ -11879,11 +11880,12 @@ var __classPrivateFieldSet$4 = (commonjsGlobal && commonjsGlobal.__classPrivateF
11879
11880
  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");
11880
11881
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
11881
11882
  };
11882
- var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getBackCompatLayoutManager, _LayoutModule_throwIfLayoutManagerNotInitialized;
11883
+ var _LayoutModule_instances, _LayoutModule_layoutInitializationAttempted, _LayoutModule_layoutManager, _LayoutModule_getSafeLayoutManager;
11883
11884
  Object.defineProperty(Factory$2, "__esModule", { value: true });
11884
11885
  Factory$2.LayoutModule = void 0;
11885
11886
  const base_1$5 = base;
11886
11887
  const Instance_1$2 = Instance$1;
11888
+ const layout_constants_1 = layout_constants;
11887
11889
  /**
11888
11890
  * Static namespace for OpenFin API methods that interact with the {@link Layout} class, available under `fin.Platform.Layout`.
11889
11891
  */
@@ -11932,7 +11934,7 @@ class LayoutModule extends base_1$5.Base {
11932
11934
  * ```
11933
11935
  */
11934
11936
  this.init = async (options = {}) => {
11935
- this.wire.sendAction('layout-init').catch((e) => {
11937
+ this.wire.sendAction('layout-init').catch(() => {
11936
11938
  // don't expose
11937
11939
  });
11938
11940
  if (!this.fin.me.isWindow) {
@@ -11942,54 +11944,30 @@ class LayoutModule extends base_1$5.Base {
11942
11944
  throw new Error('Layout.init was already called, please use Layout.create to add additional layouts.');
11943
11945
  }
11944
11946
  __classPrivateFieldSet$4(this, _LayoutModule_layoutInitializationAttempted, true, "f");
11947
+ // preload the client
11948
+ await this.fin.Platform.getCurrentSync().getClient();
11945
11949
  __classPrivateFieldSet$4(this, _LayoutModule_layoutManager, await this.wire.environment.initLayoutManager(this.fin, this.wire, options), "f");
11946
- // apply the initial snapshot which in turn will call fin.Platform.Layout.create()
11947
- const platformClient = await this.fin.Platform.getCurrentSync().getClient();
11948
- const snapshot = await platformClient.dispatch('get-initial-layout-snapshot');
11949
- await __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").applyLayoutSnapshot(snapshot);
11950
+ await this.wire.environment.applyLayoutSnapshot(this.fin, __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), options);
11950
11951
  if (!options.layoutManagerOverride) {
11951
- return __classPrivateFieldGet$4(this, _LayoutModule_getBackCompatLayoutManager, "f").call(this, this.fin);
11952
+ // in single-layout case, we return the undocumented layoutManager type (deprecate with CORE-1081)
11953
+ const layoutIdentity = { layoutName: layout_constants_1.DEFAULT_LAYOUT_KEY, ...this.fin.me.identity };
11954
+ const layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11955
+ return Object.assign(this.wrapSync(layoutIdentity), { layoutManager });
11952
11956
  }
11953
- // warn user if they do not call create() in the next 30 seconds
11954
- setTimeout(() => {
11955
- if (__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f").size() === 0) {
11956
- console.warn(`[Layout.init] Layout.init was called 30s ago, but no layouts have been created yet. Make sure you ` +
11957
- `override LayoutManager.applyLayoutSnapshot, and then call fin.Platform.Layout.create()`);
11958
- }
11959
- }, 30000);
11960
11957
  return this.wrapSync(this.fin.me.identity);
11961
11958
  };
11962
- _LayoutModule_getBackCompatLayoutManager.set(this, async (fin) => {
11963
- let layoutManager;
11964
- let resolve;
11965
- const layoutResolved = new Promise((r) => {
11966
- resolve = r;
11967
- });
11968
- // wait for a layout to be created
11969
- await fin.me.once('layout-ready', async ({ layoutIdentity }) => {
11970
- layoutManager = await this.wire.environment.resolveLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11971
- // Backward compat - undocumented / not typed openfin-layout as layoutManager
11972
- // TODO: eventually deprecate this
11973
- resolve(Object.assign(this.wrapSync(layoutIdentity), { layoutManager }));
11974
- });
11975
- return layoutResolved;
11976
- });
11977
11959
  /**
11978
11960
  * Returns the layout manager for the current window
11979
11961
  * @returns
11980
11962
  */
11981
11963
  this.getCurrentLayoutManagerSync = () => {
11982
- __classPrivateFieldGet$4(this, _LayoutModule_instances, "m", _LayoutModule_throwIfLayoutManagerNotInitialized).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
11983
- // @ts-expect-error User may have implemented their own snapshot type when overriding LayoutManager
11984
- return __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f");
11964
+ return __classPrivateFieldGet$4(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.getCurrentLayoutManagerSync()`);
11985
11965
  };
11986
11966
  this.create = async (options) => {
11987
- __classPrivateFieldGet$4(this, _LayoutModule_instances, "m", _LayoutModule_throwIfLayoutManagerNotInitialized).call(this, `fin.Platform.Layout.create()`);
11988
- return this.wire.environment.createLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), options);
11967
+ return this.wire.environment.createLayout(__classPrivateFieldGet$4(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.create()`), options);
11989
11968
  };
11990
11969
  this.destroy = async (layoutIdentity) => {
11991
- __classPrivateFieldGet$4(this, _LayoutModule_instances, "m", _LayoutModule_throwIfLayoutManagerNotInitialized).call(this, `fin.Platform.Layout.destroy()`);
11992
- return this.wire.environment.destroyLayout(__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f"), layoutIdentity);
11970
+ return this.wire.environment.destroyLayout(__classPrivateFieldGet$4(this, _LayoutModule_instances, "m", _LayoutModule_getSafeLayoutManager).call(this, `fin.Platform.Layout.destroy()`), layoutIdentity);
11993
11971
  };
11994
11972
  }
11995
11973
  /**
@@ -12012,7 +11990,7 @@ class LayoutModule extends base_1$5.Base {
12012
11990
  * ```
12013
11991
  */
12014
11992
  async wrap(identity) {
12015
- this.wire.sendAction('layout-wrap').catch((e) => {
11993
+ this.wire.sendAction('layout-wrap').catch(() => {
12016
11994
  // don't expose
12017
11995
  });
12018
11996
  return new Instance_1$2.Layout(identity, this.wire);
@@ -12037,7 +12015,7 @@ class LayoutModule extends base_1$5.Base {
12037
12015
  * ```
12038
12016
  */
12039
12017
  wrapSync(identity) {
12040
- this.wire.sendAction('layout-wrap-sync').catch((e) => {
12018
+ this.wire.sendAction('layout-wrap-sync').catch(() => {
12041
12019
  // don't expose
12042
12020
  });
12043
12021
  return new Instance_1$2.Layout(identity, this.wire);
@@ -12053,7 +12031,7 @@ class LayoutModule extends base_1$5.Base {
12053
12031
  * ```
12054
12032
  */
12055
12033
  async getCurrent() {
12056
- this.wire.sendAction('layout-get-current').catch((e) => {
12034
+ this.wire.sendAction('layout-get-current').catch(() => {
12057
12035
  // don't expose
12058
12036
  });
12059
12037
  if (!this.fin.me.isWindow) {
@@ -12076,7 +12054,7 @@ class LayoutModule extends base_1$5.Base {
12076
12054
  * ```
12077
12055
  */
12078
12056
  getCurrentSync() {
12079
- this.wire.sendAction('layout-get-current-sync').catch((e) => {
12057
+ this.wire.sendAction('layout-get-current-sync').catch(() => {
12080
12058
  // don't expose
12081
12059
  });
12082
12060
  if (!this.fin.me.isWindow) {
@@ -12087,10 +12065,11 @@ class LayoutModule extends base_1$5.Base {
12087
12065
  }
12088
12066
  }
12089
12067
  Factory$2.LayoutModule = LayoutModule;
12090
- _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_getBackCompatLayoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_throwIfLayoutManagerNotInitialized = function _LayoutModule_throwIfLayoutManagerNotInitialized(method) {
12068
+ _LayoutModule_layoutInitializationAttempted = new WeakMap(), _LayoutModule_layoutManager = new WeakMap(), _LayoutModule_instances = new WeakSet(), _LayoutModule_getSafeLayoutManager = function _LayoutModule_getSafeLayoutManager(method) {
12091
12069
  if (!__classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f")) {
12092
12070
  throw new Error(`You must call init before using the API ${method}`);
12093
12071
  }
12072
+ return __classPrivateFieldGet$4(this, _LayoutModule_layoutManager, "f");
12094
12073
  };
12095
12074
 
12096
12075
  (function (exports) {
@@ -14428,8 +14407,6 @@ const base_1$2 = base;
14428
14407
  const SessionContextGroupClient_1 = SessionContextGroupClient$1;
14429
14408
  const utils_1$2 = utils$1;
14430
14409
  /**
14431
- * {@link https://developers.openfin.co/of-docs/docs/enable-color-linking}
14432
- *
14433
14410
  * The Interop Client API is broken up into two groups:
14434
14411
  *
14435
14412
  * **Content Facing APIs** - For Application Developers putting Views into a Platform Window, who care about Context. These are APIs that send out and receive the Context data that flows between applications. Think of this as the Water in the Interop Pipes.
@@ -14995,7 +14972,11 @@ class InteropClient extends base_1$2.Base {
14995
14972
  listener({ type: 'interop-broker', topic: 'disconnected', brokerName: uuid });
14996
14973
  });
14997
14974
  }
14998
- // used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
14975
+ /**
14976
+ * @internal
14977
+ *
14978
+ * Used to ferry fdc3-only calls from the fdc3 shim to the Interop Broker
14979
+ */
14999
14980
  static async ferryFdc3Call(interopClient, action, payload) {
15000
14981
  const client = await __classPrivateFieldGet$2(interopClient, _InteropClient_clientPromise, "f");
15001
14982
  return client.dispatch(action, payload || null);
@@ -15012,29 +14993,33 @@ function requireOverrideCheck () {
15012
14993
  if (hasRequiredOverrideCheck) return overrideCheck;
15013
14994
  hasRequiredOverrideCheck = 1;
15014
14995
  Object.defineProperty(overrideCheck, "__esModule", { value: true });
15015
- overrideCheck.overrideCheck = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
14996
+ overrideCheck.overrideCheck = overrideCheck.checkFDC32Overrides = overrideCheck.getDefaultViewFdc3VersionFromAppInfo = void 0;
15016
14997
  const InteropBroker_1 = requireInteropBroker();
15017
14998
  function getDefaultViewFdc3VersionFromAppInfo({ manifest, initialOptions }) {
15018
14999
  const setVersion = manifest.platform?.defaultViewOptions?.fdc3InteropApi ?? initialOptions.defaultViewOptions?.fdc3InteropApi;
15019
15000
  return ['1.2', '2.0'].includes(setVersion ?? '') ? setVersion : undefined;
15020
15001
  }
15021
15002
  overrideCheck.getDefaultViewFdc3VersionFromAppInfo = getDefaultViewFdc3VersionFromAppInfo;
15022
- // TODO: Unit test this
15003
+ function checkFDC32Overrides(overriddenBroker) {
15004
+ // These are the APIs that must be overridden for FDC3 2.0 compliance
15005
+ const mustOverrideAPIs = [
15006
+ 'fdc3HandleFindInstances',
15007
+ 'handleInfoForIntent',
15008
+ 'handleInfoForIntentsByContext',
15009
+ 'fdc3HandleGetAppMetadata',
15010
+ 'fdc3HandleGetInfo',
15011
+ 'fdc3HandleOpen',
15012
+ 'handleFiredIntent',
15013
+ 'handleFiredIntentForContext'
15014
+ ];
15015
+ return mustOverrideAPIs.filter((api) => {
15016
+ return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
15017
+ });
15018
+ }
15019
+ overrideCheck.checkFDC32Overrides = checkFDC32Overrides;
15023
15020
  function overrideCheck$1(overriddenBroker, fdc3InteropApi) {
15024
15021
  if (fdc3InteropApi && fdc3InteropApi === '2.0') {
15025
- const mustOverrideAPIs = [
15026
- 'fdc3HandleFindInstances',
15027
- 'handleInfoForIntent',
15028
- 'handleInfoForIntentsByContext',
15029
- 'fdc3HandleGetAppMetadata',
15030
- 'fdc3HandleGetInfo',
15031
- 'fdc3HandleOpen',
15032
- 'handleFiredIntent',
15033
- 'handleFiredIntentForContext'
15034
- ];
15035
- const notOverridden = mustOverrideAPIs.filter((api) => {
15036
- return overriddenBroker[api] === InteropBroker_1.InteropBroker.prototype[api];
15037
- });
15022
+ const notOverridden = checkFDC32Overrides(overriddenBroker);
15038
15023
  if (notOverridden.length > 0) {
15039
15024
  console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${notOverridden.join('\n')}`);
15040
15025
  }
@@ -15881,6 +15866,9 @@ class MockEnvironment {
15881
15866
  initLayoutManager() {
15882
15867
  throw new Error(me_1.environmentUnsupportedMessage);
15883
15868
  }
15869
+ applyLayoutSnapshot() {
15870
+ throw new Error(me_1.environmentUnsupportedMessage);
15871
+ }
15884
15872
  async createLayout() {
15885
15873
  throw new Error(me_1.environmentUnsupportedMessage);
15886
15874
  }
@@ -15939,6 +15927,7 @@ var mockWire = {};
15939
15927
 
15940
15928
  Object.defineProperty(mockWire, "__esModule", { value: true });
15941
15929
  mockWire.MockWire = void 0;
15930
+ /* eslint-disable @typescript-eslint/no-unused-vars */
15942
15931
  const events_1 = require$$0;
15943
15932
  class MockWire extends events_1.EventEmitter {
15944
15933
  connect() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/core",
3
- "version": "35.78.29",
3
+ "version": "35.79.2",
4
4
  "description": "The core renderer entry point of OpenFin",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "main": "out/mock.js",