@openfin/fdc3-api 40.82.19 → 40.82.21

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
  *
@@ -4696,6 +4691,7 @@ declare interface Environment {
4696
4691
  getInteropInfo(fin: OpenFin.Fin<OpenFin.EntityType>): Promise<InternalInteropBrokerOptions & {
4697
4692
  fdc3Version?: Version;
4698
4693
  }>;
4694
+ getViewWindowIdentity(fin: OpenFin.Fin<OpenFin.EntityType>, identity: OpenFin.Identity): Promise<OpenFin.Identity>;
4699
4695
  readonly type: EnvironmentType;
4700
4696
  }
4701
4697
 
@@ -7863,6 +7859,7 @@ declare type LaunchIntoPlatformPayload = {
7863
7859
  */
7864
7860
  declare class Layout extends Base {
7865
7861
  #private;
7862
+ /* Excluded from this release type: getClient */
7866
7863
  /* Excluded from this release type: init */
7867
7864
  identity: OpenFin.Identity | OpenFin.LayoutIdentity;
7868
7865
  private platform;
@@ -7962,6 +7959,16 @@ declare class Layout extends Base {
7962
7959
  * ```
7963
7960
  */
7964
7961
  getRootItem(): Promise<OpenFin.ColumnOrRow | OpenFin.TabStack>;
7962
+ /**
7963
+ * Retrieves the OpenFin.TabStack instance which the View belongs to.
7964
+ *
7965
+ * @example
7966
+ * ```js
7967
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
7968
+ * const stack = await fin.View.wrapSync(viewIdentity).getStackByViewIdentity(viewIdentity);
7969
+ * console.log(await stack.getViews());
7970
+ * ```
7971
+ */
7965
7972
  getStackByViewIdentity(identity: OpenFin.Identity): Promise<OpenFin.TabStack>;
7966
7973
  /**
7967
7974
  * Replaces the specified view with a view with the provided configuration.
@@ -8120,10 +8127,7 @@ declare type LayoutIdentity = Identity_4 & {
8120
8127
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8121
8128
  type: 'layout-initialized';
8122
8129
  layoutIdentity: OpenFin.LayoutIdentity;
8123
- ofViews: {
8124
- identity: OpenFin.Identity;
8125
- entityType: 'view';
8126
- }[];
8130
+ ofViews: OpenFin.ViewCreationResult[];
8127
8131
  };
8128
8132
 
8129
8133
  /**
@@ -8332,6 +8336,17 @@ declare class LayoutModule extends Base {
8332
8336
  * ```
8333
8337
  */
8334
8338
  getCurrentSync(): OpenFin.Layout;
8339
+ /**
8340
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
8341
+ *
8342
+ * @example
8343
+ * ```js
8344
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
8345
+ * const layout = await fin.Platform.Layout.getLayoutByViewIdentity(viewIdentity);
8346
+ * console.log(await layout.getCurrentViews());
8347
+ * ```
8348
+ */
8349
+ getLayoutByViewIdentity(viewIdentity: OpenFin.Identity): Promise<OpenFin.Layout>;
8335
8350
  /**
8336
8351
  * Initialize the window's Layout.
8337
8352
  *
@@ -9211,6 +9226,12 @@ declare type MutableWindowOptions = {
9211
9226
  * Shows the window's icon in the taskbar.
9212
9227
  */
9213
9228
  showTaskbarIcon: boolean;
9229
+ /**
9230
+ * Specify a taskbar group for the window.
9231
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
9232
+ * @remarks It's only updatable when `enableJumpList` is set to false.
9233
+ */
9234
+ taskbarIconGroup: string;
9214
9235
  interop: InteropConfig;
9215
9236
  /* Excluded from this release type: _internalWorkspaceData */
9216
9237
  /* Excluded from this release type: workspacePlatform */
@@ -9467,6 +9488,9 @@ declare namespace OpenFin {
9467
9488
  ViewOptions,
9468
9489
  ConstViewOptions,
9469
9490
  ViewState,
9491
+ ViewCreationSuccess,
9492
+ ViewCreationFailure,
9493
+ ViewCreationResult,
9470
9494
  Certificate,
9471
9495
  HostContextChangedPayload,
9472
9496
  ApplySnapshotOptions,
@@ -11268,6 +11292,45 @@ declare interface PlatformProvider {
11268
11292
  * @returns {Promise<void>}
11269
11293
  */
11270
11294
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11295
+ /**
11296
+ * @experimental
11297
+ *
11298
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11299
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11300
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11301
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11302
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11303
+ *
11304
+ * @param viewIdentity Identity of the view
11305
+ * @param error error thrown during a view creation
11306
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11307
+ *
11308
+ * @example
11309
+ *
11310
+ * ```js
11311
+ * const overrideCallback = (PlatformProvider) => {
11312
+ * class Override extends PlatformProvider {
11313
+ * async handleFailedViewCreation(viewIdentity, error) {
11314
+ * const view = fin.View.wrapSync(viewId);
11315
+ * try {
11316
+ * // navigate to an error page
11317
+ * await view.navigate('http://localhost:3000/errorPage.html');
11318
+ * // resolve a success result after redirecting to a error page
11319
+ * return {identity: viewIdentity, success: true};
11320
+ * } catch(e) {
11321
+ * // layout-initialized event will include this view with the error
11322
+ * throw error;
11323
+ * }
11324
+ * }
11325
+ * }
11326
+ * return new Override();
11327
+ * }
11328
+ *
11329
+ * fin.Platform.init({ overrideCallback });
11330
+ *
11331
+ * ```
11332
+ */
11333
+ handleFailedViewCreation(viewIdentity: OpenFin.Identity, error: Error): Promise<OpenFin.ViewCreationSuccess | void>;
11271
11334
  }
11272
11335
 
11273
11336
  /**
@@ -15866,7 +15929,7 @@ declare class View_2 extends WebContents<OpenFin.ViewEvent> {
15866
15929
  */
15867
15930
  getInfo: () => Promise<OpenFin.ViewInfo>;
15868
15931
  /**
15869
- * Retrieves the layout for the window the view is attached to.
15932
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
15870
15933
  *
15871
15934
  * @example
15872
15935
  * ```js
@@ -16030,6 +16093,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16030
16093
  options?: Partial<ViewOptions>;
16031
16094
  };
16032
16095
 
16096
+ /**
16097
+ * @interface
16098
+ */
16099
+ declare type ViewCreationFailure = {
16100
+ /**
16101
+ * The identity of the created view
16102
+ */
16103
+ identity: Identity_4;
16104
+ /**
16105
+ * Whether the view was created with errors
16106
+ */
16107
+ success: false;
16108
+ /**
16109
+ * Error thrown during view creation
16110
+ */
16111
+ error: Error;
16112
+ };
16113
+
16033
16114
  /**
16034
16115
  * The options object required by {@link View.ViewModule.create View.create}.
16035
16116
  *
@@ -16045,6 +16126,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16045
16126
 
16046
16127
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16047
16128
 
16129
+ /**
16130
+ * A view creation state
16131
+ */
16132
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16133
+
16134
+ /**
16135
+ * @interface
16136
+ */
16137
+ declare type ViewCreationSuccess = {
16138
+ /**
16139
+ * The identity of the created view
16140
+ */
16141
+ identity: Identity_4;
16142
+ /**
16143
+ * Whether the view was created without errors
16144
+ */
16145
+ success: true;
16146
+ };
16147
+
16048
16148
  /**
16049
16149
  * Generated when a window has a view detached from it.
16050
16150
  * @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
  *
@@ -4696,6 +4691,7 @@ declare interface Environment {
4696
4691
  getInteropInfo(fin: OpenFin.Fin<OpenFin.EntityType>): Promise<InternalInteropBrokerOptions & {
4697
4692
  fdc3Version?: Version;
4698
4693
  }>;
4694
+ getViewWindowIdentity(fin: OpenFin.Fin<OpenFin.EntityType>, identity: OpenFin.Identity): Promise<OpenFin.Identity>;
4699
4695
  readonly type: EnvironmentType;
4700
4696
  }
4701
4697
 
@@ -7863,6 +7859,7 @@ declare type LaunchIntoPlatformPayload = {
7863
7859
  */
7864
7860
  declare class Layout extends Base {
7865
7861
  #private;
7862
+ /* Excluded from this release type: getClient */
7866
7863
  /* Excluded from this release type: init */
7867
7864
  identity: OpenFin.Identity | OpenFin.LayoutIdentity;
7868
7865
  private platform;
@@ -7962,6 +7959,16 @@ declare class Layout extends Base {
7962
7959
  * ```
7963
7960
  */
7964
7961
  getRootItem(): Promise<OpenFin.ColumnOrRow | OpenFin.TabStack>;
7962
+ /**
7963
+ * Retrieves the OpenFin.TabStack instance which the View belongs to.
7964
+ *
7965
+ * @example
7966
+ * ```js
7967
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
7968
+ * const stack = await fin.View.wrapSync(viewIdentity).getStackByViewIdentity(viewIdentity);
7969
+ * console.log(await stack.getViews());
7970
+ * ```
7971
+ */
7965
7972
  getStackByViewIdentity(identity: OpenFin.Identity): Promise<OpenFin.TabStack>;
7966
7973
  /**
7967
7974
  * Replaces the specified view with a view with the provided configuration.
@@ -8120,10 +8127,7 @@ declare type LayoutIdentity = Identity_4 & {
8120
8127
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8121
8128
  type: 'layout-initialized';
8122
8129
  layoutIdentity: OpenFin.LayoutIdentity;
8123
- ofViews: {
8124
- identity: OpenFin.Identity;
8125
- entityType: 'view';
8126
- }[];
8130
+ ofViews: OpenFin.ViewCreationResult[];
8127
8131
  };
8128
8132
 
8129
8133
  /**
@@ -8332,6 +8336,17 @@ declare class LayoutModule extends Base {
8332
8336
  * ```
8333
8337
  */
8334
8338
  getCurrentSync(): OpenFin.Layout;
8339
+ /**
8340
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
8341
+ *
8342
+ * @example
8343
+ * ```js
8344
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
8345
+ * const layout = await fin.Platform.Layout.getLayoutByViewIdentity(viewIdentity);
8346
+ * console.log(await layout.getCurrentViews());
8347
+ * ```
8348
+ */
8349
+ getLayoutByViewIdentity(viewIdentity: OpenFin.Identity): Promise<OpenFin.Layout>;
8335
8350
  /**
8336
8351
  * Initialize the window's Layout.
8337
8352
  *
@@ -9211,6 +9226,12 @@ declare type MutableWindowOptions = {
9211
9226
  * Shows the window's icon in the taskbar.
9212
9227
  */
9213
9228
  showTaskbarIcon: boolean;
9229
+ /**
9230
+ * Specify a taskbar group for the window.
9231
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
9232
+ * @remarks It's only updatable when `enableJumpList` is set to false.
9233
+ */
9234
+ taskbarIconGroup: string;
9214
9235
  interop: InteropConfig;
9215
9236
  /* Excluded from this release type: _internalWorkspaceData */
9216
9237
  /* Excluded from this release type: workspacePlatform */
@@ -9467,6 +9488,9 @@ declare namespace OpenFin {
9467
9488
  ViewOptions,
9468
9489
  ConstViewOptions,
9469
9490
  ViewState,
9491
+ ViewCreationSuccess,
9492
+ ViewCreationFailure,
9493
+ ViewCreationResult,
9470
9494
  Certificate,
9471
9495
  HostContextChangedPayload,
9472
9496
  ApplySnapshotOptions,
@@ -11268,6 +11292,45 @@ declare interface PlatformProvider {
11268
11292
  * @returns {Promise<void>}
11269
11293
  */
11270
11294
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11295
+ /**
11296
+ * @experimental
11297
+ *
11298
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11299
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11300
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11301
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11302
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11303
+ *
11304
+ * @param viewIdentity Identity of the view
11305
+ * @param error error thrown during a view creation
11306
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11307
+ *
11308
+ * @example
11309
+ *
11310
+ * ```js
11311
+ * const overrideCallback = (PlatformProvider) => {
11312
+ * class Override extends PlatformProvider {
11313
+ * async handleFailedViewCreation(viewIdentity, error) {
11314
+ * const view = fin.View.wrapSync(viewId);
11315
+ * try {
11316
+ * // navigate to an error page
11317
+ * await view.navigate('http://localhost:3000/errorPage.html');
11318
+ * // resolve a success result after redirecting to a error page
11319
+ * return {identity: viewIdentity, success: true};
11320
+ * } catch(e) {
11321
+ * // layout-initialized event will include this view with the error
11322
+ * throw error;
11323
+ * }
11324
+ * }
11325
+ * }
11326
+ * return new Override();
11327
+ * }
11328
+ *
11329
+ * fin.Platform.init({ overrideCallback });
11330
+ *
11331
+ * ```
11332
+ */
11333
+ handleFailedViewCreation(viewIdentity: OpenFin.Identity, error: Error): Promise<OpenFin.ViewCreationSuccess | void>;
11271
11334
  }
11272
11335
 
11273
11336
  /**
@@ -15866,7 +15929,7 @@ declare class View_2 extends WebContents<OpenFin.ViewEvent> {
15866
15929
  */
15867
15930
  getInfo: () => Promise<OpenFin.ViewInfo>;
15868
15931
  /**
15869
- * Retrieves the layout for the window the view is attached to.
15932
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
15870
15933
  *
15871
15934
  * @example
15872
15935
  * ```js
@@ -16030,6 +16093,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16030
16093
  options?: Partial<ViewOptions>;
16031
16094
  };
16032
16095
 
16096
+ /**
16097
+ * @interface
16098
+ */
16099
+ declare type ViewCreationFailure = {
16100
+ /**
16101
+ * The identity of the created view
16102
+ */
16103
+ identity: Identity_4;
16104
+ /**
16105
+ * Whether the view was created with errors
16106
+ */
16107
+ success: false;
16108
+ /**
16109
+ * Error thrown during view creation
16110
+ */
16111
+ error: Error;
16112
+ };
16113
+
16033
16114
  /**
16034
16115
  * The options object required by {@link View.ViewModule.create View.create}.
16035
16116
  *
@@ -16045,6 +16126,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16045
16126
 
16046
16127
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16047
16128
 
16129
+ /**
16130
+ * A view creation state
16131
+ */
16132
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16133
+
16134
+ /**
16135
+ * @interface
16136
+ */
16137
+ declare type ViewCreationSuccess = {
16138
+ /**
16139
+ * The identity of the created view
16140
+ */
16141
+ identity: Identity_4;
16142
+ /**
16143
+ * Whether the view was created without errors
16144
+ */
16145
+ success: true;
16146
+ };
16147
+
16048
16148
  /**
16049
16149
  * Generated when a window has a view detached from it.
16050
16150
  * @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
  *
@@ -4696,6 +4691,7 @@ declare interface Environment {
4696
4691
  getInteropInfo(fin: OpenFin.Fin<OpenFin.EntityType>): Promise<InternalInteropBrokerOptions & {
4697
4692
  fdc3Version?: Version;
4698
4693
  }>;
4694
+ getViewWindowIdentity(fin: OpenFin.Fin<OpenFin.EntityType>, identity: OpenFin.Identity): Promise<OpenFin.Identity>;
4699
4695
  readonly type: EnvironmentType;
4700
4696
  }
4701
4697
 
@@ -7863,6 +7859,7 @@ declare type LaunchIntoPlatformPayload = {
7863
7859
  */
7864
7860
  declare class Layout extends Base {
7865
7861
  #private;
7862
+ /* Excluded from this release type: getClient */
7866
7863
  /* Excluded from this release type: init */
7867
7864
  identity: OpenFin.Identity | OpenFin.LayoutIdentity;
7868
7865
  private platform;
@@ -7962,6 +7959,16 @@ declare class Layout extends Base {
7962
7959
  * ```
7963
7960
  */
7964
7961
  getRootItem(): Promise<OpenFin.ColumnOrRow | OpenFin.TabStack>;
7962
+ /**
7963
+ * Retrieves the OpenFin.TabStack instance which the View belongs to.
7964
+ *
7965
+ * @example
7966
+ * ```js
7967
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
7968
+ * const stack = await fin.View.wrapSync(viewIdentity).getStackByViewIdentity(viewIdentity);
7969
+ * console.log(await stack.getViews());
7970
+ * ```
7971
+ */
7965
7972
  getStackByViewIdentity(identity: OpenFin.Identity): Promise<OpenFin.TabStack>;
7966
7973
  /**
7967
7974
  * Replaces the specified view with a view with the provided configuration.
@@ -8120,10 +8127,7 @@ declare type LayoutIdentity = Identity_4 & {
8120
8127
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8121
8128
  type: 'layout-initialized';
8122
8129
  layoutIdentity: OpenFin.LayoutIdentity;
8123
- ofViews: {
8124
- identity: OpenFin.Identity;
8125
- entityType: 'view';
8126
- }[];
8130
+ ofViews: OpenFin.ViewCreationResult[];
8127
8131
  };
8128
8132
 
8129
8133
  /**
@@ -8332,6 +8336,17 @@ declare class LayoutModule extends Base {
8332
8336
  * ```
8333
8337
  */
8334
8338
  getCurrentSync(): OpenFin.Layout;
8339
+ /**
8340
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
8341
+ *
8342
+ * @example
8343
+ * ```js
8344
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
8345
+ * const layout = await fin.Platform.Layout.getLayoutByViewIdentity(viewIdentity);
8346
+ * console.log(await layout.getCurrentViews());
8347
+ * ```
8348
+ */
8349
+ getLayoutByViewIdentity(viewIdentity: OpenFin.Identity): Promise<OpenFin.Layout>;
8335
8350
  /**
8336
8351
  * Initialize the window's Layout.
8337
8352
  *
@@ -9211,6 +9226,12 @@ declare type MutableWindowOptions = {
9211
9226
  * Shows the window's icon in the taskbar.
9212
9227
  */
9213
9228
  showTaskbarIcon: boolean;
9229
+ /**
9230
+ * Specify a taskbar group for the window.
9231
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
9232
+ * @remarks It's only updatable when `enableJumpList` is set to false.
9233
+ */
9234
+ taskbarIconGroup: string;
9214
9235
  interop: InteropConfig;
9215
9236
  /* Excluded from this release type: _internalWorkspaceData */
9216
9237
  /* Excluded from this release type: workspacePlatform */
@@ -9467,6 +9488,9 @@ declare namespace OpenFin {
9467
9488
  ViewOptions,
9468
9489
  ConstViewOptions,
9469
9490
  ViewState,
9491
+ ViewCreationSuccess,
9492
+ ViewCreationFailure,
9493
+ ViewCreationResult,
9470
9494
  Certificate,
9471
9495
  HostContextChangedPayload,
9472
9496
  ApplySnapshotOptions,
@@ -11268,6 +11292,45 @@ declare interface PlatformProvider {
11268
11292
  * @returns {Promise<void>}
11269
11293
  */
11270
11294
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11295
+ /**
11296
+ * @experimental
11297
+ *
11298
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11299
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11300
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11301
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11302
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11303
+ *
11304
+ * @param viewIdentity Identity of the view
11305
+ * @param error error thrown during a view creation
11306
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11307
+ *
11308
+ * @example
11309
+ *
11310
+ * ```js
11311
+ * const overrideCallback = (PlatformProvider) => {
11312
+ * class Override extends PlatformProvider {
11313
+ * async handleFailedViewCreation(viewIdentity, error) {
11314
+ * const view = fin.View.wrapSync(viewId);
11315
+ * try {
11316
+ * // navigate to an error page
11317
+ * await view.navigate('http://localhost:3000/errorPage.html');
11318
+ * // resolve a success result after redirecting to a error page
11319
+ * return {identity: viewIdentity, success: true};
11320
+ * } catch(e) {
11321
+ * // layout-initialized event will include this view with the error
11322
+ * throw error;
11323
+ * }
11324
+ * }
11325
+ * }
11326
+ * return new Override();
11327
+ * }
11328
+ *
11329
+ * fin.Platform.init({ overrideCallback });
11330
+ *
11331
+ * ```
11332
+ */
11333
+ handleFailedViewCreation(viewIdentity: OpenFin.Identity, error: Error): Promise<OpenFin.ViewCreationSuccess | void>;
11271
11334
  }
11272
11335
 
11273
11336
  /**
@@ -15866,7 +15929,7 @@ declare class View_2 extends WebContents<OpenFin.ViewEvent> {
15866
15929
  */
15867
15930
  getInfo: () => Promise<OpenFin.ViewInfo>;
15868
15931
  /**
15869
- * Retrieves the layout for the window the view is attached to.
15932
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
15870
15933
  *
15871
15934
  * @example
15872
15935
  * ```js
@@ -16030,6 +16093,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16030
16093
  options?: Partial<ViewOptions>;
16031
16094
  };
16032
16095
 
16096
+ /**
16097
+ * @interface
16098
+ */
16099
+ declare type ViewCreationFailure = {
16100
+ /**
16101
+ * The identity of the created view
16102
+ */
16103
+ identity: Identity_4;
16104
+ /**
16105
+ * Whether the view was created with errors
16106
+ */
16107
+ success: false;
16108
+ /**
16109
+ * Error thrown during view creation
16110
+ */
16111
+ error: Error;
16112
+ };
16113
+
16033
16114
  /**
16034
16115
  * The options object required by {@link View.ViewModule.create View.create}.
16035
16116
  *
@@ -16045,6 +16126,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16045
16126
 
16046
16127
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16047
16128
 
16129
+ /**
16130
+ * A view creation state
16131
+ */
16132
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16133
+
16134
+ /**
16135
+ * @interface
16136
+ */
16137
+ declare type ViewCreationSuccess = {
16138
+ /**
16139
+ * The identity of the created view
16140
+ */
16141
+ identity: Identity_4;
16142
+ /**
16143
+ * Whether the view was created without errors
16144
+ */
16145
+ success: true;
16146
+ };
16147
+
16048
16148
  /**
16049
16149
  * Generated when a window has a view detached from it.
16050
16150
  * @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
  *
@@ -4760,6 +4755,7 @@ declare interface Environment {
4760
4755
  getInteropInfo(fin: OpenFin.Fin<OpenFin.EntityType>): Promise<InternalInteropBrokerOptions & {
4761
4756
  fdc3Version?: Version;
4762
4757
  }>;
4758
+ getViewWindowIdentity(fin: OpenFin.Fin<OpenFin.EntityType>, identity: OpenFin.Identity): Promise<OpenFin.Identity>;
4763
4759
  readonly type: EnvironmentType;
4764
4760
  }
4765
4761
 
@@ -7980,6 +7976,10 @@ declare type LaunchIntoPlatformPayload = {
7980
7976
  */
7981
7977
  declare class Layout extends Base {
7982
7978
  #private;
7979
+ /**
7980
+ * @internal
7981
+ */
7982
+ static getClient(layout: Layout): Promise<LayoutEntitiesClient>;
7983
7983
  /**
7984
7984
  * @internal
7985
7985
  */
@@ -8085,6 +8085,16 @@ declare class Layout extends Base {
8085
8085
  * ```
8086
8086
  */
8087
8087
  getRootItem(): Promise<OpenFin.ColumnOrRow | OpenFin.TabStack>;
8088
+ /**
8089
+ * Retrieves the OpenFin.TabStack instance which the View belongs to.
8090
+ *
8091
+ * @example
8092
+ * ```js
8093
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
8094
+ * const stack = await fin.View.wrapSync(viewIdentity).getStackByViewIdentity(viewIdentity);
8095
+ * console.log(await stack.getViews());
8096
+ * ```
8097
+ */
8088
8098
  getStackByViewIdentity(identity: OpenFin.Identity): Promise<OpenFin.TabStack>;
8089
8099
  /**
8090
8100
  * Replaces the specified view with a view with the provided configuration.
@@ -8243,10 +8253,7 @@ declare type LayoutIdentity = Identity_4 & {
8243
8253
  declare type LayoutInitializedEvent = BaseEvent_5 & {
8244
8254
  type: 'layout-initialized';
8245
8255
  layoutIdentity: OpenFin.LayoutIdentity;
8246
- ofViews: {
8247
- identity: OpenFin.Identity;
8248
- entityType: 'view';
8249
- }[];
8256
+ ofViews: OpenFin.ViewCreationResult[];
8250
8257
  };
8251
8258
 
8252
8259
  /**
@@ -8455,6 +8462,17 @@ declare class LayoutModule extends Base {
8455
8462
  * ```
8456
8463
  */
8457
8464
  getCurrentSync(): OpenFin.Layout;
8465
+ /**
8466
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
8467
+ *
8468
+ * @example
8469
+ * ```js
8470
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
8471
+ * const layout = await fin.Platform.Layout.getLayoutByViewIdentity(viewIdentity);
8472
+ * console.log(await layout.getCurrentViews());
8473
+ * ```
8474
+ */
8475
+ getLayoutByViewIdentity(viewIdentity: OpenFin.Identity): Promise<OpenFin.Layout>;
8458
8476
  /**
8459
8477
  * Initialize the window's Layout.
8460
8478
  *
@@ -9508,6 +9526,12 @@ declare type MutableWindowOptions = {
9508
9526
  * Shows the window's icon in the taskbar.
9509
9527
  */
9510
9528
  showTaskbarIcon: boolean;
9529
+ /**
9530
+ * Specify a taskbar group for the window.
9531
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
9532
+ * @remarks It's only updatable when `enableJumpList` is set to false.
9533
+ */
9534
+ taskbarIconGroup: string;
9511
9535
  interop: InteropConfig;
9512
9536
  /**
9513
9537
  * @internal
@@ -9782,6 +9806,9 @@ declare namespace OpenFin {
9782
9806
  ViewOptions,
9783
9807
  ConstViewOptions,
9784
9808
  ViewState,
9809
+ ViewCreationSuccess,
9810
+ ViewCreationFailure,
9811
+ ViewCreationResult,
9785
9812
  Certificate,
9786
9813
  HostContextChangedPayload,
9787
9814
  ApplySnapshotOptions,
@@ -11666,6 +11693,45 @@ declare interface PlatformProvider {
11666
11693
  * @returns {Promise<void>}
11667
11694
  */
11668
11695
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11696
+ /**
11697
+ * @experimental
11698
+ *
11699
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11700
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11701
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11702
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11703
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11704
+ *
11705
+ * @param viewIdentity Identity of the view
11706
+ * @param error error thrown during a view creation
11707
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11708
+ *
11709
+ * @example
11710
+ *
11711
+ * ```js
11712
+ * const overrideCallback = (PlatformProvider) => {
11713
+ * class Override extends PlatformProvider {
11714
+ * async handleFailedViewCreation(viewIdentity, error) {
11715
+ * const view = fin.View.wrapSync(viewId);
11716
+ * try {
11717
+ * // navigate to an error page
11718
+ * await view.navigate('http://localhost:3000/errorPage.html');
11719
+ * // resolve a success result after redirecting to a error page
11720
+ * return {identity: viewIdentity, success: true};
11721
+ * } catch(e) {
11722
+ * // layout-initialized event will include this view with the error
11723
+ * throw error;
11724
+ * }
11725
+ * }
11726
+ * }
11727
+ * return new Override();
11728
+ * }
11729
+ *
11730
+ * fin.Platform.init({ overrideCallback });
11731
+ *
11732
+ * ```
11733
+ */
11734
+ handleFailedViewCreation(viewIdentity: OpenFin.Identity, error: Error): Promise<OpenFin.ViewCreationSuccess | void>;
11669
11735
  }
11670
11736
 
11671
11737
  /**
@@ -16280,7 +16346,7 @@ declare class View_2 extends WebContents<OpenFin.ViewEvent> {
16280
16346
  */
16281
16347
  getInfo: () => Promise<OpenFin.ViewInfo>;
16282
16348
  /**
16283
- * Retrieves the layout for the window the view is attached to.
16349
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
16284
16350
  *
16285
16351
  * @example
16286
16352
  * ```js
@@ -16478,6 +16544,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16478
16544
  options?: Partial<ViewOptions>;
16479
16545
  };
16480
16546
 
16547
+ /**
16548
+ * @interface
16549
+ */
16550
+ declare type ViewCreationFailure = {
16551
+ /**
16552
+ * The identity of the created view
16553
+ */
16554
+ identity: Identity_4;
16555
+ /**
16556
+ * Whether the view was created with errors
16557
+ */
16558
+ success: false;
16559
+ /**
16560
+ * Error thrown during view creation
16561
+ */
16562
+ error: Error;
16563
+ };
16564
+
16481
16565
  /**
16482
16566
  * The options object required by {@link View.ViewModule.create View.create}.
16483
16567
  *
@@ -16493,6 +16577,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16493
16577
 
16494
16578
  declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
16495
16579
 
16580
+ /**
16581
+ * A view creation state
16582
+ */
16583
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16584
+
16585
+ /**
16586
+ * @interface
16587
+ */
16588
+ declare type ViewCreationSuccess = {
16589
+ /**
16590
+ * The identity of the created view
16591
+ */
16592
+ identity: Identity_4;
16593
+ /**
16594
+ * Whether the view was created without errors
16595
+ */
16596
+ success: true;
16597
+ };
16598
+
16496
16599
  /**
16497
16600
  * Generated when a window has a view detached from it.
16498
16601
  * @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.19",
3
+ "version": "40.82.21",
4
4
  "description": "OpenFin fdc3 module utilities and types.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "private": false,