@openfin/fdc3-api 39.83.4 → 39.83.5

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.
@@ -8024,6 +8024,29 @@ declare class Layout extends Base {
8024
8024
  * ```
8025
8025
  */
8026
8026
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
8027
+ /**
8028
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
8029
+ *
8030
+ * @param viewOptions - The options for creating the view.
8031
+ * @param options - Optional parameters for adding the view.
8032
+ * @param options.location - The location where the view should be added.
8033
+ * @param options.targetView - The target view to which the new view should be added.
8034
+ * @returns A promise that resolves to an object containing the identity of the added view.
8035
+ */
8036
+ addView(viewOptions: OpenFin.PlatformViewCreationOptions, { location, targetView }?: {
8037
+ location?: OpenFin.CreateViewTarget['location'];
8038
+ targetView?: OpenFin.Identity;
8039
+ }): Promise<{
8040
+ identity: OpenFin.Identity;
8041
+ }>;
8042
+ /**
8043
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
8044
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
8045
+ *
8046
+ * @param viewIdentity - The identity of the view to close.
8047
+ * @returns A promise that resolves when the view is closed.
8048
+ */
8049
+ closeView(viewIdentity: OpenFin.Identity): Promise<void>;
8027
8050
  }
8028
8051
 
8029
8052
  /**
@@ -8036,7 +8059,7 @@ declare type LayoutColumn = LayoutItemConfig & {
8036
8059
  /**
8037
8060
  * @interface
8038
8061
  */
8039
- declare type LayoutComponent = LayoutItemConfig & {
8062
+ declare type LayoutComponent = Omit<LayoutItemConfig, 'content' | 'type'> & {
8040
8063
  /**
8041
8064
  * Only a component type will have this property and it should be set to view.
8042
8065
  */
@@ -8045,6 +8068,7 @@ declare type LayoutComponent = LayoutItemConfig & {
8045
8068
  * Only a component type will have this property and it represents the view options of a given component.
8046
8069
  */
8047
8070
  componentState?: Partial<ViewCreationOptions>;
8071
+ type: 'component';
8048
8072
  };
8049
8073
 
8050
8074
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
@@ -8128,10 +8152,7 @@ declare type LayoutIdentity = Identity_4 & {
8128
8152
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8129
8153
  type: 'layout-initialized';
8130
8154
  layoutIdentity: OpenFin.LayoutIdentity;
8131
- ofViews: {
8132
- identity: OpenFin.Identity;
8133
- entityType: 'view';
8134
- }[];
8155
+ ofViews: OpenFin.ViewCreationResult[];
8135
8156
  };
8136
8157
 
8137
8158
  /**
@@ -8239,7 +8260,7 @@ declare interface LayoutManager<T extends LayoutSnapshot> {
8239
8260
  /**
8240
8261
  * @experimental
8241
8262
  */
8242
- getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity;
8263
+ getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity | undefined;
8243
8264
  /**
8244
8265
  * @experimental
8245
8266
  */
@@ -9492,6 +9513,9 @@ declare namespace OpenFin {
9492
9513
  ViewOptions,
9493
9514
  ConstViewOptions,
9494
9515
  ViewState,
9516
+ ViewCreationSuccess,
9517
+ ViewCreationFailure,
9518
+ ViewCreationResult,
9495
9519
  Certificate,
9496
9520
  HostContextChangedPayload,
9497
9521
  ApplySnapshotOptions,
@@ -11292,6 +11316,45 @@ declare interface PlatformProvider {
11292
11316
  * @returns {Promise<void>}
11293
11317
  */
11294
11318
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11319
+ /**
11320
+ * @experimental
11321
+ *
11322
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11323
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11324
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11325
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11326
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11327
+ *
11328
+ * @param viewIdentity Identity of the view
11329
+ * @param error error thrown during a view creation
11330
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11331
+ *
11332
+ * @example
11333
+ *
11334
+ * ```js
11335
+ * const overrideCallback = (PlatformProvider) => {
11336
+ * class Override extends PlatformProvider {
11337
+ * async handleFailedViewCreation(viewIdentity, error) {
11338
+ * const view = fin.View.wrapSync(viewId);
11339
+ * try {
11340
+ * // navigate to an error page
11341
+ * await view.navigate('http://localhost:3000/errorPage.html');
11342
+ * // resolve a success result after redirecting to a error page
11343
+ * return {identity: viewIdentity, success: true};
11344
+ * } catch(e) {
11345
+ * // layout-initialized event will include this view with the error
11346
+ * throw error;
11347
+ * }
11348
+ * }
11349
+ * }
11350
+ * return new Override();
11351
+ * }
11352
+ *
11353
+ * fin.Platform.init({ overrideCallback });
11354
+ *
11355
+ * ```
11356
+ */
11357
+ handleFailedViewCreation(viewIdentity: OpenFin.Identity, error: Error): Promise<OpenFin.ViewCreationSuccess | void>;
11295
11358
  }
11296
11359
 
11297
11360
  /**
@@ -16054,6 +16117,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16054
16117
  options?: Partial<ViewOptions>;
16055
16118
  };
16056
16119
 
16120
+ /**
16121
+ * @interface
16122
+ */
16123
+ declare type ViewCreationFailure = {
16124
+ /**
16125
+ * The identity of the created view
16126
+ */
16127
+ identity: Identity_4;
16128
+ /**
16129
+ * Whether the view was created with errors
16130
+ */
16131
+ success: false;
16132
+ /**
16133
+ * Error thrown during view creation
16134
+ */
16135
+ error: Error;
16136
+ };
16137
+
16057
16138
  /**
16058
16139
  * The options object required by {@link View.ViewModule.create View.create}.
16059
16140
  *
@@ -16069,6 +16150,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16069
16150
 
16070
16151
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16071
16152
 
16153
+ /**
16154
+ * A view creation state
16155
+ */
16156
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16157
+
16158
+ /**
16159
+ * @interface
16160
+ */
16161
+ declare type ViewCreationSuccess = {
16162
+ /**
16163
+ * The identity of the created view
16164
+ */
16165
+ identity: Identity_4;
16166
+ /**
16167
+ * Whether the view was created without errors
16168
+ */
16169
+ success: true;
16170
+ };
16171
+
16072
16172
  /**
16073
16173
  * Generated when a window has a view detached from it.
16074
16174
  * @remarks Will fire when a view is destroyed in which case `target` will be null.
@@ -8024,6 +8024,29 @@ declare class Layout extends Base {
8024
8024
  * ```
8025
8025
  */
8026
8026
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
8027
+ /**
8028
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
8029
+ *
8030
+ * @param viewOptions - The options for creating the view.
8031
+ * @param options - Optional parameters for adding the view.
8032
+ * @param options.location - The location where the view should be added.
8033
+ * @param options.targetView - The target view to which the new view should be added.
8034
+ * @returns A promise that resolves to an object containing the identity of the added view.
8035
+ */
8036
+ addView(viewOptions: OpenFin.PlatformViewCreationOptions, { location, targetView }?: {
8037
+ location?: OpenFin.CreateViewTarget['location'];
8038
+ targetView?: OpenFin.Identity;
8039
+ }): Promise<{
8040
+ identity: OpenFin.Identity;
8041
+ }>;
8042
+ /**
8043
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
8044
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
8045
+ *
8046
+ * @param viewIdentity - The identity of the view to close.
8047
+ * @returns A promise that resolves when the view is closed.
8048
+ */
8049
+ closeView(viewIdentity: OpenFin.Identity): Promise<void>;
8027
8050
  }
8028
8051
 
8029
8052
  /**
@@ -8036,7 +8059,7 @@ declare type LayoutColumn = LayoutItemConfig & {
8036
8059
  /**
8037
8060
  * @interface
8038
8061
  */
8039
- declare type LayoutComponent = LayoutItemConfig & {
8062
+ declare type LayoutComponent = Omit<LayoutItemConfig, 'content' | 'type'> & {
8040
8063
  /**
8041
8064
  * Only a component type will have this property and it should be set to view.
8042
8065
  */
@@ -8045,6 +8068,7 @@ declare type LayoutComponent = LayoutItemConfig & {
8045
8068
  * Only a component type will have this property and it represents the view options of a given component.
8046
8069
  */
8047
8070
  componentState?: Partial<ViewCreationOptions>;
8071
+ type: 'component';
8048
8072
  };
8049
8073
 
8050
8074
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
@@ -8128,10 +8152,7 @@ declare type LayoutIdentity = Identity_4 & {
8128
8152
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8129
8153
  type: 'layout-initialized';
8130
8154
  layoutIdentity: OpenFin.LayoutIdentity;
8131
- ofViews: {
8132
- identity: OpenFin.Identity;
8133
- entityType: 'view';
8134
- }[];
8155
+ ofViews: OpenFin.ViewCreationResult[];
8135
8156
  };
8136
8157
 
8137
8158
  /**
@@ -8239,7 +8260,7 @@ declare interface LayoutManager<T extends LayoutSnapshot> {
8239
8260
  /**
8240
8261
  * @experimental
8241
8262
  */
8242
- getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity;
8263
+ getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity | undefined;
8243
8264
  /**
8244
8265
  * @experimental
8245
8266
  */
@@ -9492,6 +9513,9 @@ declare namespace OpenFin {
9492
9513
  ViewOptions,
9493
9514
  ConstViewOptions,
9494
9515
  ViewState,
9516
+ ViewCreationSuccess,
9517
+ ViewCreationFailure,
9518
+ ViewCreationResult,
9495
9519
  Certificate,
9496
9520
  HostContextChangedPayload,
9497
9521
  ApplySnapshotOptions,
@@ -11292,6 +11316,45 @@ declare interface PlatformProvider {
11292
11316
  * @returns {Promise<void>}
11293
11317
  */
11294
11318
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11319
+ /**
11320
+ * @experimental
11321
+ *
11322
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11323
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11324
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11325
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11326
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11327
+ *
11328
+ * @param viewIdentity Identity of the view
11329
+ * @param error error thrown during a view creation
11330
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11331
+ *
11332
+ * @example
11333
+ *
11334
+ * ```js
11335
+ * const overrideCallback = (PlatformProvider) => {
11336
+ * class Override extends PlatformProvider {
11337
+ * async handleFailedViewCreation(viewIdentity, error) {
11338
+ * const view = fin.View.wrapSync(viewId);
11339
+ * try {
11340
+ * // navigate to an error page
11341
+ * await view.navigate('http://localhost:3000/errorPage.html');
11342
+ * // resolve a success result after redirecting to a error page
11343
+ * return {identity: viewIdentity, success: true};
11344
+ * } catch(e) {
11345
+ * // layout-initialized event will include this view with the error
11346
+ * throw error;
11347
+ * }
11348
+ * }
11349
+ * }
11350
+ * return new Override();
11351
+ * }
11352
+ *
11353
+ * fin.Platform.init({ overrideCallback });
11354
+ *
11355
+ * ```
11356
+ */
11357
+ handleFailedViewCreation(viewIdentity: OpenFin.Identity, error: Error): Promise<OpenFin.ViewCreationSuccess | void>;
11295
11358
  }
11296
11359
 
11297
11360
  /**
@@ -16054,6 +16117,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16054
16117
  options?: Partial<ViewOptions>;
16055
16118
  };
16056
16119
 
16120
+ /**
16121
+ * @interface
16122
+ */
16123
+ declare type ViewCreationFailure = {
16124
+ /**
16125
+ * The identity of the created view
16126
+ */
16127
+ identity: Identity_4;
16128
+ /**
16129
+ * Whether the view was created with errors
16130
+ */
16131
+ success: false;
16132
+ /**
16133
+ * Error thrown during view creation
16134
+ */
16135
+ error: Error;
16136
+ };
16137
+
16057
16138
  /**
16058
16139
  * The options object required by {@link View.ViewModule.create View.create}.
16059
16140
  *
@@ -16069,6 +16150,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16069
16150
 
16070
16151
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16071
16152
 
16153
+ /**
16154
+ * A view creation state
16155
+ */
16156
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16157
+
16158
+ /**
16159
+ * @interface
16160
+ */
16161
+ declare type ViewCreationSuccess = {
16162
+ /**
16163
+ * The identity of the created view
16164
+ */
16165
+ identity: Identity_4;
16166
+ /**
16167
+ * Whether the view was created without errors
16168
+ */
16169
+ success: true;
16170
+ };
16171
+
16072
16172
  /**
16073
16173
  * Generated when a window has a view detached from it.
16074
16174
  * @remarks Will fire when a view is destroyed in which case `target` will be null.
@@ -8024,6 +8024,29 @@ declare class Layout extends Base {
8024
8024
  * ```
8025
8025
  */
8026
8026
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
8027
+ /**
8028
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
8029
+ *
8030
+ * @param viewOptions - The options for creating the view.
8031
+ * @param options - Optional parameters for adding the view.
8032
+ * @param options.location - The location where the view should be added.
8033
+ * @param options.targetView - The target view to which the new view should be added.
8034
+ * @returns A promise that resolves to an object containing the identity of the added view.
8035
+ */
8036
+ addView(viewOptions: OpenFin.PlatformViewCreationOptions, { location, targetView }?: {
8037
+ location?: OpenFin.CreateViewTarget['location'];
8038
+ targetView?: OpenFin.Identity;
8039
+ }): Promise<{
8040
+ identity: OpenFin.Identity;
8041
+ }>;
8042
+ /**
8043
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
8044
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
8045
+ *
8046
+ * @param viewIdentity - The identity of the view to close.
8047
+ * @returns A promise that resolves when the view is closed.
8048
+ */
8049
+ closeView(viewIdentity: OpenFin.Identity): Promise<void>;
8027
8050
  }
8028
8051
 
8029
8052
  /**
@@ -8036,7 +8059,7 @@ declare type LayoutColumn = LayoutItemConfig & {
8036
8059
  /**
8037
8060
  * @interface
8038
8061
  */
8039
- declare type LayoutComponent = LayoutItemConfig & {
8062
+ declare type LayoutComponent = Omit<LayoutItemConfig, 'content' | 'type'> & {
8040
8063
  /**
8041
8064
  * Only a component type will have this property and it should be set to view.
8042
8065
  */
@@ -8045,6 +8068,7 @@ declare type LayoutComponent = LayoutItemConfig & {
8045
8068
  * Only a component type will have this property and it represents the view options of a given component.
8046
8069
  */
8047
8070
  componentState?: Partial<ViewCreationOptions>;
8071
+ type: 'component';
8048
8072
  };
8049
8073
 
8050
8074
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
@@ -8128,10 +8152,7 @@ declare type LayoutIdentity = Identity_4 & {
8128
8152
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8129
8153
  type: 'layout-initialized';
8130
8154
  layoutIdentity: OpenFin.LayoutIdentity;
8131
- ofViews: {
8132
- identity: OpenFin.Identity;
8133
- entityType: 'view';
8134
- }[];
8155
+ ofViews: OpenFin.ViewCreationResult[];
8135
8156
  };
8136
8157
 
8137
8158
  /**
@@ -8239,7 +8260,7 @@ declare interface LayoutManager<T extends LayoutSnapshot> {
8239
8260
  /**
8240
8261
  * @experimental
8241
8262
  */
8242
- getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity;
8263
+ getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity | undefined;
8243
8264
  /**
8244
8265
  * @experimental
8245
8266
  */
@@ -9492,6 +9513,9 @@ declare namespace OpenFin {
9492
9513
  ViewOptions,
9493
9514
  ConstViewOptions,
9494
9515
  ViewState,
9516
+ ViewCreationSuccess,
9517
+ ViewCreationFailure,
9518
+ ViewCreationResult,
9495
9519
  Certificate,
9496
9520
  HostContextChangedPayload,
9497
9521
  ApplySnapshotOptions,
@@ -11292,6 +11316,45 @@ declare interface PlatformProvider {
11292
11316
  * @returns {Promise<void>}
11293
11317
  */
11294
11318
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11319
+ /**
11320
+ * @experimental
11321
+ *
11322
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11323
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11324
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11325
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11326
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11327
+ *
11328
+ * @param viewIdentity Identity of the view
11329
+ * @param error error thrown during a view creation
11330
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11331
+ *
11332
+ * @example
11333
+ *
11334
+ * ```js
11335
+ * const overrideCallback = (PlatformProvider) => {
11336
+ * class Override extends PlatformProvider {
11337
+ * async handleFailedViewCreation(viewIdentity, error) {
11338
+ * const view = fin.View.wrapSync(viewId);
11339
+ * try {
11340
+ * // navigate to an error page
11341
+ * await view.navigate('http://localhost:3000/errorPage.html');
11342
+ * // resolve a success result after redirecting to a error page
11343
+ * return {identity: viewIdentity, success: true};
11344
+ * } catch(e) {
11345
+ * // layout-initialized event will include this view with the error
11346
+ * throw error;
11347
+ * }
11348
+ * }
11349
+ * }
11350
+ * return new Override();
11351
+ * }
11352
+ *
11353
+ * fin.Platform.init({ overrideCallback });
11354
+ *
11355
+ * ```
11356
+ */
11357
+ handleFailedViewCreation(viewIdentity: OpenFin.Identity, error: Error): Promise<OpenFin.ViewCreationSuccess | void>;
11295
11358
  }
11296
11359
 
11297
11360
  /**
@@ -16054,6 +16117,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16054
16117
  options?: Partial<ViewOptions>;
16055
16118
  };
16056
16119
 
16120
+ /**
16121
+ * @interface
16122
+ */
16123
+ declare type ViewCreationFailure = {
16124
+ /**
16125
+ * The identity of the created view
16126
+ */
16127
+ identity: Identity_4;
16128
+ /**
16129
+ * Whether the view was created with errors
16130
+ */
16131
+ success: false;
16132
+ /**
16133
+ * Error thrown during view creation
16134
+ */
16135
+ error: Error;
16136
+ };
16137
+
16057
16138
  /**
16058
16139
  * The options object required by {@link View.ViewModule.create View.create}.
16059
16140
  *
@@ -16069,6 +16150,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16069
16150
 
16070
16151
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16071
16152
 
16153
+ /**
16154
+ * A view creation state
16155
+ */
16156
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16157
+
16158
+ /**
16159
+ * @interface
16160
+ */
16161
+ declare type ViewCreationSuccess = {
16162
+ /**
16163
+ * The identity of the created view
16164
+ */
16165
+ identity: Identity_4;
16166
+ /**
16167
+ * Whether the view was created without errors
16168
+ */
16169
+ success: true;
16170
+ };
16171
+
16072
16172
  /**
16073
16173
  * Generated when a window has a view detached from it.
16074
16174
  * @remarks Will fire when a view is destroyed in which case `target` will be null.
package/out/fdc3-api.d.ts CHANGED
@@ -8150,6 +8150,29 @@ declare class Layout extends Base {
8150
8150
  * ```
8151
8151
  */
8152
8152
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
8153
+ /**
8154
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
8155
+ *
8156
+ * @param viewOptions - The options for creating the view.
8157
+ * @param options - Optional parameters for adding the view.
8158
+ * @param options.location - The location where the view should be added.
8159
+ * @param options.targetView - The target view to which the new view should be added.
8160
+ * @returns A promise that resolves to an object containing the identity of the added view.
8161
+ */
8162
+ addView(viewOptions: OpenFin.PlatformViewCreationOptions, { location, targetView }?: {
8163
+ location?: OpenFin.CreateViewTarget['location'];
8164
+ targetView?: OpenFin.Identity;
8165
+ }): Promise<{
8166
+ identity: OpenFin.Identity;
8167
+ }>;
8168
+ /**
8169
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
8170
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
8171
+ *
8172
+ * @param viewIdentity - The identity of the view to close.
8173
+ * @returns A promise that resolves when the view is closed.
8174
+ */
8175
+ closeView(viewIdentity: OpenFin.Identity): Promise<void>;
8153
8176
  }
8154
8177
 
8155
8178
  /**
@@ -8162,7 +8185,7 @@ declare type LayoutColumn = LayoutItemConfig & {
8162
8185
  /**
8163
8186
  * @interface
8164
8187
  */
8165
- declare type LayoutComponent = LayoutItemConfig & {
8188
+ declare type LayoutComponent = Omit<LayoutItemConfig, 'content' | 'type'> & {
8166
8189
  /**
8167
8190
  * Only a component type will have this property and it should be set to view.
8168
8191
  */
@@ -8171,6 +8194,7 @@ declare type LayoutComponent = LayoutItemConfig & {
8171
8194
  * Only a component type will have this property and it represents the view options of a given component.
8172
8195
  */
8173
8196
  componentState?: Partial<ViewCreationOptions>;
8197
+ type: 'component';
8174
8198
  };
8175
8199
 
8176
8200
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
@@ -8254,10 +8278,7 @@ declare type LayoutIdentity = Identity_4 & {
8254
8278
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8255
8279
  type: 'layout-initialized';
8256
8280
  layoutIdentity: OpenFin.LayoutIdentity;
8257
- ofViews: {
8258
- identity: OpenFin.Identity;
8259
- entityType: 'view';
8260
- }[];
8281
+ ofViews: OpenFin.ViewCreationResult[];
8261
8282
  };
8262
8283
 
8263
8284
  /**
@@ -8365,7 +8386,7 @@ declare interface LayoutManager<T extends LayoutSnapshot> {
8365
8386
  /**
8366
8387
  * @experimental
8367
8388
  */
8368
- getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity;
8389
+ getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity | undefined;
8369
8390
  /**
8370
8391
  * @experimental
8371
8392
  */
@@ -9810,6 +9831,9 @@ declare namespace OpenFin {
9810
9831
  ViewOptions,
9811
9832
  ConstViewOptions,
9812
9833
  ViewState,
9834
+ ViewCreationSuccess,
9835
+ ViewCreationFailure,
9836
+ ViewCreationResult,
9813
9837
  Certificate,
9814
9838
  HostContextChangedPayload,
9815
9839
  ApplySnapshotOptions,
@@ -11688,6 +11712,45 @@ declare interface PlatformProvider {
11688
11712
  * @returns {Promise<void>}
11689
11713
  */
11690
11714
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11715
+ /**
11716
+ * @experimental
11717
+ *
11718
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11719
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11720
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11721
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11722
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11723
+ *
11724
+ * @param viewIdentity Identity of the view
11725
+ * @param error error thrown during a view creation
11726
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11727
+ *
11728
+ * @example
11729
+ *
11730
+ * ```js
11731
+ * const overrideCallback = (PlatformProvider) => {
11732
+ * class Override extends PlatformProvider {
11733
+ * async handleFailedViewCreation(viewIdentity, error) {
11734
+ * const view = fin.View.wrapSync(viewId);
11735
+ * try {
11736
+ * // navigate to an error page
11737
+ * await view.navigate('http://localhost:3000/errorPage.html');
11738
+ * // resolve a success result after redirecting to a error page
11739
+ * return {identity: viewIdentity, success: true};
11740
+ * } catch(e) {
11741
+ * // layout-initialized event will include this view with the error
11742
+ * throw error;
11743
+ * }
11744
+ * }
11745
+ * }
11746
+ * return new Override();
11747
+ * }
11748
+ *
11749
+ * fin.Platform.init({ overrideCallback });
11750
+ *
11751
+ * ```
11752
+ */
11753
+ handleFailedViewCreation(viewIdentity: OpenFin.Identity, error: Error): Promise<OpenFin.ViewCreationSuccess | void>;
11691
11754
  }
11692
11755
 
11693
11756
  /**
@@ -16500,6 +16563,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16500
16563
  options?: Partial<ViewOptions>;
16501
16564
  };
16502
16565
 
16566
+ /**
16567
+ * @interface
16568
+ */
16569
+ declare type ViewCreationFailure = {
16570
+ /**
16571
+ * The identity of the created view
16572
+ */
16573
+ identity: Identity_4;
16574
+ /**
16575
+ * Whether the view was created with errors
16576
+ */
16577
+ success: false;
16578
+ /**
16579
+ * Error thrown during view creation
16580
+ */
16581
+ error: Error;
16582
+ };
16583
+
16503
16584
  /**
16504
16585
  * The options object required by {@link View.ViewModule.create View.create}.
16505
16586
  *
@@ -16515,6 +16596,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16515
16596
 
16516
16597
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16517
16598
 
16599
+ /**
16600
+ * A view creation state
16601
+ */
16602
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16603
+
16604
+ /**
16605
+ * @interface
16606
+ */
16607
+ declare type ViewCreationSuccess = {
16608
+ /**
16609
+ * The identity of the created view
16610
+ */
16611
+ identity: Identity_4;
16612
+ /**
16613
+ * Whether the view was created without errors
16614
+ */
16615
+ success: true;
16616
+ };
16617
+
16518
16618
  /**
16519
16619
  * Generated when a window has a view detached from it.
16520
16620
  * @remarks Will fire when a view is destroyed in which case `target` will be null.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/fdc3-api",
3
- "version": "39.83.4",
3
+ "version": "39.83.5",
4
4
  "description": "OpenFin fdc3 module utilities and types.",
5
5
  "license": "SEE LICENSE IN LICENSE.MD",
6
6
  "private": false,