@openfin/core-web 0.38.1

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 (33) hide show
  1. package/LICENSE.md +4 -0
  2. package/README.md +45 -0
  3. package/docs/platform-developer-guide.md +229 -0
  4. package/docs/web-application-developer-guide.md +123 -0
  5. package/out/api-client.d.ts +140 -0
  6. package/out/api-client.js +1 -0
  7. package/out/docs/@openfin/core-web/README.md +49 -0
  8. package/out/docs/@openfin/core-web/functions/connect.md +54 -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/BaseConfig.md +18 -0
  16. package/out/docs/@openfin/core-web/type-aliases/BaseConnectionOptions.md +29 -0
  17. package/out/docs/@openfin/core-web/type-aliases/ConnectConfig.md +9 -0
  18. package/out/docs/@openfin/core-web/type-aliases/InheritModeConnectConfig.md +49 -0
  19. package/out/docs/@openfin/core-web/type-aliases/StandAloneConnectConfig.md +31 -0
  20. package/out/docs/@openfin/core-web/type-aliases/WebCreateLayoutOptions.md +15 -0
  21. package/out/docs/@openfin/core-web/type-aliases/WebLayoutComponent.md +23 -0
  22. package/out/docs/@openfin/core-web/type-aliases/WebLayoutInitOptions.md +15 -0
  23. package/out/docs/@openfin/core-web/type-aliases/WebLayoutOptions.md +15 -0
  24. package/out/docs/@openfin/core-web/type-aliases/WebLayoutPlatformOptions.md +15 -0
  25. package/out/docs/@openfin/core-web/type-aliases/WebLayoutSnapshot.md +15 -0
  26. package/out/docs/README.md +11 -0
  27. package/out/iframe-broker.d.ts +14 -0
  28. package/out/iframe-broker.js +1 -0
  29. package/out/main-77c8e2cd.js +1 -0
  30. package/out/main-993afa58.js +1 -0
  31. package/out/shared-worker.js +1 -0
  32. package/out/styles.css +737 -0
  33. package/package.json +59 -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,45 @@
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
+ - `Layout`
28
+ - `fin.Platform.Layout.init`
29
+ - `fin.Platform.Layout.create`
30
+ - `fin.Platform.Layout.destroy`
31
+ - `fin.Platform.Layout.getCurrentLayoutManagerSync`
32
+
33
+ ## API Reference
34
+
35
+ (Please note, these links work in your IDE and not on npmjs.com, we will update this soon.)
36
+
37
+ - [index](out/docs/README.md)
38
+ - [@openfin/core-web](out/docs/@openfin/core-web/README.md)
39
+ - [@openfin/core-web/iframe-broker](out/docs/@openfin/core-web/iframe-broker/README.md)
40
+ - [@openfin/core-web/shared-worker](out/docs/@openfin/core-web/shared-worker/README.md)
41
+
42
+ ## See Also
43
+
44
+ - [OpenFin Container Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
45
+ - [Fin API reference](https://developer.openfin.co/docs/javascript/stable)
@@ -0,0 +1,229 @@
1
+ # Platform Developer Guide
2
+
3
+ If you are a Platform owner who wants 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
+ ### Host 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 you just need to host it on a web server on a known URL.
18
+
19
+ ## Build 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: Set up a Basic Web Broker
41
+
42
+ First, host `@openfin/core-web/shared-worker` at `/openfin-shared-worker.js`
43
+
44
+ File: iframe-broker.html
45
+
46
+ ```html
47
+ <html>
48
+ <body>
49
+ <script src="iframe-broker.js"></script>
50
+ </body>
51
+ </html>
52
+ ```
53
+
54
+ File: 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
+ ## Reject Connections
65
+
66
+ As an owner of an Iframe Broker, you should first 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 custom rejection logic. If neither `init` or `rejectConnection` is invoked, an embedding client may hang indefinitely.
69
+
70
+ ### Example: Reject 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: Enable 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: Enable 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
+ ## Create Layouts
103
+
104
+ Layouts in the web are very similar to the desktop OpenFin environment. They consist of a layout configuration that describes the rows/columns/view components. The major difference is that the `layout` key is not supported. Instead, we expose the `layoutSnapshot` key to plug into the multiple-layout architecture. See the [Multi-Layout guide](https://developers.openfin.co/of-docs/docs/multi-layouts) for more information on how to set it up.
105
+
106
+ Note that you can achieve a single layout by having only 1 key in your `layoutSnapshot`:
107
+
108
+ ```typescript
109
+ const layoutSnapshot = {
110
+ layouts: {
111
+ layout: { ... }
112
+ }
113
+ }
114
+ ```
115
+
116
+ The JSON structure of the underlying layout options is interchangeable, though not identical, between Desktop and Web. Web Layout Snapshots have an optional `web` property within the view `componentState` options which stores web specific properties. This `web` property is ignored on desktop.
117
+
118
+ ### Example: Retrieve a layoutSnapshot from both desktop and web environments
119
+
120
+ From within your OpenFin v34+ Desktop environment, retrieve the current layoutSnapshot:
121
+
122
+ ```typescript
123
+ const layoutManager = fin.Platform.Layout.getCurrentLayoutManagerSync();
124
+ // returns an object like: { layouts: { ... } } where each key in layouts.<key> is it's own separate layout configuration
125
+ const layoutSnapshot = await layoutManager.getLayoutSnapshot();
126
+ ```
127
+
128
+ Note that the `fin.Platform.Layout` API is exactly the same in web, so you can retrieve the Web Layout Snapshot using the same code.
129
+
130
+ ### Example: Create a layoutSnapshot with 2 layouts and initialize it via connect call
131
+
132
+ In order to use layouts, specify the `platform` option to the `connect` call and pass in the `layoutSnapshot`.
133
+
134
+ ```typescript
135
+ import { connect, type WebLayoutSnapshot } from '@openfin/core-web';
136
+
137
+ const brokerUrl = 'http://example.com/web-broker';
138
+
139
+ // Presumably retrieved from fin.Platform.Layout.getCurrentLayoutManagerSync().getLayoutSnapshot()
140
+ // in a v34+ Desktop environment, but also can be manually constructed like this:
141
+ const layoutSnapshot: WebLayoutSnapshot = {
142
+ layouts: {
143
+ tab1: {
144
+ content: [
145
+ {
146
+ type: 'row',
147
+ content: [
148
+ {
149
+ type: 'stack',
150
+ content: [
151
+ {
152
+ title: 'Example',
153
+ type: 'component',
154
+ componentName: 'view',
155
+ componentState: {
156
+ url: 'http://example.com/'
157
+ }
158
+ }
159
+ ]
160
+ },
161
+ {
162
+ type: 'stack',
163
+ content: [
164
+ {
165
+ title: 'Example',
166
+ type: 'component',
167
+ componentName: 'view',
168
+ componentState: {
169
+ url: 'http://example.com/'
170
+ }
171
+ }
172
+ ]
173
+ }
174
+ ]
175
+ }
176
+ ]
177
+ },
178
+ tab2: {
179
+ content: [
180
+ {
181
+ type: 'stack',
182
+ content: [
183
+ {
184
+ title: 'Example',
185
+ type: 'component',
186
+ componentName: 'view',
187
+ componentState: {
188
+ url: 'http://example.com/'
189
+ }
190
+ }
191
+ ]
192
+ }
193
+ ]
194
+ }
195
+ }
196
+ };
197
+
198
+ (async () => {
199
+ // Connect to the OpenFin Web Broker. Pass in the `platform` key with a layoutSnapshot.
200
+ const fin = await connect({
201
+ connectionInheritance: 'enabled',
202
+ options: { brokerUrl },
203
+ platform: { layoutSnapshot }
204
+ });
205
+
206
+ const container = document.getElementById('layout-container');
207
+
208
+ // You may now use the `fin` object. In this case, we want to initialize and create layouts.
209
+ await fin.Platform.Layout.init({ container });
210
+
211
+ // For multi-layout information see https://developers.openfin.co/of-docs/docs/multi-layouts
212
+ // In the multi-layout case we would also call `fin.Platform.Layout.create()`.
213
+ })();
214
+ ```
215
+
216
+ Note that cross-tab support is experimental, browser-dependent and respects each browser's privacy sandbox.
217
+
218
+ ## API Reference
219
+
220
+ (Please note, these links work in your IDE and not on npmjs.com, we will update this soon.)
221
+
222
+ - [@openfin/core-web](../out/docs/@openfin/core-web/README.md)
223
+ - [@openfin/core-web/iframe-broker](../out/docs/@openfin/core-web/iframe-broker/README.md)
224
+ - [@openfin/core-web/shared-worker](../out/docs/@openfin/core-web/shared-worker/README.md)
225
+
226
+ ## See Also
227
+
228
+ - [OpenFin Container Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
229
+ - [Fin API reference](https://developer.openfin.co/docs/javascript/stable)
@@ -0,0 +1,123 @@
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
+ ## API Reference
115
+
116
+ (Please note, this link works in your IDE and not on npmjs.com, we will update this soon.)
117
+
118
+ - [@openfin/core-web](../out/docs/@openfin/core-web/README.md)
119
+
120
+ ## See Also
121
+
122
+ - [Fin API reference](https://developer.openfin.co/docs/javascript/stable)
123
+ - [OpenFin Container Developer guide](https://developers.openfin.co/of-docs/docs/container-overview)
@@ -0,0 +1,140 @@
1
+ import type OpenFin from '@openfin/core';
2
+
3
+ export declare type BaseConfig = {
4
+ /**
5
+ * Options used to initialize Web Layouts related features. If omitted, calling `fin.Platform.Layout.init()`
6
+ * will not work.
7
+ */
8
+ platform?: WebLayoutPlatformOptions;
9
+ };
10
+
11
+ export declare type BaseConnectionOptions = {
12
+ /**
13
+ * The URL of the Web Interop broker to connect to.
14
+ */
15
+ brokerUrl: string;
16
+ /**
17
+ * Tears down and cancels the connection attempt if it is not complete within the specified timeout (in ms).
18
+ */
19
+ timeout?: number;
20
+ /**
21
+ * Interop options to use to generate an interop client in `fin.me.interop`
22
+ */
23
+ interopConfig?: Partial<OpenFin.InteropConfig>;
24
+ };
25
+
26
+ /**
27
+ * ## connect(connectConfig: ConnectConfig)
28
+ * Establishes a connection to an OpenFin Web Interop Broker, returning a fin object that supports a subset of APIS.
29
+ *
30
+ * ### Supported APIs
31
+ *
32
+ * * fin.InterApplicationBus.Channels
33
+ * * fin.Interop
34
+ * * fin.me.identity
35
+ * * fin.Platform.Layout.init
36
+ * * fin.Platform.Layout.create
37
+ * * fin.Platform.Layout.destroy
38
+ * * fin.Platform.Layout.getCurrentLayoutManagerSync
39
+ *
40
+ * @param connectConfig Config used to initialise the connection
41
+ * @returns Fin api object
42
+ * @throws If the connection to the broker fails.
43
+ * @throws If the connection elapses the configured timeout
44
+ * @throws If the provided {@link InheritModeConnectConfig.validateOptions} returns false
45
+ * @throws If connection inheritance is enabled but the current browsing context is not rendered as a View within an OpenFin WebLayout and no {@link ConnectConfig.options} are provided.
46
+ * @throws If a platform object is provided but the layoutSnapshot is invalid.
47
+ */
48
+ export declare const connect: (connectConfig: ConnectConfig) => Promise<OpenFin.Fin<'external connection'>>;
49
+
50
+ export declare type ConnectConfig = StandAloneConnectConfig | InheritModeConnectConfig;
51
+
52
+ export declare type InheritModeConnectConfig = BaseConfig & {
53
+ /**
54
+ * @defaultValue 'disabled'
55
+ *
56
+ * If 'enabled', attempts to inherit connection options if it is running as a View within an OpenFin WebLayout.
57
+ * This means that the `brokerUrl` and `Identity` of the connection will be determined by the WebBroker
58
+ * of the page where the WebLayout is instantiated via `fin.Platform.Layout.init()` call.
59
+ *
60
+ * If 'disabled', the `options` property is required.
61
+ */
62
+ connectionInheritance: 'enabled';
63
+ /**
64
+ * Options used to connect to an OpenFin Web Broker. Please note, these will be overriden if connectionInheritance
65
+ * is 'enabled' and supported for the current browsing context. In the case that inherited options are unavailable,
66
+ * these options will be used.
67
+ */
68
+ options?: BaseConnectionOptions;
69
+ /**
70
+ * Validates the inherited connection options from the parent browsing context, if available.
71
+ * @param inheritedOptions Inherited options
72
+ * @returns True if the connection options are accepted, or false otherwise.
73
+ */
74
+ validateOptions?: (inheritedOptions: Omit<BaseConnectionOptions, 'timeout'>) => boolean | Promise<boolean>;
75
+ };
76
+
77
+ export declare type StandAloneConnectConfig = BaseConfig & {
78
+ /**
79
+ * @defaultValue 'disabled'
80
+ *
81
+ * If 'enabled', attempts to inherit connection options if it is running as a View within an OpenFin WebLayout.
82
+ * This means that the `brokerUrl` and `Identity` of the connection will be determined by the WebBroker
83
+ * of the page where the WebLayout is instantiated via `fin.Platform.Layout.init()` call.
84
+ *
85
+ * If 'disabled', the `options` property is required.
86
+ */
87
+ connectionInheritance?: 'disabled';
88
+ /**
89
+ * Options used to connect to an OpenFin Web Broker. Mandatory if {@link StandAloneConnectConfig.connectionInheritance} is 'disabled'.
90
+ */
91
+ options: BaseConnectionOptions;
92
+ };
93
+
94
+ export declare type WebCreateLayoutOptions = Omit<OpenFin.CreateLayoutOptions, 'layout'> & {
95
+ layout: WebLayoutOptions;
96
+ };
97
+
98
+ declare type WebLayoutColumn = OpenFin.LayoutColumn & WebLayoutItemConfig;
99
+
100
+ /**
101
+ * Web-only component supplied to IframeViewComponent as it's config
102
+ */
103
+ export declare type WebLayoutComponent = OpenFin.LayoutComponent & {
104
+ componentState?: OpenFin.LayoutComponent['componentState'] & {
105
+ web?: WebState;
106
+ };
107
+ };
108
+
109
+ declare type WebLayoutContent = Array<WebLayoutItemConfig | WebLayoutRow | WebLayoutColumn | WebLayoutComponent>;
110
+
111
+ export declare type WebLayoutInitOptions = Omit<OpenFin.InitLayoutOptions, 'layoutManagerOverride'> & {
112
+ layoutManagerOverride?: OpenFin.LayoutManagerOverride<WebLayoutSnapshot>;
113
+ };
114
+
115
+ declare type WebLayoutItemConfig = Omit<OpenFin.LayoutItemConfig, 'content'> & {
116
+ content?: WebLayoutContent;
117
+ };
118
+
119
+ export declare type WebLayoutOptions = Omit<OpenFin.LayoutOptions, 'content'> & {
120
+ content?: WebLayoutContent;
121
+ };
122
+
123
+ export declare type WebLayoutPlatformOptions = {
124
+ layoutSnapshot: WebLayoutSnapshot;
125
+ };
126
+
127
+ declare type WebLayoutRow = OpenFin.LayoutRow & WebLayoutItemConfig;
128
+
129
+ export declare type WebLayoutSnapshot = {
130
+ layouts: Record<string, WebLayoutOptions>;
131
+ };
132
+
133
+ /**
134
+ * Web-only component state
135
+ */
136
+ declare type WebState = {
137
+ frameName?: string;
138
+ };
139
+
140
+ export { }
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./main-77c8e2cd.js");require("buffer/"),require("uuid"),require("events"),require("lodash"),exports.connect=e.connect;
@@ -0,0 +1,49 @@
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
+ - [BaseConfig](type-aliases/BaseConfig.md)
36
+ - [BaseConnectionOptions](type-aliases/BaseConnectionOptions.md)
37
+ - [ConnectConfig](type-aliases/ConnectConfig.md)
38
+ - [InheritModeConnectConfig](type-aliases/InheritModeConnectConfig.md)
39
+ - [StandAloneConnectConfig](type-aliases/StandAloneConnectConfig.md)
40
+ - [WebCreateLayoutOptions](type-aliases/WebCreateLayoutOptions.md)
41
+ - [WebLayoutComponent](type-aliases/WebLayoutComponent.md)
42
+ - [WebLayoutInitOptions](type-aliases/WebLayoutInitOptions.md)
43
+ - [WebLayoutOptions](type-aliases/WebLayoutOptions.md)
44
+ - [WebLayoutPlatformOptions](type-aliases/WebLayoutPlatformOptions.md)
45
+ - [WebLayoutSnapshot](type-aliases/WebLayoutSnapshot.md)
46
+
47
+ ### Functions
48
+
49
+ - [connect](functions/connect.md)
@@ -0,0 +1,54 @@
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**(`connectConfig`): `Promise`\<`Fin`\<`"external connection"`\>\>
10
+
11
+ ## connect(connectConfig: ConnectConfig)
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
+ * fin.Platform.Layout.init
20
+ * fin.Platform.Layout.create
21
+ * fin.Platform.Layout.destroy
22
+ * fin.Platform.Layout.getCurrentLayoutManagerSync
23
+
24
+ ## Parameters
25
+
26
+ • **connectConfig**: [`ConnectConfig`](../type-aliases/ConnectConfig.md)
27
+
28
+ Config used to initialise the connection
29
+
30
+ ## Returns
31
+
32
+ `Promise`\<`Fin`\<`"external connection"`\>\>
33
+
34
+ Fin api object
35
+
36
+ ## Throws
37
+
38
+ If the connection to the broker fails.
39
+
40
+ ## Throws
41
+
42
+ If the connection elapses the configured timeout
43
+
44
+ ## Throws
45
+
46
+ If the provided InheritModeConnectConfig.validateOptions returns false
47
+
48
+ ## Throws
49
+
50
+ If connection inheritance is enabled but the current browsing context is not rendered as a View within an OpenFin WebLayout and no ConnectConfig.options are provided.
51
+
52
+ ## Throws
53
+
54
+ If a platform object is provided but the layoutSnapshot is invalid.
@@ -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)