@openfin/core 39.83.4 → 39.83.7

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.
@@ -2940,6 +2940,18 @@ declare type ChildWindowCreatedEvent = ContentCreationRulesEvent & {
2940
2940
  childOptions: OpenFin_2.WindowOptions;
2941
2941
  };
2942
2942
 
2943
+ /**
2944
+ * Control behavior for Chromium policies
2945
+ *
2946
+ * @interface
2947
+ */
2948
+ declare type ChromiumPolicies = {
2949
+ /**
2950
+ * Disable AutofillAddressEnabled policy for a Window or View.
2951
+ */
2952
+ AutofillAddressEnabled?: PolicyOptions;
2953
+ };
2954
+
2943
2955
  declare interface ClassicProtocolOffer extends ProtocolPacketBase {
2944
2956
  type: 'classic';
2945
2957
  }
@@ -3451,6 +3463,10 @@ declare type ConstViewOptions = {
3451
3463
  */
3452
3464
  enabled: boolean;
3453
3465
  };
3466
+ /**
3467
+ * Control which options to ignore when creating a Platform View.
3468
+ */
3469
+ excludeOptions: ExcludeOptions;
3454
3470
  };
3455
3471
 
3456
3472
  /**
@@ -3695,6 +3711,10 @@ declare type ConstWindowOptions = {
3695
3711
  * Controls whether an option is inherited from the parent application. The option is set as part of the window options for the parent application in either the {@link Manifest.startup_app} or {@link Manifest.platform} properties in the manifest or in {@link ApplicationOptions.mainWindowOptions} when calling {@link Application.ApplicationModule.start Application.start}. Use { [option]: false } to disable a specific [option]. All inheritable properties will be inherited by default if omitted.
3696
3712
  */
3697
3713
  inheritance?: Partial<InheritableOptions>;
3714
+ /**
3715
+ * Control which options to ignore when creating a Platform Window.
3716
+ */
3717
+ excludeOptions: ExcludeOptions;
3698
3718
  };
3699
3719
 
3700
3720
  /**
@@ -4729,7 +4749,7 @@ declare type Event_10 = ApplicationEvents.Event | ApiReadyEvent | SnapshotApplie
4729
4749
  * under the {@link OpenFin.SystemEvents} namespace (payloads inherited from propagated events are defined in the namespace
4730
4750
  * from which they propagate).
4731
4751
  */
4732
- declare type Event_11 = ExcludeRequested<WindowEvents.PropagatedEvent<'system'>> | ExcludeRequested<ViewEvents.PropagatedEvent<'system'>> | ExcludeRequested<ApplicationEvents.PropagatedEvent<'system'>> | ApplicationCreatedEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent | AppVersionEventWithId | SystemShutdownEvent;
4752
+ declare type Event_11 = ExcludeRequested<WindowEvents.PropagatedEvent<'system'>> | ExcludeRequested<ViewEvents.PropagatedEvent<'system'>> | ExcludeRequested<ApplicationEvents.PropagatedEvent<'system'>> | ApplicationCreatedEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent | AppVersionEventWithId | SystemShutdownEvent | ExtensionsEnabledEvent | ExtensionsDisabledEvent | ExtensionsExcludedEvent | ExtensionsInstalledEvent | ExtensionInstalledEvent | ExtensionsInstallFailedEvent | ExtensionInstallFailedEvent | ExtensionsInitializationFailedEvent;
4733
4753
 
4734
4754
  /**
4735
4755
  * [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing every possible event that can be emitted by the HTMLElement Layout container.
@@ -4874,6 +4894,18 @@ declare type EventType_9 = Event_12['type'];
4874
4894
 
4875
4895
  /* Excluded from this release type: EventWithId */
4876
4896
 
4897
+ /**
4898
+ * @interface
4899
+ */
4900
+ declare type ExcludeOptions = {
4901
+ /**
4902
+ * @defaultValue false
4903
+ *
4904
+ * When true, will not merge default preload scripts from {@link ApplicationOptions.defaultWindowOptions} or {@link ApplicationOptions.defaultViewOptions}.
4905
+ */
4906
+ preloadScripts: boolean;
4907
+ };
4908
+
4877
4909
  /* Excluded from this release type: ExcludeRequested */
4878
4910
 
4879
4911
  declare type ExistingConnectConfig = ConfigWithUuid & {
@@ -4889,6 +4921,105 @@ declare type ExitCode = {
4889
4921
  exitCode: number;
4890
4922
  };
4891
4923
 
4924
+ declare type ExtensionEvent = SecurityRealmEvent & {
4925
+ /**
4926
+ * Runtime extension whose status has been (possibly) modified
4927
+ */
4928
+ extension: string;
4929
+ };
4930
+
4931
+ /**
4932
+ * @interface
4933
+ */
4934
+ declare type ExtensionInfo = {
4935
+ extensionId: string;
4936
+ name: string;
4937
+ enabled: boolean;
4938
+ };
4939
+
4940
+ /**
4941
+ * An event that fires when an extension is installed in the security realm.
4942
+ *
4943
+ * @interface
4944
+ */
4945
+ declare type ExtensionInstalledEvent = ExtensionEvent & {
4946
+ type: 'extension-installed';
4947
+ };
4948
+
4949
+ /**
4950
+ * An event that fires when an extension fails to install in the security realm.
4951
+ *
4952
+ * @interface
4953
+ */
4954
+ declare type ExtensionInstallFailedEvent = ExtensionEvent & {
4955
+ type: 'extension-install-failed';
4956
+ };
4957
+
4958
+ /**
4959
+ * An event that fires when extensions are disabled in the security realm.
4960
+ *
4961
+ * @interface
4962
+ */
4963
+ declare type ExtensionsDisabledEvent = ExtensionsEvent & {
4964
+ type: 'extensions-disabled';
4965
+ };
4966
+
4967
+ /**
4968
+ * An event that fires when extensions are enabled in the security realm.
4969
+ *
4970
+ * @interface
4971
+ */
4972
+ declare type ExtensionsEnabledEvent = ExtensionsEvent & {
4973
+ type: 'extensions-enabled';
4974
+ };
4975
+
4976
+ declare type ExtensionsEvent = SecurityRealmEvent & {
4977
+ /**
4978
+ * Runtime extensions whose status has been (possibly) modified
4979
+ */
4980
+ extensions: string[];
4981
+ };
4982
+
4983
+ /**
4984
+ * An event that fires when requested extensions are not allowed to be installed in the security realm.
4985
+ *
4986
+ * @interface
4987
+ */
4988
+ declare type ExtensionsExcludedEvent = ExtensionsEvent & {
4989
+ type: 'extensions-excluded';
4990
+ };
4991
+
4992
+ /**
4993
+ * An event that fires when extension initialization fails on initial app launch. Users may attempt to
4994
+ * re-initialize extensions by calling {@link System.refreshExtensions}. This event will not fire in response
4995
+ * to manual extension refreshes (users should catch the error normally).
4996
+ */
4997
+ declare type ExtensionsInitializationFailedEvent = Omit<ExtensionsEvent, 'extensions'> & {
4998
+ type: 'extensions-initialization-failed';
4999
+ /**
5000
+ * The error that caused the extension initialization failure
5001
+ */
5002
+ error: Error;
5003
+ };
5004
+
5005
+ /**
5006
+ * An event that fires when extensions are installed in the security realm.
5007
+ *
5008
+ * @interface
5009
+ */
5010
+ declare type ExtensionsInstalledEvent = ExtensionsEvent & {
5011
+ type: 'extensions-installed';
5012
+ };
5013
+
5014
+ /**
5015
+ * An event that fires when extensions fail to install in the security realm.
5016
+ *
5017
+ * @interface
5018
+ */
5019
+ declare type ExtensionsInstallFailedEvent = ExtensionsEvent & {
5020
+ type: 'extensions-install-failed';
5021
+ };
5022
+
4892
5023
  /**
4893
5024
  * An ExternalApplication object representing native language adapter connections to the runtime. Allows
4894
5025
  * the developer to listen to {@link OpenFin.ExternalApplicationEvents external application events}.
@@ -7682,6 +7813,29 @@ declare class Layout extends Base {
7682
7813
  * ```
7683
7814
  */
7684
7815
  applyPreset: (options: PresetLayoutOptions) => Promise<void>;
7816
+ /**
7817
+ * Adds a view to the platform layout. Behaves like @link{Platform#createView} with the current layout as the target.
7818
+ *
7819
+ * @param viewOptions - The options for creating the view.
7820
+ * @param options - Optional parameters for adding the view.
7821
+ * @param options.location - The location where the view should be added.
7822
+ * @param options.targetView - The target view to which the new view should be added.
7823
+ * @returns A promise that resolves to an object containing the identity of the added view.
7824
+ */
7825
+ addView(viewOptions: OpenFin_2.PlatformViewCreationOptions, { location, targetView }?: {
7826
+ location?: OpenFin_2.CreateViewTarget['location'];
7827
+ targetView?: OpenFin_2.Identity;
7828
+ }): Promise<{
7829
+ identity: OpenFin_2.Identity;
7830
+ }>;
7831
+ /**
7832
+ * Closes a view by its identity. Throws an error if the view does not belong to the current layout.
7833
+ * Behaves like @link{Platform#closeView} but only closes the view if it belongs the current layout.
7834
+ *
7835
+ * @param viewIdentity - The identity of the view to close.
7836
+ * @returns A promise that resolves when the view is closed.
7837
+ */
7838
+ closeView(viewIdentity: OpenFin_2.Identity): Promise<void>;
7685
7839
  }
7686
7840
 
7687
7841
  /**
@@ -7694,7 +7848,7 @@ declare type LayoutColumn = LayoutItemConfig & {
7694
7848
  /**
7695
7849
  * @interface
7696
7850
  */
7697
- declare type LayoutComponent = LayoutItemConfig & {
7851
+ declare type LayoutComponent = Omit<LayoutItemConfig, 'content' | 'type'> & {
7698
7852
  /**
7699
7853
  * Only a component type will have this property and it should be set to view.
7700
7854
  */
@@ -7703,6 +7857,7 @@ declare type LayoutComponent = LayoutItemConfig & {
7703
7857
  * Only a component type will have this property and it represents the view options of a given component.
7704
7858
  */
7705
7859
  componentState?: Partial<ViewCreationOptions>;
7860
+ type: 'component';
7706
7861
  };
7707
7862
 
7708
7863
  declare type LayoutContent = Array<LayoutItemConfig | LayoutRow | LayoutColumn | LayoutComponent>;
@@ -7786,10 +7941,7 @@ declare type LayoutIdentity = Identity_4 & {
7786
7941
  declare type LayoutInitializedEvent = BaseEvent_5 & {
7787
7942
  type: 'layout-initialized';
7788
7943
  layoutIdentity: OpenFin_2.LayoutIdentity;
7789
- ofViews: {
7790
- identity: OpenFin_2.Identity;
7791
- entityType: 'view';
7792
- }[];
7944
+ ofViews: OpenFin_2.ViewCreationResult[];
7793
7945
  };
7794
7946
 
7795
7947
  /**
@@ -7897,7 +8049,7 @@ declare interface LayoutManager<T extends LayoutSnapshot> {
7897
8049
  /**
7898
8050
  * @experimental
7899
8051
  */
7900
- getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity;
8052
+ getLayoutIdentityForView(viewIdentity: Identity_4): LayoutIdentity | undefined;
7901
8053
  /**
7902
8054
  * @experimental
7903
8055
  */
@@ -8648,6 +8800,10 @@ declare type MutableViewOptions = {
8648
8800
  * @defaultValue 'enabled'
8649
8801
  */
8650
8802
  throttling: ViewThrottling;
8803
+ /**
8804
+ * {@inheritDoc ChromiumPolicies}
8805
+ */
8806
+ chromiumPolicies: ChromiumPolicies;
8651
8807
  };
8652
8808
 
8653
8809
  /**
@@ -8905,6 +9061,10 @@ declare type MutableWindowOptions = {
8905
9061
  * @remarks If `throttling` option is present, the `backgroundThrottling` option is completely ignored for windows.
8906
9062
  */
8907
9063
  throttling: WindowThrottling;
9064
+ /**
9065
+ * {@inheritDoc ChromiumPolicies}
9066
+ */
9067
+ chromiumPolicies: ChromiumPolicies;
8908
9068
  };
8909
9069
 
8910
9070
  declare type NackHandler = (payloadOrMessage: RuntimeErrorPayload | string) => void;
@@ -9115,8 +9275,11 @@ declare namespace OpenFin_2 {
9115
9275
  ViewVisibilityOptions,
9116
9276
  WindowState,
9117
9277
  AutoplayPolicyOptions,
9278
+ ExcludeOptions,
9118
9279
  ConstWindowOptions,
9119
9280
  InheritableOptions,
9281
+ PolicyOptions,
9282
+ ChromiumPolicies,
9120
9283
  MutableWindowOptions,
9121
9284
  WorkspacePlatformOptions,
9122
9285
  WebRequestHeader,
@@ -9150,6 +9313,9 @@ declare namespace OpenFin_2 {
9150
9313
  ViewOptions,
9151
9314
  ConstViewOptions,
9152
9315
  ViewState,
9316
+ ViewCreationSuccess,
9317
+ ViewCreationFailure,
9318
+ ViewCreationResult,
9153
9319
  Certificate,
9154
9320
  HostContextChangedPayload,
9155
9321
  ApplySnapshotOptions,
@@ -9395,6 +9561,7 @@ declare namespace OpenFin_2 {
9395
9561
  RoutingInfo,
9396
9562
  DownloadShelfOptions,
9397
9563
  ViewShowAtOptions,
9564
+ ExtensionInfo,
9398
9565
  ApplicationEvents,
9399
9566
  BaseEvents,
9400
9567
  ExternalApplicationEvents,
@@ -9598,6 +9765,10 @@ declare type PerDomainSettings = {
9598
9765
  * {@link ContentRedirect} in {@link WindowOptions} and {@link ViewOptions} will be **ignored**.
9599
9766
  */
9600
9767
  content?: ContentPermission;
9768
+ /**
9769
+ * {@inheritdoc ChromiumPolicies}
9770
+ */
9771
+ chromiumPolicies?: ChromiumPolicies;
9601
9772
  };
9602
9773
 
9603
9774
  /**
@@ -10952,6 +11123,45 @@ declare interface PlatformProvider {
10952
11123
  * @returns {Promise<void>}
10953
11124
  */
10954
11125
  handleRunRequested({ manifest, userAppConfigArgs }: RunRequestedEvent): Promise<void>;
11126
+ /**
11127
+ * @experimental
11128
+ *
11129
+ * This method is called to handle errors with view creation and initial navigation during layout creation.
11130
+ * Overriding this method enables catching the error and correcting behavior (ie navigating to an error page).
11131
+ * * To indicate that the error has been handled, view creation should be treated as successful return {identity: viewIdentity, success: true}.
11132
+ * * Not returning anything will cause the layout-initialized event to include the view as failed with the original error.
11133
+ * * Throwing an error will update the error on the event payload of layout-initialized to the thrown error.
11134
+ *
11135
+ * @param viewIdentity Identity of the view
11136
+ * @param error error thrown during a view creation
11137
+ * @returns {Promise<OpenFin.ViewCreationSuccess | void>}
11138
+ *
11139
+ * @example
11140
+ *
11141
+ * ```js
11142
+ * const overrideCallback = (PlatformProvider) => {
11143
+ * class Override extends PlatformProvider {
11144
+ * async handleFailedViewCreation(viewIdentity, error) {
11145
+ * const view = fin.View.wrapSync(viewId);
11146
+ * try {
11147
+ * // navigate to an error page
11148
+ * await view.navigate('http://localhost:3000/errorPage.html');
11149
+ * // resolve a success result after redirecting to a error page
11150
+ * return {identity: viewIdentity, success: true};
11151
+ * } catch(e) {
11152
+ * // layout-initialized event will include this view with the error
11153
+ * throw error;
11154
+ * }
11155
+ * }
11156
+ * }
11157
+ * return new Override();
11158
+ * }
11159
+ *
11160
+ * fin.Platform.init({ overrideCallback });
11161
+ *
11162
+ * ```
11163
+ */
11164
+ handleFailedViewCreation(viewIdentity: OpenFin_2.Identity, error: Error): Promise<OpenFin_2.ViewCreationSuccess | void>;
10955
11165
  }
10956
11166
 
10957
11167
  /**
@@ -11016,6 +11226,12 @@ declare type PointTopLeft = {
11016
11226
  left: number;
11017
11227
  };
11018
11228
 
11229
+ /**
11230
+ * When set to `disable`, disables the policy
11231
+ * When set to `defer-to-group-policy`, respects Group Policy settings
11232
+ */
11233
+ declare type PolicyOptions = 'disable' | 'defer-to-group-policy';
11234
+
11019
11235
  declare type PopupBaseBehavior = 'close' | 'hide';
11020
11236
 
11021
11237
  declare type PopupBlurBehavior = 'modal' | PopupBaseBehavior;
@@ -12031,6 +12247,14 @@ declare interface ProtocolMap extends ProtocolMapBase {
12031
12247
  }, void>;
12032
12248
  'system-register-shutdown-handler': VoidCall;
12033
12249
  'get-permissions': GetterCall<any>;
12250
+ 'refresh-extensions': {
12251
+ request: void;
12252
+ response: string[] | undefined;
12253
+ };
12254
+ 'get-installed-extensions': {
12255
+ request: void;
12256
+ response: OpenFin_2.ExtensionInfo[];
12257
+ };
12034
12258
  'fdc3-add-context-listener': VoidCall;
12035
12259
  'fdc3-add-intent-listener': VoidCall;
12036
12260
  'fdc3-raise-intent': VoidCall;
@@ -12719,6 +12943,21 @@ declare type ScreenshotPrintOptions = {
12719
12943
  content: 'screenshot';
12720
12944
  };
12721
12945
 
12946
+ /**
12947
+ * An event generated when an application modifies the runtime in a way that affects all other applications in the
12948
+ * application runtime/security realm.
12949
+ */
12950
+ declare type SecurityRealmEvent = BaseEvent_9 & {
12951
+ /**
12952
+ * Config URL of the application that modified the security realm's extensions
12953
+ */
12954
+ configUrl: string;
12955
+ /**
12956
+ * Identity of the application that modified the security realm's extensions
12957
+ */
12958
+ applicationIdentity: OpenFin_2.ApplicationIdentity;
12959
+ };
12960
+
12722
12961
  declare type SendActionResponse<T extends keyof ProtocolMap> = Message<{
12723
12962
  data: ProtocolMap[T]['response'];
12724
12963
  } & ProtocolMap[T]['specialResponse']>;
@@ -14610,6 +14849,16 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
14610
14849
  * ```
14611
14850
  */
14612
14851
  setDomainSettings(domainSettings: OpenFin_2.DefaultDomainSettings): Promise<void>;
14852
+ /**
14853
+ * Attempts to install and enable extensions for the security realm. Users may want to call this function in response
14854
+ * to an `extensions-install-failed` event. Only extensions allowed by every application on the current security realm
14855
+ * will be installed/enabled.
14856
+ */
14857
+ refreshExtensions(): Promise<string[] | undefined>;
14858
+ /**
14859
+ * Gets the currently-installed
14860
+ */
14861
+ getInstalledExtensions(): Promise<OpenFin_2.ExtensionInfo[]>;
14613
14862
  }
14614
14863
 
14615
14864
  /**
@@ -14640,6 +14889,14 @@ declare namespace SystemEvents {
14640
14889
  ApplicationCreatedEvent,
14641
14890
  DesktopIconClickedEvent,
14642
14891
  SystemShutdownEvent,
14892
+ ExtensionsEnabledEvent,
14893
+ ExtensionsDisabledEvent,
14894
+ ExtensionsExcludedEvent,
14895
+ ExtensionsInstalledEvent,
14896
+ ExtensionInstalledEvent,
14897
+ ExtensionsInstallFailedEvent,
14898
+ ExtensionInstallFailedEvent,
14899
+ ExtensionsInitializationFailedEvent,
14643
14900
  Event_11 as Event,
14644
14901
  SystemEvent,
14645
14902
  EventType_8 as EventType,
@@ -15608,6 +15865,24 @@ declare type ViewContentCreationRule = BaseContentCreationRule & {
15608
15865
  options?: Partial<ViewOptions>;
15609
15866
  };
15610
15867
 
15868
+ /**
15869
+ * @interface
15870
+ */
15871
+ declare type ViewCreationFailure = {
15872
+ /**
15873
+ * The identity of the created view
15874
+ */
15875
+ identity: Identity_4;
15876
+ /**
15877
+ * Whether the view was created with errors
15878
+ */
15879
+ success: false;
15880
+ /**
15881
+ * Error thrown during view creation
15882
+ */
15883
+ error: Error;
15884
+ };
15885
+
15611
15886
  /**
15612
15887
  * The options object required by {@link View.ViewModule.create View.create}.
15613
15888
  *
@@ -15623,6 +15898,25 @@ declare type ViewCreationOptions = Partial<ViewOptions> & {
15623
15898
 
15624
15899
  declare type ViewCreationOrReference = OpenFin_2.Identity | OpenFin_2.PlatformViewCreationOptions;
15625
15900
 
15901
+ /**
15902
+ * A view creation state
15903
+ */
15904
+ declare type ViewCreationResult = ViewCreationSuccess | ViewCreationFailure;
15905
+
15906
+ /**
15907
+ * @interface
15908
+ */
15909
+ declare type ViewCreationSuccess = {
15910
+ /**
15911
+ * The identity of the created view
15912
+ */
15913
+ identity: Identity_4;
15914
+ /**
15915
+ * Whether the view was created without errors
15916
+ */
15917
+ success: true;
15918
+ };
15919
+
15626
15920
  /**
15627
15921
  * Generated when a window has a view detached from it.
15628
15922
  * @remarks Will fire when a view is destroyed in which case `target` will be null.
@@ -15784,6 +16078,9 @@ declare class ViewModule extends Base {
15784
16078
  */
15785
16079
  declare type ViewOptions = ConstViewOptions & MutableViewOptions;
15786
16080
 
16081
+ /**
16082
+ * @interface
16083
+ */
15787
16084
  declare type ViewShowAtOptions = {
15788
16085
  /**
15789
16086
  * Sets the view as the top level view. See {@link OpenFin.View.bringToFront} for more information.