@openfin/core-web 0.38.29

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.
Files changed (32) hide show
  1. package/LICENSE.md +4 -0
  2. package/README.md +40 -0
  3. package/docs/platform-developer-guide.md +115 -0
  4. package/docs/web-application-developer-guide.md +125 -0
  5. package/out/api-client.d.ts +122 -0
  6. package/out/api-client.js +1 -0
  7. package/out/docs/@openfin/core-web/README.md +48 -0
  8. package/out/docs/@openfin/core-web/functions/connect.md +46 -0
  9. package/out/docs/@openfin/core-web/iframe-broker/README.md +35 -0
  10. package/out/docs/@openfin/core-web/iframe-broker/functions/init.md +17 -0
  11. package/out/docs/@openfin/core-web/iframe-broker/functions/rejectConnections.md +19 -0
  12. package/out/docs/@openfin/core-web/iframe-broker/type-aliases/ConnectionOptions.md +23 -0
  13. package/out/docs/@openfin/core-web/shared-worker/README.md +16 -0
  14. package/out/docs/@openfin/core-web/shared-worker/variables/default.md +9 -0
  15. package/out/docs/@openfin/core-web/type-aliases/BaseConnectionOptions.md +29 -0
  16. package/out/docs/@openfin/core-web/type-aliases/ConnectionConfig.md +9 -0
  17. package/out/docs/@openfin/core-web/type-aliases/InheritModeConnectConfig.md +42 -0
  18. package/out/docs/@openfin/core-web/type-aliases/StandAloneConnectonConfig.md +31 -0
  19. package/out/docs/@openfin/core-web/type-aliases/WebCreateLayoutOptions.md +15 -0
  20. package/out/docs/@openfin/core-web/type-aliases/WebLayoutComponent.md +23 -0
  21. package/out/docs/@openfin/core-web/type-aliases/WebLayoutInitOptions.md +15 -0
  22. package/out/docs/@openfin/core-web/type-aliases/WebLayoutOptions.md +15 -0
  23. package/out/docs/@openfin/core-web/type-aliases/WebLayoutPlatformOptions.md +15 -0
  24. package/out/docs/@openfin/core-web/type-aliases/WebLayoutSnapshot.md +15 -0
  25. package/out/docs/README.md +11 -0
  26. package/out/iframe-broker.d.ts +14 -0
  27. package/out/iframe-broker.js +1 -0
  28. package/out/main-95b39f26.js +1 -0
  29. package/out/main-ca728fd0.js +1 -0
  30. package/out/shared-worker.js +1 -0
  31. package/out/styles.css +737 -0
  32. package/package.json +58 -0
package/LICENSE.md ADDED
@@ -0,0 +1,4 @@
1
+ Learn more about OpenFin licensing at the links listed below or email us at support@openfin.co with questions.
2
+
3
+ - [Developer agreement](https://openfin.co/developer-agreement/)
4
+
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # @openfin/core-web
2
+
3
+ `@openfin/core-web` enables interopability within a web browser. It is intended to be used by both content and platform developers to create integrated experiences which leverage OpenFin's existing interopability APIs.
4
+
5
+ This package relies on the type definitions found in [@openfin/core](https://www.npmjs.com/package/@openfin/core) which is a required peer dependency.
6
+
7
+ ## Developer Guides
8
+
9
+ (Please note, these links work in your IDE and not on npm.org, we will update this soon.)
10
+
11
+ - [Content Developer Guide](docs/web-application-developer-guide.md) - For developers who need access to the `fin` api to build web applications.
12
+ - [Platform Developer Guide](docs/platform-developer-guide.md) - For developers building platform-like web experiences who wish to enable and host a Web Interop setup.
13
+
14
+ ## Supported APIs
15
+
16
+ `@openfin/core-web` currently supports the following APIs:
17
+
18
+ - `fin.me.identity` - The identity of the `fin` instance provided by the Web Broker.
19
+ - `fin.InterApplicationBus.Channel.connect` - Currently, the only supported channel strategy is `classic`.
20
+ - `fin.InterApplicationBus.Channel.create`
21
+ - `InteropBroker`
22
+ - `fin.Interop.init`
23
+ - `InteropClient`
24
+ - `fin.Interop.connectSync`
25
+ - `fin.me.interop`
26
+ - `InteropClient.getFDC3()` - (FDC3 support is currently limited to context sharing on User Channels)
27
+
28
+ ## API Reference
29
+
30
+ (Please note, these links work in your IDE and not on npmjs.com, we will update this soon.)
31
+
32
+ - [index](out/docs/README.md)
33
+ - [@openfin/core-web](out/docs/@openfin/core-web/README.md)
34
+ - [@openfin/core-web/iframe-broker](out/docs/@openfin/core-web/iframe-broker/README.md)
35
+ - [@openfin/core-web/shared-worker](out/docs/@openfin/core-web/shared-worker/README.md)
36
+
37
+ ## See Also
38
+
39
+ - [OpenFin Container Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
40
+ - [Fin API reference](https://developer.openfin.co/docs/javascript/stable)
@@ -0,0 +1,115 @@
1
+ # Platform Developer Guide
2
+
3
+ If you are a Platform owner who wishes to include OpenFin's web capabilities in your platform, there are a few steps required. This section will guide you through the process of setting up an environment. Please note, none of these steps are necessary for content developers (See the [content developer guide](web-application-developer-guide.md)).
4
+
5
+ ## First Steps
6
+
7
+ Ensure that `@openfin/core-web` is installed by running the following command:
8
+
9
+ ```bash
10
+ npm i @openfin/core-web -S
11
+ ```
12
+
13
+ ## Hosting the `@openfin/core-web` Shared Worker
14
+
15
+ An `@openfin/core-web/shared-worker` entry point is included in this package's distribution. This is a non-customizable, standalone piece of javascript that must be hosted on your server for `@openfin/core-web` to function.
16
+
17
+ This file has already been bundled, which means consumers just need to host it on their server on a known url.
18
+
19
+ ## Building a Web Broker
20
+
21
+ An html page, loaded as a hidden iframe by clients, must be hosted in the same origin as the `@openfin/shared-worker`. This iframe acts as a gatekeeper to the `shared-worker` and therefore must be hosted on the same domain.
22
+
23
+ In order to build a Web Broker, the following requirements must be met:
24
+
25
+ 1. You must host the `@openfin/core-web/shared-worker` bundle on a domain (for example https://www.example.com/mysharedworker.js).
26
+ 2. You must host a web broker page on that same domain (for example, https://www.example.com/web-broker).
27
+ 3. That page must call `init` from `@openfin/core-web/iframe-broker` with the url of the shared worker hosted in step 1.
28
+
29
+ ```typescript
30
+ // Runs on https://www.example.com/web-broker
31
+ import {init} from '@openfin/core-web/iframe-broker;
32
+
33
+ const sharedWorkerUrl = 'https://www.example.com/mysharedworker.js';
34
+
35
+ await init({sharedWorkerUrl})
36
+ ```
37
+
38
+ Here is a basic example of hosting a Web Broker:
39
+
40
+ #### Example: Setting up a Basic Web Broker
41
+
42
+ First, host `@openfin/core-web/shared-worker` at `/openfin-shared-worker.js`
43
+
44
+ _iframe-broker.html_
45
+
46
+ ```html
47
+ <html>
48
+ <body>
49
+ <script src="iframe-broker.js"></script>
50
+ </body>
51
+ </html>
52
+ ```
53
+
54
+ _iframe-broker.js_
55
+
56
+ ```typescript
57
+ import { init } from '@openfin/core-web/iframe-broker';
58
+
59
+ init({
60
+ sharedWorkerUrl: `${location.origin}/openfin-shared-worker.js`
61
+ });
62
+ ```
63
+
64
+ ## Rejecting Connections
65
+
66
+ As an owner of an Iframe Broker, you should first and foremost rely on existing web security tools such as the frame-ancestors CSP rule to prevent content from connecting to you which you don't expect.
67
+
68
+ `@openfin/core-web` exposes a `rejectConnections` utility if you wish to implement more bespoke logic. If neither `init` or `rejectConnection` is invoked, an embedding client may hang indefinitely.
69
+
70
+ #### Example: Rejecting a Cross Origin Connection using `@openfin/core-web/iframe-broker`
71
+
72
+ ```typescript
73
+ import { init, rejectConnections } from '@openfin/core-web/iframe-broker';
74
+
75
+ // If the origins do not match.
76
+ if (new URL(document.referrer).origin !== location.origin) {
77
+ rejectConnections({
78
+ reason: 'Connections from this domain are not supported' // Reason allows an error to be returned to the connecting client.
79
+ });
80
+ } else {
81
+ init({
82
+ sharedWorkerUrl: `${location.origin}/openfin-shared-worker.js`
83
+ });
84
+ }
85
+ ```
86
+
87
+ ## Experimental: Enabling Cross Tab Support
88
+
89
+ By default, `@openfin/core-web` disables the sharing of connections across browser Tabs. However, this feature may be enabled by specifying the following flag in an IFrame Broker:
90
+
91
+ ### Example: Enabling Cross Tab Support
92
+
93
+ ```typescript
94
+ init({
95
+ sharedWorkerUrl: `${location.origin}/openfin-shared-worker.js`,
96
+ experimental: {
97
+ crossTab: 'same-site'
98
+ }
99
+ });
100
+ ```
101
+
102
+ Note that cross-tab support is experimental, browser-dependent and respects each browser's privacy sandbox.
103
+
104
+ ## API Reference
105
+
106
+ (Please note, these links work in your IDE and not on npmjs.com, we will update this soon.)
107
+
108
+ - [@openfin/core-web](../out/docs/@openfin/core-web/README.md)
109
+ - [@openfin/core-web/iframe-broker](../out/docs/@openfin/core-web/iframe-broker/README.md)
110
+ - [@openfin/core-web/shared-worker](../out/docs/@openfin/core-web/shared-worker/README.md)
111
+
112
+ ## See Also
113
+
114
+ - [OpenFin Container Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
115
+ - [Fin API reference](https://developer.openfin.co/docs/javascript/stable)
@@ -0,0 +1,125 @@
1
+ # Openfin Web Application Developer Guide
2
+
3
+ If you are a developer who is building contentful applications which use the OpenFin APIs, the default entry point of this package provides a `connect` function. This is designed to complement the type definitions found in [@openfin/core](https://www.npmjs.com/package/@openfin/core).
4
+
5
+ Note - if you are a platform developer looking to setup an OpenFin Web Interop Broker, please check out [this guide](./platform-developer-guide.md).
6
+
7
+ ## First Steps
8
+
9
+ To install `@openfin/core-web`, run the following command:
10
+
11
+ ```bash
12
+ npm install @openfin/core-web -S
13
+ ```
14
+
15
+ We recommend using `@openfin/core-web` with a modern build tool like Next.js, Webpack or Vite.
16
+
17
+ It is framework agnostic, meaning it should work with any UI framework.
18
+
19
+ ## Connecting to a Web Broker
20
+
21
+ An `@openfin/core-web` Web Broker is a piece of hosted infrastructure which you can connect to from a web site in order to interact with other content connected to the same Web Broker. A Web Broker is responsible for deciding whether you can connect to it, and connecting you to other applications via OpenFin's Interop and Channels APIs.
22
+
23
+ When the Web Broker url is known, connecting to a specific `@openfin/core-web` broker will return a fin connection.
24
+
25
+ ### Example: Basic Connection Setup
26
+
27
+ ```typescript
28
+ import { connect } from '@openfin/core-web';
29
+
30
+ const brokerUrl = 'http://example.com/web-broker';
31
+
32
+ (async () => {
33
+ // Connect to the OpenFin Web Broker.
34
+ const fin = await connect({ options: { brokerUrl } });
35
+
36
+ // You may now use the `fin` object. In this case, we connect to a channel.
37
+ const channelClient = await fin.InterapplicationBus.Channel.connect('some channel name');
38
+ })();
39
+ ```
40
+
41
+ ## Setting a Timeout
42
+
43
+ If desired, the timeout option (in milliseconds) can be specified to abandon the connection after a set amount of time.
44
+
45
+ An example below shows setting up a 30 second timeout.
46
+
47
+ ### Example: Setting a Timeout
48
+
49
+ ```typescript
50
+ // This connect call will throw if a connection is not established within 30 seconds.
51
+ await connect({ options: { brokerUrl, timeout: 30000 } });
52
+ ```
53
+
54
+ ## Setting up an Interop Connection
55
+
56
+ An Interop connection can be configured in order to automatically set up an interop client. This client may be accessed via the `fin.me.interop` namespace.
57
+
58
+ A Provider ID must be specified for the `fin.me.interop` client to work if `connectionInheritance` is not supported. An example is shown below:
59
+
60
+ ### Example: Connecting to an Interop Broker
61
+
62
+ ```typescript
63
+ // Specify an interopConfig with a specific provider ID to initialize the `fin.me.interop` client on connection.
64
+ const fin = await connect({ options: { brokerUrl, interopConfig: { providerId: 'provider-id' } } });
65
+
66
+ // fin.me.interop is an InteropClient connected to the `provider-id` InteropBroker.
67
+ fin.me.interop.addContextHandler((context) => console.log('received context'));
68
+ ```
69
+
70
+ ## Specifying an Initial Context Group
71
+
72
+ By default OpenFin's Interop Client api does not select a context group. The following example illustrates setting up an initial context group during connection.
73
+
74
+ ### Example: Joining a Default Context Group
75
+
76
+ ```typescript
77
+ // Specify an interopConfig with a specific provider ID and a context group to initialize the `fin.me.interop` client on connection.
78
+ const fin = await connect({
79
+ options: { brokerUrl, interopConfig: { providerId: 'provider-id', currentContextGroup: 'red' } }
80
+ });
81
+
82
+ // The fin.me.interop client adds a context handler which will receive updates published on the `red` context group.
83
+ fin.me.interop.addContextHandler((context) => console.log('received context'));
84
+ ```
85
+
86
+ ## Initializing FDC3
87
+
88
+ This library does not produce any global variables. To leverage FDC3 you may use the `.getFDC3` or `.getFDC3Sync` apis of a connected `InteropClient`. (Note that with an interop config provided in `connect` `fin.me.interop` is instantiated as an `InteropClient`)
89
+
90
+ Supported versions for `fdc3` are `1.2` or `2.0`.
91
+
92
+ ### Example: Creating an FDC3 Client
93
+
94
+ ```typescript
95
+ import { connect } from '@openfin/core-web';
96
+
97
+ const brokerUrl = 'http://example.com/web-broker';
98
+
99
+ // Specify an interopConfig with a specific provider ID and a context group to initialize the `fin.me.interop` client on connection.
100
+ const fin = await connect({
101
+ options: { brokerUrl, interopConfig: { providerId: 'provider-id', currentContextGroup: 'red' } }
102
+ });
103
+
104
+ // Set window.fdc3 to an FDC3 2.0 DesktopAgent which is connected to the `provider-id` InteropBroker on the `red' channel.
105
+ window.fdc3 = fin.me.interop.getFDC3Sync('2.0');
106
+ ```
107
+
108
+ Note that FDC3 support in web is currently limited to context sharing on system channels.
109
+
110
+ ## Context Aware Connections and Connection Inheritance
111
+
112
+ `@openfin/core-web` has been designed to support inheritance of brokerUrls and interop configurations if your content is running as a view within an OpenFin Layout. This allows content developers to develop platform-agnostic experiences and ensure that they are able to interact with other content connected to the same Web Broker.
113
+
114
+ However, as Web Layouts is not publicly available yet, the `connect` `connectionInheritance` setting will default to `'disabled'`.
115
+
116
+ ## API Reference
117
+
118
+ (Please note, this link works in your IDE and not on npmjs.com, we will update this soon.)
119
+
120
+ - [@openfin/core-web](../out/docs/@openfin/core-web/README.md)
121
+
122
+ ## See Also
123
+
124
+ - [Fin API reference](https://developer.openfin.co/docs/javascript/stable)
125
+ - [OpenFin Container Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
@@ -0,0 +1,122 @@
1
+ import type OpenFin from '@openfin/core';
2
+
3
+ export declare type BaseConnectionOptions = {
4
+ /**
5
+ * The URL of the Web Interop broker to connect to. Can be inherited from a parent browsing context if using an <of-view>
6
+ */
7
+ brokerUrl: string;
8
+ /**
9
+ * Tears down and cancels the connection attempt if it is not complete within the specified timeout (in ms).
10
+ */
11
+ timeout?: number;
12
+ /**
13
+ * Interop options to use to generate an interop client in `fin.me.interop`
14
+ */
15
+ interopConfig?: Partial<OpenFin.InteropConfig>;
16
+ };
17
+
18
+ /**
19
+ * ## connect(connectionConfig: ConnectionConfig)
20
+ * Establishes a connection to an OpenFin Web Interop Broker, returning a fin object that supports a subset of APIS.
21
+ *
22
+ * ### Supported APIs
23
+ *
24
+ * * fin.InterApplicationBus.Channels
25
+ * * fin.Interop
26
+ * * fin.me.identity
27
+ *
28
+ * @param connectionConfig Config used to initialise the connection
29
+ * @returns Fin api object
30
+ * @throws If the connection to the broker fails.
31
+ * @throws If the connection elapses the configured timeout
32
+ * @throws If the provided {@link InheritModeConnectConfig.validateOptions} returns false
33
+ * @throws If connection inheritance is enabled but the current browsing context is not rendered in an <of-view> element and no {@link ConnectionConfig.options} are provided.
34
+ */
35
+ export declare const connect: (connectionConfig: ConnectionConfig) => Promise<OpenFin.Fin<'external connection'>>;
36
+
37
+ export declare type ConnectionConfig = StandAloneConnectonConfig | InheritModeConnectConfig;
38
+
39
+ export declare type InheritModeConnectConfig = {
40
+ /**
41
+ * If 'enabled', connection option inheritance is enabled if the current browsing context is
42
+ * a nested browsing context within an <of-view> element. This means that the brokerUrl and Identity
43
+ * of the connection will be determined by the parent browsing context. Specifying a value is mandatory.
44
+ */
45
+ connectionInheritance: 'enabled';
46
+ /**
47
+ * Options used to connect to an OpenFin Web Broker. Please note, these will be overriden if connection inheritance
48
+ * is enabled and supported for the current browsing context.
49
+ */
50
+ options?: BaseConnectionOptions;
51
+ /**
52
+ * Validates the inherited connection options from the parent browsing context, if available.
53
+ * @param inheritedOptions Inherited options
54
+ * @returns True if the connection options are accepted, or false otherwise.
55
+ */
56
+ validateOptions?: (inheritedOptions: Omit<BaseConnectionOptions, 'timeout'>) => boolean | Promise<boolean>;
57
+ };
58
+
59
+ export declare type StandAloneConnectonConfig = {
60
+ /**
61
+ * If 'enabled', connection option inheritance is enabled if the current browsing context is
62
+ * a nested browsing context within an <of-view> element. This means that the brokerUrl and Identity
63
+ * of the connection will be determined by the parent browsing context. Specifying a value is mandatory.
64
+ */
65
+ connectionInheritance?: 'disabled';
66
+ /**
67
+ * Options used to connect to an OpenFin Web Broker. Mandatory if {@link StandAloneConnectonConfig.connectionInheritance} is false.
68
+ */
69
+ options: BaseConnectionOptions;
70
+ /**
71
+ * Options used to initialize web-layouts related features.
72
+ */
73
+ platform?: WebLayoutPlatformOptions;
74
+ };
75
+
76
+ export declare type WebCreateLayoutOptions = Omit<OpenFin.CreateLayoutOptions, 'layout'> & {
77
+ layout: WebLayoutOptions;
78
+ };
79
+
80
+ declare type WebLayoutColumn = OpenFin.LayoutColumn & WebLayoutItemConfig;
81
+
82
+ /**
83
+ * Web-only component supplied to IframeViewComponent as it's config
84
+ */
85
+ export declare type WebLayoutComponent = OpenFin.LayoutComponent & {
86
+ componentState?: OpenFin.LayoutComponent['componentState'] & {
87
+ web?: WebState;
88
+ };
89
+ };
90
+
91
+ declare type WebLayoutContent = Array<WebLayoutItemConfig | WebLayoutRow | WebLayoutColumn | WebLayoutComponent>;
92
+
93
+ export declare type WebLayoutInitOptions = Omit<OpenFin.InitLayoutOptions, 'layoutManagerOverride'> & {
94
+ layoutManagerOverride?: OpenFin.LayoutManagerOverride<WebLayoutSnapshot>;
95
+ };
96
+
97
+ declare type WebLayoutItemConfig = Omit<OpenFin.LayoutItemConfig, 'content'> & {
98
+ content?: WebLayoutContent;
99
+ };
100
+
101
+ export declare type WebLayoutOptions = Omit<OpenFin.LayoutOptions, 'content'> & {
102
+ content?: WebLayoutContent;
103
+ };
104
+
105
+ export declare type WebLayoutPlatformOptions = {
106
+ layoutSnapshot: WebLayoutSnapshot;
107
+ };
108
+
109
+ declare type WebLayoutRow = OpenFin.LayoutRow & WebLayoutItemConfig;
110
+
111
+ export declare type WebLayoutSnapshot = {
112
+ layouts: Record<string, WebLayoutOptions>;
113
+ };
114
+
115
+ /**
116
+ * Web-only component state
117
+ */
118
+ declare type WebState = {
119
+ frameName?: string;
120
+ };
121
+
122
+ export { }
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./main-ca728fd0.js");require("buffer"),require("uuid"),require("events"),require("lodash"),exports.connect=e.connect;
@@ -0,0 +1,48 @@
1
+ **@openfin/core-web** • [API](../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../README.md) / @openfin/core-web
6
+
7
+ # @openfin/core-web
8
+
9
+ The main entry point for leveraging OpenFin Web Interop in a web application.
10
+
11
+ ## Remarks
12
+
13
+ This module provides a way to connect to an OpenFin Web Interop broker, which allows for communication between Web applications.
14
+
15
+ ## Example
16
+
17
+ ```ts
18
+ import { connect } from '@openfin/core-web';
19
+
20
+ const fin = await connect({
21
+ options: {
22
+ brokerUrl: 'ws://localhost:9696/broker'
23
+ interopConfig: {
24
+ providerId: 'my-provider-id',
25
+ currentContextGroup: 'my-context-group'
26
+ }
27
+ }
28
+ });
29
+ ```
30
+
31
+ ## Index
32
+
33
+ ### Type Aliases
34
+
35
+ - [BaseConnectionOptions](type-aliases/BaseConnectionOptions.md)
36
+ - [ConnectionConfig](type-aliases/ConnectionConfig.md)
37
+ - [InheritModeConnectConfig](type-aliases/InheritModeConnectConfig.md)
38
+ - [StandAloneConnectonConfig](type-aliases/StandAloneConnectonConfig.md)
39
+ - [WebCreateLayoutOptions](type-aliases/WebCreateLayoutOptions.md)
40
+ - [WebLayoutComponent](type-aliases/WebLayoutComponent.md)
41
+ - [WebLayoutInitOptions](type-aliases/WebLayoutInitOptions.md)
42
+ - [WebLayoutOptions](type-aliases/WebLayoutOptions.md)
43
+ - [WebLayoutPlatformOptions](type-aliases/WebLayoutPlatformOptions.md)
44
+ - [WebLayoutSnapshot](type-aliases/WebLayoutSnapshot.md)
45
+
46
+ ### Functions
47
+
48
+ - [connect](functions/connect.md)
@@ -0,0 +1,46 @@
1
+ **@openfin/core-web** • [API](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../README.md) / [@openfin/core-web](../README.md) / connect
6
+
7
+ # Function: connect()
8
+
9
+ > **connect**(`connectionConfig`): `Promise`\<`Fin`\<`"external connection"`\>\>
10
+
11
+ ## connect(connectionConfig: ConnectionConfig)
12
+ Establishes a connection to an OpenFin Web Interop Broker, returning a fin object that supports a subset of APIS.
13
+
14
+ ### Supported APIs
15
+
16
+ * fin.InterApplicationBus.Channels
17
+ * fin.Interop
18
+ * fin.me.identity
19
+
20
+ ## Parameters
21
+
22
+ • **connectionConfig**: [`ConnectionConfig`](../type-aliases/ConnectionConfig.md)
23
+
24
+ Config used to initialise the connection
25
+
26
+ ## Returns
27
+
28
+ `Promise`\<`Fin`\<`"external connection"`\>\>
29
+
30
+ Fin api object
31
+
32
+ ## Throws
33
+
34
+ If the connection to the broker fails.
35
+
36
+ ## Throws
37
+
38
+ If the connection elapses the configured timeout
39
+
40
+ ## Throws
41
+
42
+ If the provided InheritModeConnectConfig.validateOptions returns false
43
+
44
+ ## Throws
45
+
46
+ If connection inheritance is enabled but the current browsing context is not rendered in an `<of-view>` element and no ConnectionConfig.options are provided.
@@ -0,0 +1,35 @@
1
+ **@openfin/core-web** • [API](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../README.md) / @openfin/core-web/iframe-broker
6
+
7
+ # @openfin/core-web/iframe-broker
8
+
9
+ This module is the entry point for the Iframe Broker. It is responsible for initializing the OpenFin Web Interop environment.
10
+
11
+ ## Remarks
12
+
13
+ This module is intended to be used in an iframe context, and is responsible for setting up the connection between the iframe and the OpenFin Web Interop broker.
14
+ This module requires hosting the script exported by the module:@openfin/core-web/worker module.
15
+
16
+ ## Example
17
+
18
+ ```ts
19
+ import { init } from '@openfin/core-web/iframe-broker';
20
+
21
+ init({
22
+ sharedWorkerUrl: 'path to shared worker script'
23
+ });
24
+ ```
25
+
26
+ ## Index
27
+
28
+ ### Type Aliases
29
+
30
+ - [ConnectionOptions](type-aliases/ConnectionOptions.md)
31
+
32
+ ### Functions
33
+
34
+ - [init](functions/init.md)
35
+ - [rejectConnections](functions/rejectConnections.md)
@@ -0,0 +1,17 @@
1
+ **@openfin/core-web** • [API](../../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../../README.md) / [@openfin/core-web/iframe-broker](../README.md) / init
6
+
7
+ # Function: init()
8
+
9
+ > **init**(`options`): `Promise`\<`void`\>
10
+
11
+ ## Parameters
12
+
13
+ • **options**: [`ConnectionOptions`](../type-aliases/ConnectionOptions.md)
14
+
15
+ ## Returns
16
+
17
+ `Promise`\<`void`\>
@@ -0,0 +1,19 @@
1
+ **@openfin/core-web** • [API](../../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../../README.md) / [@openfin/core-web/iframe-broker](../README.md) / rejectConnections
6
+
7
+ # Function: rejectConnections()
8
+
9
+ > **rejectConnections**(`options`?): `void`
10
+
11
+ ## Parameters
12
+
13
+ • **options?**
14
+
15
+ • **options\.reason?**: `string`
16
+
17
+ ## Returns
18
+
19
+ `void`
@@ -0,0 +1,23 @@
1
+ **@openfin/core-web** • [API](../../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../../README.md) / [@openfin/core-web/iframe-broker](../README.md) / ConnectionOptions
6
+
7
+ # Type alias: ConnectionOptions
8
+
9
+ > **ConnectionOptions**: `Object`
10
+
11
+ ## Type declaration
12
+
13
+ ### experimental?
14
+
15
+ > **`optional`** **experimental**: `Object`
16
+
17
+ ### experimental.crossTab?
18
+
19
+ > **`optional`** **crossTab**: `"same-site"` \| `"none"`
20
+
21
+ ### sharedWorkerUrl
22
+
23
+ > **sharedWorkerUrl**: `string`
@@ -0,0 +1,16 @@
1
+ **@openfin/core-web** • [API](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../README.md) / @openfin/core-web/shared-worker
6
+
7
+ # @openfin/core-web/shared-worker
8
+
9
+ This file is the entry point for the worker powering web-interop.
10
+ It has no exports and is intended to be hosted with the url given to the `sharedWorkerUrl` option in the Iframe Broker (see: ["@openfin/core-web/iframe-broker"](../iframe-broker/README.md)).
11
+
12
+ ## Index
13
+
14
+ ### Variables
15
+
16
+ - [default](variables/default.md)
@@ -0,0 +1,9 @@
1
+ **@openfin/core-web** • [API](../../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../../README.md) / [@openfin/core-web/shared-worker](../README.md) / default
6
+
7
+ # Variable: default
8
+
9
+ > **default**: `null`
@@ -0,0 +1,29 @@
1
+ **@openfin/core-web** • [API](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../README.md) / [@openfin/core-web](../README.md) / BaseConnectionOptions
6
+
7
+ # Type alias: BaseConnectionOptions
8
+
9
+ > **BaseConnectionOptions**: `Object`
10
+
11
+ ## Type declaration
12
+
13
+ ### brokerUrl
14
+
15
+ > **brokerUrl**: `string`
16
+
17
+ The URL of the Web Interop broker to connect to. Can be inherited from a parent browsing context if using an `<of-view>`
18
+
19
+ ### interopConfig?
20
+
21
+ > **`optional`** **interopConfig**: `Partial`\<`OpenFin.InteropConfig`\>
22
+
23
+ Interop options to use to generate an interop client in `fin.me.interop`
24
+
25
+ ### timeout?
26
+
27
+ > **`optional`** **timeout**: `number`
28
+
29
+ Tears down and cancels the connection attempt if it is not complete within the specified timeout (in ms).
@@ -0,0 +1,9 @@
1
+ **@openfin/core-web** • [API](../../../README.md)
2
+
3
+ ***
4
+
5
+ [@openfin/core-web](../../../README.md) / [@openfin/core-web](../README.md) / ConnectionConfig
6
+
7
+ # Type alias: ConnectionConfig
8
+
9
+ > **ConnectionConfig**: [`StandAloneConnectonConfig`](StandAloneConnectonConfig.md) \| [`InheritModeConnectConfig`](InheritModeConnectConfig.md)