@openfin/core 40.82.19 → 40.82.21

Sign up to get free protection for your applications and to get access to all the features.
package/out/mock.d.ts CHANGED
@@ -3716,11 +3716,6 @@ declare type ConstWindowOptions = {
3716
3716
  * @deprecated - use `icon` instead.
3717
3717
  */
3718
3718
  taskbarIcon: string;
3719
- /**
3720
- * Specify a taskbar group for the window.
3721
- * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
3722
- */
3723
- taskbarIconGroup: string;
3724
3719
  /**
3725
3720
  * @defaultValue "about:blank"
3726
3721
  *
@@ -4763,6 +4758,7 @@ declare interface Environment {
4763
4758
  getInteropInfo(fin: OpenFin_2.Fin<OpenFin_2.EntityType>): Promise<InternalInteropBrokerOptions & {
4764
4759
  fdc3Version?: Version;
4765
4760
  }>;
4761
+ getViewWindowIdentity(fin: OpenFin_2.Fin<OpenFin_2.EntityType>, identity: OpenFin_2.Identity): Promise<OpenFin_2.Identity>;
4766
4762
  readonly type: EnvironmentType;
4767
4763
  }
4768
4764
 
@@ -7638,6 +7634,10 @@ declare type LaunchIntoPlatformPayload = {
7638
7634
  */
7639
7635
  declare class Layout extends Base {
7640
7636
  #private;
7637
+ /**
7638
+ * @internal
7639
+ */
7640
+ static getClient(layout: Layout): Promise<LayoutEntitiesClient>;
7641
7641
  /**
7642
7642
  * @internal
7643
7643
  */
@@ -7743,6 +7743,16 @@ declare class Layout extends Base {
7743
7743
  * ```
7744
7744
  */
7745
7745
  getRootItem(): Promise<OpenFin_2.ColumnOrRow | OpenFin_2.TabStack>;
7746
+ /**
7747
+ * Retrieves the OpenFin.TabStack instance which the View belongs to.
7748
+ *
7749
+ * @example
7750
+ * ```js
7751
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
7752
+ * const stack = await fin.View.wrapSync(viewIdentity).getStackByViewIdentity(viewIdentity);
7753
+ * console.log(await stack.getViews());
7754
+ * ```
7755
+ */
7746
7756
  getStackByViewIdentity(identity: OpenFin_2.Identity): Promise<OpenFin_2.TabStack>;
7747
7757
  /**
7748
7758
  * Replaces the specified view with a view with the provided configuration.
@@ -7901,10 +7911,7 @@ declare type LayoutIdentity = Identity_4 & {
7901
7911
  declare type LayoutInitializedEvent = BaseEvent_5 & {
7902
7912
  type: 'layout-initialized';
7903
7913
  layoutIdentity: OpenFin_2.LayoutIdentity;
7904
- ofViews: {
7905
- identity: OpenFin_2.Identity;
7906
- entityType: 'view';
7907
- }[];
7914
+ ofViews: OpenFin_2.ViewCreationResult[];
7908
7915
  };
7909
7916
 
7910
7917
  /**
@@ -8113,6 +8120,17 @@ declare class LayoutModule extends Base {
8113
8120
  * ```
8114
8121
  */
8115
8122
  getCurrentSync(): OpenFin_2.Layout;
8123
+ /**
8124
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
8125
+ *
8126
+ * @example
8127
+ * ```js
8128
+ * const viewIdentity = { uuid: 'uuid', name: 'view-name' };
8129
+ * const layout = await fin.Platform.Layout.getLayoutByViewIdentity(viewIdentity);
8130
+ * console.log(await layout.getCurrentViews());
8131
+ * ```
8132
+ */
8133
+ getLayoutByViewIdentity(viewIdentity: OpenFin_2.Identity): Promise<OpenFin_2.Layout>;
8116
8134
  /**
8117
8135
  * Initialize the window's Layout.
8118
8136
  *
@@ -9166,6 +9184,12 @@ declare type MutableWindowOptions = {
9166
9184
  * Shows the window's icon in the taskbar.
9167
9185
  */
9168
9186
  showTaskbarIcon: boolean;
9187
+ /**
9188
+ * Specify a taskbar group for the window.
9189
+ * _If omitted, defaults to app's uuid (`fin.Application.getCurrentSync().identity.uuid`)._
9190
+ * @remarks It's only updatable when `enableJumpList` is set to false.
9191
+ */
9192
+ taskbarIconGroup: string;
9169
9193
  interop: InteropConfig;
9170
9194
  /**
9171
9195
  * @internal
@@ -9440,6 +9464,9 @@ declare namespace OpenFin_2 {
9440
9464
  ViewOptions,
9441
9465
  ConstViewOptions,
9442
9466
  ViewState,
9467
+ ViewCreationSuccess,
9468
+ ViewCreationFailure,
9469
+ ViewCreationResult,
9443
9470
  Certificate,
9444
9471
  HostContextChangedPayload,
9445
9472
  ApplySnapshotOptions,
@@ -11326,6 +11353,45 @@ declare interface PlatformProvider {
11326
11353
  * @returns {Promise<void>}
11327
11354
  */
11328
11355
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11356
+ /**
11357
+ * @experimental
11358
+ *
11359
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11360
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11361
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11362
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11363
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11364
+ *
11365
+ * @param viewIdentity Identity of the view
11366
+ * @param error error thrown during a view creation
11367
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11368
+ *
11369
+ * @example
11370
+ *
11371
+ * ```js
11372
+ * const overrideCallback = (PlatformProvider) => {
11373
+ * class Override extends PlatformProvider {
11374
+ * async handleFailedViewCreation(viewIdentity, error) {
11375
+ * const view = fin.View.wrapSync(viewId);
11376
+ * try {
11377
+ * // navigate to an error page
11378
+ * await view.navigate('http://localhost:3000/errorPage.html');
11379
+ * // resolve a success result after redirecting to a error page
11380
+ * return {identity: viewIdentity, success: true};
11381
+ * } catch(e) {
11382
+ * // layout-initialized event will include this view with the error
11383
+ * throw error;
11384
+ * }
11385
+ * }
11386
+ * }
11387
+ * return new Override();
11388
+ * }
11389
+ *
11390
+ * fin.Platform.init({ overrideCallback });
11391
+ *
11392
+ * ```
11393
+ */
11394
+ handleFailedViewCreation(viewIdentity: OpenFin_2.Identity, error: Error): Promise<OpenFin_2.ViewCreationSuccess | void>;
11329
11395
  }
11330
11396
 
11331
11397
  /**
@@ -15834,7 +15900,7 @@ declare class View_2 extends WebContents<OpenFin_2.ViewEvent> {
15834
15900
  */
15835
15901
  getInfo: () => Promise<OpenFin_2.ViewInfo>;
15836
15902
  /**
15837
- * Retrieves the layout for the window the view is attached to.
15903
+ * Retrieves the OpenFin.Layout instance for the Window the View is attached to.
15838
15904
  *
15839
15905
  * @example
15840
15906
  * ```js
@@ -16032,6 +16098,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
16032
16098
  options?: Partial<ViewOptions>;
16033
16099
  };
16034
16100
 
16101
+ /**
16102
+ * @interface
16103
+ */
16104
+ declare type ViewCreationFailure = {
16105
+ /**
16106
+ * The identity of the created view
16107
+ */
16108
+ identity: Identity_4;
16109
+ /**
16110
+ * Whether the view was created with errors
16111
+ */
16112
+ success: false;
16113
+ /**
16114
+ * Error thrown during view creation
16115
+ */
16116
+ error: Error;
16117
+ };
16118
+
16035
16119
  /**
16036
16120
  * The options object required by {@link View.ViewModule.create View.create}.
16037
16121
  *
@@ -16047,6 +16131,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
16047
16131
 
16048
16132
  declare type ViewCreationOrReference = OpenFin_2.Identity | OpenFin_2.PlatformViewCreationOptions;
16049
16133
 
16134
+ /**
16135
+ * A view creation state
16136
+ */
16137
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
16138
+
16139
+ /**
16140
+ * @interface
16141
+ */
16142
+ declare type ViewCreationSuccess = {
16143
+ /**
16144
+ * The identity of the created view
16145
+ */
16146
+ identity: Identity_4;
16147
+ /**
16148
+ * Whether the view was created without errors
16149
+ */
16150
+ success: true;
16151
+ };
16152
+
16050
16153
  /**
16051
16154
  * Generated when a window has a view detached from it.
16052
16155
  * @remarks Will fire when a view is destroyed in which case `target` will be null.