@openfin/fdc3-api 40.82.20 → 40.82.22

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.
@@ -3654,11 +3654,6 @@ declare type ConstWindowOptions = {
3654
3654
  * @deprecated - use `icon` instead.
3655
3655
  */
3656
3656
  taskbarIcon: string;
3657
- /**
3658
- * Specify a taskbar group for the window.
3659
- * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
3660
- */
3661
- taskbarIconGroup: string;
3662
3657
  /**
3663
3658
  * @defaultValue "about:blank"
3664
3659
  *
@@ -8028,6 +8023,29 @@ declare class Layout extends Base {
8028
8023
  * ```
8029
8024
  */
8030
8025
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
8026
+ /**
8027
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
8028
+ *
8029
+ * @param viewOptions - The options for creating the view.
8030
+ * @param options - Optional parameters for adding the view.
8031
+ * @param options.location - The location where the view should be added.
8032
+ * @param options.targetView - The target view to which the new view should be added.
8033
+ * @returns A promise that resolves to an object containing the identity of the added view.
8034
+ */
8035
+ addView(viewOptions: OpenFin.PlatformViewCreationOptions, { location, targetView }?: {
8036
+ location?: OpenFin.CreateViewTarget['location'];
8037
+ targetView?: OpenFin.Identity;
8038
+ }): Promise<{
8039
+ identity: OpenFin.Identity;
8040
+ }>;
8041
+ /**
8042
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
8043
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
8044
+ *
8045
+ * @param viewIdentity - The identity of the view to close.
8046
+ * @returns A promise that resolves when the view is closed.
8047
+ */
8048
+ closeView(viewIdentity: OpenFin.Identity): Promise<void>;
8031
8049
  }
8032
8050
 
8033
8051
  /**
@@ -8040,7 +8058,7 @@ declare type LayoutColumn = LayoutItemConfig & {
8040
8058
  /**
8041
8059
  * @interface
8042
8060
  */
8043
- declare type LayoutComponent = LayoutItemConfig & {
8061
+ declare type LayoutComponent = Omit<LayoutItemConfig, 'content' | 'type'> & {
8044
8062
  /**
8045
8063
  * Only a component type will have this property and it should be set to view.
8046
8064
  */
@@ -8049,6 +8067,7 @@ declare type LayoutComponent = LayoutItemConfig & {
8049
8067
  * Only a component type will have this property and it represents the view options of a given component.
8050
8068
  */
8051
8069
  componentState?: Partial<ViewCreationOptions>;
8070
+ type: 'component';
8052
8071
  };
8053
8072
 
8054
8073
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
@@ -8132,10 +8151,7 @@ declare type LayoutIdentity = Identity_4 & {
8132
8151
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8133
8152
  type: 'layout-initialized';
8134
8153
  layoutIdentity: OpenFin.LayoutIdentity;
8135
- ofViews: {
8136
- identity: OpenFin.Identity;
8137
- entityType: 'view';
8138
- }[];
8154
+ ofViews: OpenFin.ViewCreationResult[];
8139
8155
  };
8140
8156
 
8141
8157
  /**
@@ -8243,7 +8259,7 @@ declare interface LayoutManager<T extends LayoutSnapshot> {
8243
8259
  /**
8244
8260
  * @experimental
8245
8261
  */
8246
- getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity;
8262
+ getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity | undefined;
8247
8263
  /**
8248
8264
  * @experimental
8249
8265
  */
@@ -9234,6 +9250,12 @@ declare type MutableWindowOptions = {
9234
9250
  * Shows the window's icon in the taskbar.
9235
9251
  */
9236
9252
  showTaskbarIcon: boolean;
9253
+ /**
9254
+ * Specify a taskbar group for the window.
9255
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
9256
+ * @remarks It's only updatable when `enableJumpList` is set to false.
9257
+ */
9258
+ taskbarIconGroup: string;
9237
9259
  interop: InteropConfig;
9238
9260
  /* Excluded from this release type: _internalWorkspaceData */
9239
9261
  /* Excluded from this release type: workspacePlatform */
@@ -9490,6 +9512,9 @@ declare namespace OpenFin {
9490
9512
  ViewOptions,
9491
9513
  ConstViewOptions,
9492
9514
  ViewState,
9515
+ ViewCreationSuccess,
9516
+ ViewCreationFailure,
9517
+ ViewCreationResult,
9493
9518
  Certificate,
9494
9519
  HostContextChangedPayload,
9495
9520
  ApplySnapshotOptions,
@@ -11291,6 +11316,45 @@ declare interface PlatformProvider {
11291
11316
  * @returns {Promise<void>}
11292
11317
  */
11293
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>;
11294
11358
  }
11295
11359
 
11296
11360
  /**
@@ -16053,6 +16117,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16053
16117
  options?: Partial<ViewOptions>;
16054
16118
  };
16055
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
+
16056
16138
  /**
16057
16139
  * The options object required by {@link View.ViewModule.create View.create}.
16058
16140
  *
@@ -16068,6 +16150,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16068
16150
 
16069
16151
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16070
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
+
16071
16172
  /**
16072
16173
  * Generated when a window has a view detached from it.
16073
16174
  * @remarks Will fire when a view is destroyed in which case `target` will be null.
@@ -3654,11 +3654,6 @@ declare type ConstWindowOptions = {
3654
3654
  * @deprecated - use `icon` instead.
3655
3655
  */
3656
3656
  taskbarIcon: string;
3657
- /**
3658
- * Specify a taskbar group for the window.
3659
- * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
3660
- */
3661
- taskbarIconGroup: string;
3662
3657
  /**
3663
3658
  * @defaultValue "about:blank"
3664
3659
  *
@@ -8028,6 +8023,29 @@ declare class Layout extends Base {
8028
8023
  * ```
8029
8024
  */
8030
8025
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
8026
+ /**
8027
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
8028
+ *
8029
+ * @param viewOptions - The options for creating the view.
8030
+ * @param options - Optional parameters for adding the view.
8031
+ * @param options.location - The location where the view should be added.
8032
+ * @param options.targetView - The target view to which the new view should be added.
8033
+ * @returns A promise that resolves to an object containing the identity of the added view.
8034
+ */
8035
+ addView(viewOptions: OpenFin.PlatformViewCreationOptions, { location, targetView }?: {
8036
+ location?: OpenFin.CreateViewTarget['location'];
8037
+ targetView?: OpenFin.Identity;
8038
+ }): Promise<{
8039
+ identity: OpenFin.Identity;
8040
+ }>;
8041
+ /**
8042
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
8043
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
8044
+ *
8045
+ * @param viewIdentity - The identity of the view to close.
8046
+ * @returns A promise that resolves when the view is closed.
8047
+ */
8048
+ closeView(viewIdentity: OpenFin.Identity): Promise<void>;
8031
8049
  }
8032
8050
 
8033
8051
  /**
@@ -8040,7 +8058,7 @@ declare type LayoutColumn = LayoutItemConfig & {
8040
8058
  /**
8041
8059
  * @interface
8042
8060
  */
8043
- declare type LayoutComponent = LayoutItemConfig & {
8061
+ declare type LayoutComponent = Omit<LayoutItemConfig, 'content' | 'type'> & {
8044
8062
  /**
8045
8063
  * Only a component type will have this property and it should be set to view.
8046
8064
  */
@@ -8049,6 +8067,7 @@ declare type LayoutComponent = LayoutItemConfig & {
8049
8067
  * Only a component type will have this property and it represents the view options of a given component.
8050
8068
  */
8051
8069
  componentState?: Partial<ViewCreationOptions>;
8070
+ type: 'component';
8052
8071
  };
8053
8072
 
8054
8073
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
@@ -8132,10 +8151,7 @@ declare type LayoutIdentity = Identity_4 & {
8132
8151
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8133
8152
  type: 'layout-initialized';
8134
8153
  layoutIdentity: OpenFin.LayoutIdentity;
8135
- ofViews: {
8136
- identity: OpenFin.Identity;
8137
- entityType: 'view';
8138
- }[];
8154
+ ofViews: OpenFin.ViewCreationResult[];
8139
8155
  };
8140
8156
 
8141
8157
  /**
@@ -8243,7 +8259,7 @@ declare interface LayoutManager<T extends LayoutSnapshot> {
8243
8259
  /**
8244
8260
  * @experimental
8245
8261
  */
8246
- getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity;
8262
+ getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity | undefined;
8247
8263
  /**
8248
8264
  * @experimental
8249
8265
  */
@@ -9234,6 +9250,12 @@ declare type MutableWindowOptions = {
9234
9250
  * Shows the window's icon in the taskbar.
9235
9251
  */
9236
9252
  showTaskbarIcon: boolean;
9253
+ /**
9254
+ * Specify a taskbar group for the window.
9255
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
9256
+ * @remarks It's only updatable when `enableJumpList` is set to false.
9257
+ */
9258
+ taskbarIconGroup: string;
9237
9259
  interop: InteropConfig;
9238
9260
  /* Excluded from this release type: _internalWorkspaceData */
9239
9261
  /* Excluded from this release type: workspacePlatform */
@@ -9490,6 +9512,9 @@ declare namespace OpenFin {
9490
9512
  ViewOptions,
9491
9513
  ConstViewOptions,
9492
9514
  ViewState,
9515
+ ViewCreationSuccess,
9516
+ ViewCreationFailure,
9517
+ ViewCreationResult,
9493
9518
  Certificate,
9494
9519
  HostContextChangedPayload,
9495
9520
  ApplySnapshotOptions,
@@ -11291,6 +11316,45 @@ declare interface PlatformProvider {
11291
11316
  * @returns {Promise<void>}
11292
11317
  */
11293
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>;
11294
11358
  }
11295
11359
 
11296
11360
  /**
@@ -16053,6 +16117,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16053
16117
  options?: Partial<ViewOptions>;
16054
16118
  };
16055
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
+
16056
16138
  /**
16057
16139
  * The options object required by {@link View.ViewModule.create View.create}.
16058
16140
  *
@@ -16068,6 +16150,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16068
16150
 
16069
16151
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16070
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
+
16071
16172
  /**
16072
16173
  * Generated when a window has a view detached from it.
16073
16174
  * @remarks Will fire when a view is destroyed in which case `target` will be null.
@@ -3654,11 +3654,6 @@ declare type ConstWindowOptions = {
3654
3654
  * @deprecated - use `icon` instead.
3655
3655
  */
3656
3656
  taskbarIcon: string;
3657
- /**
3658
- * Specify a taskbar group for the window.
3659
- * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
3660
- */
3661
- taskbarIconGroup: string;
3662
3657
  /**
3663
3658
  * @defaultValue "about:blank"
3664
3659
  *
@@ -8028,6 +8023,29 @@ declare class Layout extends Base {
8028
8023
  * ```
8029
8024
  */
8030
8025
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
8026
+ /**
8027
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
8028
+ *
8029
+ * @param viewOptions - The options for creating the view.
8030
+ * @param options - Optional parameters for adding the view.
8031
+ * @param options.location - The location where the view should be added.
8032
+ * @param options.targetView - The target view to which the new view should be added.
8033
+ * @returns A promise that resolves to an object containing the identity of the added view.
8034
+ */
8035
+ addView(viewOptions: OpenFin.PlatformViewCreationOptions, { location, targetView }?: {
8036
+ location?: OpenFin.CreateViewTarget['location'];
8037
+ targetView?: OpenFin.Identity;
8038
+ }): Promise<{
8039
+ identity: OpenFin.Identity;
8040
+ }>;
8041
+ /**
8042
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
8043
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
8044
+ *
8045
+ * @param viewIdentity - The identity of the view to close.
8046
+ * @returns A promise that resolves when the view is closed.
8047
+ */
8048
+ closeView(viewIdentity: OpenFin.Identity): Promise<void>;
8031
8049
  }
8032
8050
 
8033
8051
  /**
@@ -8040,7 +8058,7 @@ declare type LayoutColumn = LayoutItemConfig & {
8040
8058
  /**
8041
8059
  * @interface
8042
8060
  */
8043
- declare type LayoutComponent = LayoutItemConfig & {
8061
+ declare type LayoutComponent = Omit<LayoutItemConfig, 'content' | 'type'> & {
8044
8062
  /**
8045
8063
  * Only a component type will have this property and it should be set to view.
8046
8064
  */
@@ -8049,6 +8067,7 @@ declare type LayoutComponent = LayoutItemConfig & {
8049
8067
  * Only a component type will have this property and it represents the view options of a given component.
8050
8068
  */
8051
8069
  componentState?: Partial<ViewCreationOptions>;
8070
+ type: 'component';
8052
8071
  };
8053
8072
 
8054
8073
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
@@ -8132,10 +8151,7 @@ declare type LayoutIdentity = Identity_4 & {
8132
8151
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8133
8152
  type: 'layout-initialized';
8134
8153
  layoutIdentity: OpenFin.LayoutIdentity;
8135
- ofViews: {
8136
- identity: OpenFin.Identity;
8137
- entityType: 'view';
8138
- }[];
8154
+ ofViews: OpenFin.ViewCreationResult[];
8139
8155
  };
8140
8156
 
8141
8157
  /**
@@ -8243,7 +8259,7 @@ declare interface LayoutManager<T extends LayoutSnapshot> {
8243
8259
  /**
8244
8260
  * @experimental
8245
8261
  */
8246
- getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity;
8262
+ getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity | undefined;
8247
8263
  /**
8248
8264
  * @experimental
8249
8265
  */
@@ -9234,6 +9250,12 @@ declare type MutableWindowOptions = {
9234
9250
  * Shows the window's icon in the taskbar.
9235
9251
  */
9236
9252
  showTaskbarIcon: boolean;
9253
+ /**
9254
+ * Specify a taskbar group for the window.
9255
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
9256
+ * @remarks It's only updatable when `enableJumpList` is set to false.
9257
+ */
9258
+ taskbarIconGroup: string;
9237
9259
  interop: InteropConfig;
9238
9260
  /* Excluded from this release type: _internalWorkspaceData */
9239
9261
  /* Excluded from this release type: workspacePlatform */
@@ -9490,6 +9512,9 @@ declare namespace OpenFin {
9490
9512
  ViewOptions,
9491
9513
  ConstViewOptions,
9492
9514
  ViewState,
9515
+ ViewCreationSuccess,
9516
+ ViewCreationFailure,
9517
+ ViewCreationResult,
9493
9518
  Certificate,
9494
9519
  HostContextChangedPayload,
9495
9520
  ApplySnapshotOptions,
@@ -11291,6 +11316,45 @@ declare interface PlatformProvider {
11291
11316
  * @returns {Promise<void>}
11292
11317
  */
11293
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>;
11294
11358
  }
11295
11359
 
11296
11360
  /**
@@ -16053,6 +16117,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16053
16117
  options?: Partial<ViewOptions>;
16054
16118
  };
16055
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
+
16056
16138
  /**
16057
16139
  * The options object required by {@link View.ViewModule.create View.create}.
16058
16140
  *
@@ -16068,6 +16150,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16068
16150
 
16069
16151
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16070
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
+
16071
16172
  /**
16072
16173
  * Generated when a window has a view detached from it.
16073
16174
  * @remarks Will fire when a view is destroyed in which case `target` will be null.
package/out/fdc3-api.d.ts CHANGED
@@ -3713,11 +3713,6 @@ declare type ConstWindowOptions = {
3713
3713
  * @deprecated - use `icon` instead.
3714
3714
  */
3715
3715
  taskbarIcon: string;
3716
- /**
3717
- * Specify a taskbar group for the window.
3718
- * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
3719
- */
3720
- taskbarIconGroup: string;
3721
3716
  /**
3722
3717
  * @defaultValue "about:blank"
3723
3718
  *
@@ -8154,6 +8149,29 @@ declare class Layout extends Base {
8154
8149
  * ```
8155
8150
  */
8156
8151
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
8152
+ /**
8153
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
8154
+ *
8155
+ * @param viewOptions - The options for creating the view.
8156
+ * @param options - Optional parameters for adding the view.
8157
+ * @param options.location - The location where the view should be added.
8158
+ * @param options.targetView - The target view to which the new view should be added.
8159
+ * @returns A promise that resolves to an object containing the identity of the added view.
8160
+ */
8161
+ addView(viewOptions: OpenFin.PlatformViewCreationOptions, { location, targetView }?: {
8162
+ location?: OpenFin.CreateViewTarget['location'];
8163
+ targetView?: OpenFin.Identity;
8164
+ }): Promise<{
8165
+ identity: OpenFin.Identity;
8166
+ }>;
8167
+ /**
8168
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
8169
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
8170
+ *
8171
+ * @param viewIdentity - The identity of the view to close.
8172
+ * @returns A promise that resolves when the view is closed.
8173
+ */
8174
+ closeView(viewIdentity: OpenFin.Identity): Promise<void>;
8157
8175
  }
8158
8176
 
8159
8177
  /**
@@ -8166,7 +8184,7 @@ declare type LayoutColumn = LayoutItemConfig & {
8166
8184
  /**
8167
8185
  * @interface
8168
8186
  */
8169
- declare type LayoutComponent = LayoutItemConfig & {
8187
+ declare type LayoutComponent = Omit<LayoutItemConfig, 'content' | 'type'> & {
8170
8188
  /**
8171
8189
  * Only a component type will have this property and it should be set to view.
8172
8190
  */
@@ -8175,6 +8193,7 @@ declare type LayoutComponent = LayoutItemConfig & {
8175
8193
  * Only a component type will have this property and it represents the view options of a given component.
8176
8194
  */
8177
8195
  componentState?: Partial<ViewCreationOptions>;
8196
+ type: 'component';
8178
8197
  };
8179
8198
 
8180
8199
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
@@ -8258,10 +8277,7 @@ declare type LayoutIdentity = Identity_4 & {
8258
8277
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8259
8278
  type: 'layout-initialized';
8260
8279
  layoutIdentity: OpenFin.LayoutIdentity;
8261
- ofViews: {
8262
- identity: OpenFin.Identity;
8263
- entityType: 'view';
8264
- }[];
8280
+ ofViews: OpenFin.ViewCreationResult[];
8265
8281
  };
8266
8282
 
8267
8283
  /**
@@ -8369,7 +8385,7 @@ declare interface LayoutManager<T extends LayoutSnapshot> {
8369
8385
  /**
8370
8386
  * @experimental
8371
8387
  */
8372
- getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity;
8388
+ getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity | undefined;
8373
8389
  /**
8374
8390
  * @experimental
8375
8391
  */
@@ -9534,6 +9550,12 @@ declare type MutableWindowOptions = {
9534
9550
  * Shows the window's icon in the taskbar.
9535
9551
  */
9536
9552
  showTaskbarIcon: boolean;
9553
+ /**
9554
+ * Specify a taskbar group for the window.
9555
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
9556
+ * @remarks It's only updatable when `enableJumpList` is set to false.
9557
+ */
9558
+ taskbarIconGroup: string;
9537
9559
  interop: InteropConfig;
9538
9560
  /**
9539
9561
  * @internal
@@ -9808,6 +9830,9 @@ declare namespace OpenFin {
9808
9830
  ViewOptions,
9809
9831
  ConstViewOptions,
9810
9832
  ViewState,
9833
+ ViewCreationSuccess,
9834
+ ViewCreationFailure,
9835
+ ViewCreationResult,
9811
9836
  Certificate,
9812
9837
  HostContextChangedPayload,
9813
9838
  ApplySnapshotOptions,
@@ -11692,6 +11717,45 @@ declare interface PlatformProvider {
11692
11717
  * @returns {Promise<void>}
11693
11718
  */
11694
11719
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11720
+ /**
11721
+ * @experimental
11722
+ *
11723
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11724
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11725
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11726
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11727
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11728
+ *
11729
+ * @param viewIdentity Identity of the view
11730
+ * @param error error thrown during a view creation
11731
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11732
+ *
11733
+ * @example
11734
+ *
11735
+ * ```js
11736
+ * const overrideCallback = (PlatformProvider) => {
11737
+ * class Override extends PlatformProvider {
11738
+ * async handleFailedViewCreation(viewIdentity, error) {
11739
+ * const view = fin.View.wrapSync(viewId);
11740
+ * try {
11741
+ * // navigate to an error page
11742
+ * await view.navigate('http://localhost:3000/errorPage.html');
11743
+ * // resolve a success result after redirecting to a error page
11744
+ * return {identity: viewIdentity, success: true};
11745
+ * } catch(e) {
11746
+ * // layout-initialized event will include this view with the error
11747
+ * throw error;
11748
+ * }
11749
+ * }
11750
+ * }
11751
+ * return new Override();
11752
+ * }
11753
+ *
11754
+ * fin.Platform.init({ overrideCallback });
11755
+ *
11756
+ * ```
11757
+ */
11758
+ handleFailedViewCreation(viewIdentity: OpenFin.Identity, error: Error): Promise<OpenFin.ViewCreationSuccess | void>;
11695
11759
  }
11696
11760
 
11697
11761
  /**
@@ -16504,6 +16568,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16504
16568
  options?: Partial<ViewOptions>;
16505
16569
  };
16506
16570
 
16571
+ /**
16572
+ * @interface
16573
+ */
16574
+ declare type ViewCreationFailure = {
16575
+ /**
16576
+ * The identity of the created view
16577
+ */
16578
+ identity: Identity_4;
16579
+ /**
16580
+ * Whether the view was created with errors
16581
+ */
16582
+ success: false;
16583
+ /**
16584
+ * Error thrown during view creation
16585
+ */
16586
+ error: Error;
16587
+ };
16588
+
16507
16589
  /**
16508
16590
  * The options object required by {@link View.ViewModule.create View.create}.
16509
16591
  *
@@ -16519,6 +16601,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16519
16601
 
16520
16602
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16521
16603
 
16604
+ /**
16605
+ * A view creation state
16606
+ */
16607
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16608
+
16609
+ /**
16610
+ * @interface
16611
+ */
16612
+ declare type ViewCreationSuccess = {
16613
+ /**
16614
+ * The identity of the created view
16615
+ */
16616
+ identity: Identity_4;
16617
+ /**
16618
+ * Whether the view was created without errors
16619
+ */
16620
+ success: true;
16621
+ };
16622
+
16522
16623
  /**
16523
16624
  * Generated when a window has a view detached from it.
16524
16625
  * @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": "40.82.20",
3
+ "version": "40.82.22",
4
4
  "description": "OpenFin fdc3 module utilities and types.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "private": false,