@openfin/core 33.76.27 → 33.76.36
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.
- package/openfin-core-33.76.36.tgz +0 -0
- package/package.json +1 -1
- package/src/OpenFin.d.ts +27 -16
- package/src/api/application/Factory.d.ts +148 -100
- package/src/api/application/Factory.js +148 -100
- package/src/api/application/Instance.d.ts +477 -106
- package/src/api/application/Instance.js +474 -106
- package/src/api/application/index.d.ts +9 -0
- package/src/api/application/index.js +9 -0
- package/src/api/base.d.ts +69 -0
- package/src/api/base.js +69 -0
- package/src/api/clipboard/index.d.ts +111 -31
- package/src/api/clipboard/index.js +111 -31
- package/src/api/events/application.d.ts +12 -0
- package/src/api/events/application.js +12 -0
- package/src/api/events/channel.d.ts +5 -0
- package/src/api/events/channel.js +5 -0
- package/src/api/events/externalApplication.d.ts +5 -0
- package/src/api/events/externalApplication.js +5 -0
- package/src/api/events/frame.d.ts +5 -0
- package/src/api/events/globalHotkey.d.ts +5 -0
- package/src/api/events/platform.d.ts +9 -1
- package/src/api/events/platform.js +8 -0
- package/src/api/events/system.d.ts +13 -0
- package/src/api/events/system.js +13 -0
- package/src/api/events/view.d.ts +19 -9
- package/src/api/events/view.js +10 -0
- package/src/api/events/webcontents.d.ts +21 -10
- package/src/api/events/webcontents.js +11 -0
- package/src/api/events/window.d.ts +70 -1
- package/src/api/events/window.js +10 -0
- package/src/api/external-application/Factory.d.ts +16 -9
- package/src/api/external-application/Factory.js +16 -9
- package/src/api/external-application/Instance.d.ts +40 -32
- package/src/api/external-application/Instance.js +40 -32
- package/src/api/external-application/index.d.ts +9 -0
- package/src/api/external-application/index.js +9 -0
- package/src/api/fin.d.ts +3 -0
- package/src/api/fin.js +3 -0
- package/src/api/frame/Factory.d.ts +30 -13
- package/src/api/frame/Factory.js +30 -13
- package/src/api/frame/Instance.d.ts +51 -38
- package/src/api/frame/Instance.js +51 -38
- package/src/api/frame/index.d.ts +11 -0
- package/src/api/frame/index.js +11 -0
- package/src/api/global-hotkey/index.d.ts +81 -13
- package/src/api/global-hotkey/index.js +81 -13
- package/src/api/interappbus/channel/channel.d.ts +257 -0
- package/src/api/interappbus/channel/channel.js +257 -0
- package/src/api/interappbus/channel/channels-docs.d.ts +59 -57
- package/src/api/interappbus/channel/channels-docs.js +71 -68
- package/src/api/interappbus/channel/client.d.ts +93 -0
- package/src/api/interappbus/channel/client.js +93 -1
- package/src/api/interappbus/channel/index.d.ts +164 -0
- package/src/api/interappbus/channel/index.js +165 -1
- package/src/api/interappbus/channel/provider.d.ts +172 -0
- package/src/api/interappbus/channel/provider.js +172 -0
- package/src/api/interappbus/index.d.ts +55 -20
- package/src/api/interappbus/index.js +55 -20
- package/src/api/interop/Factory.d.ts +30 -10
- package/src/api/interop/Factory.js +30 -10
- package/src/api/interop/InteropBroker.d.ts +298 -70
- package/src/api/interop/InteropBroker.js +298 -70
- package/src/api/interop/InteropClient.d.ts +286 -62
- package/src/api/interop/InteropClient.js +286 -62
- package/src/api/interop/SessionContextGroupClient.d.ts +2 -2
- package/src/api/interop/SessionContextGroupClient.js +2 -2
- package/src/api/interop/fdc3/documentationStub.d.ts +14 -0
- package/src/api/interop/fdc3/documentationStub.js +17 -0
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +31 -34
- package/src/api/interop/fdc3/fdc3-1.2.js +31 -34
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +48 -51
- package/src/api/interop/fdc3/fdc3-2.0.js +48 -51
- package/src/api/interop/index.d.ts +8 -0
- package/src/api/interop/index.js +8 -0
- package/src/api/platform/Factory.d.ts +121 -65
- package/src/api/platform/Factory.js +122 -66
- package/src/api/platform/Instance.d.ts +551 -48
- package/src/api/platform/Instance.js +551 -49
- package/src/api/platform/index.d.ts +9 -0
- package/src/api/platform/index.js +9 -0
- package/src/api/platform/layout/Factory.d.ts +53 -76
- package/src/api/platform/layout/Factory.js +53 -76
- package/src/api/platform/layout/Instance.d.ts +158 -23
- package/src/api/platform/layout/Instance.js +118 -20
- package/src/api/platform/layout/entities/layout-entities.d.ts +222 -30
- package/src/api/platform/layout/entities/layout-entities.js +222 -30
- package/src/api/platform/layout/index.d.ts +9 -0
- package/src/api/platform/layout/index.js +9 -0
- package/src/api/platform/provider.d.ts +398 -51
- package/src/api/snapshot-source/Factory.d.ts +33 -18
- package/src/api/snapshot-source/Factory.js +33 -18
- package/src/api/snapshot-source/Instance.d.ts +30 -8
- package/src/api/snapshot-source/Instance.js +30 -8
- package/src/api/snapshot-source/index.d.ts +9 -0
- package/src/api/snapshot-source/index.js +9 -0
- package/src/api/system/index.d.ts +1137 -186
- package/src/api/system/index.js +1142 -186
- package/src/api/view/Factory.d.ts +54 -16
- package/src/api/view/Factory.js +54 -16
- package/src/api/view/Instance.d.ts +330 -216
- package/src/api/view/Instance.js +331 -217
- package/src/api/view/index.d.ts +9 -0
- package/src/api/view/index.js +9 -0
- package/src/api/webcontents/main.d.ts +890 -0
- package/src/api/webcontents/main.js +890 -0
- package/src/api/window/Factory.d.ts +67 -16
- package/src/api/window/Factory.js +67 -16
- package/src/api/window/Instance.d.ts +824 -316
- package/src/api/window/Instance.js +822 -320
- package/src/api/window/index.d.ts +11 -0
- package/src/api/window/index.js +11 -0
- package/src/namespaces.d.ts +1 -0
- package/src/namespaces.js +3 -1
- package/src/shapes/protocol.d.ts +4 -0
- package/openfin-core-33.76.27.tgz +0 -0
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entry point for the OpenFin Platform namespace.
|
|
3
|
+
*
|
|
4
|
+
* Because TypeDoc does not currently support multiple modules with the same name, the module alias "PlatformModule" is used for
|
|
5
|
+
* the module containing static members of the `Platform` namespace (available under `fin.Platform`), while `Platform` documents
|
|
6
|
+
* instances of the OpenFin `Platform` class.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
1
10
|
import PlatformModule from './Factory';
|
|
2
11
|
export default PlatformModule;
|
|
3
12
|
export * from './Instance';
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Entry point for the OpenFin Platform namespace.
|
|
4
|
+
*
|
|
5
|
+
* Because TypeDoc does not currently support multiple modules with the same name, the module alias "PlatformModule" is used for
|
|
6
|
+
* the module containing static members of the `Platform` namespace (available under `fin.Platform`), while `Platform` documents
|
|
7
|
+
* instances of the OpenFin `Platform` class.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
2
11
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
12
|
if (k2 === undefined) k2 = k;
|
|
4
13
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -2,99 +2,76 @@ import type * as OpenFin from '../../../OpenFin';
|
|
|
2
2
|
import { Base } from '../../base';
|
|
3
3
|
import { Layout } from './Instance';
|
|
4
4
|
type InitLayoutOptions = OpenFin.InitLayoutOptions;
|
|
5
|
-
/**
|
|
6
|
-
* @PORTED
|
|
7
|
-
* InitLayoutOptions interface
|
|
8
|
-
* @typedef { object } InitLayoutOptions
|
|
9
|
-
* @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
|
|
10
|
-
* then an element with id `layout-container` is used. We recommend using a div element.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* @PORTED
|
|
14
|
-
* PresetLayoutOptions interface
|
|
15
|
-
* @typedef { object } PresetLayoutOptions
|
|
16
|
-
* @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
|
|
17
|
-
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* LayoutConfig interface
|
|
21
|
-
* @typedef { object } LayoutConfig
|
|
22
|
-
* @property { Array<LayoutItem> } content Content of the layout. There can only be one top-level LayoutItem in the content array.
|
|
23
|
-
* We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}
|
|
24
|
-
* or our {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
25
|
-
* @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* @PORTED
|
|
29
|
-
* LayoutItem Interface
|
|
30
|
-
* @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
|
|
31
|
-
* to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
|
|
32
|
-
* {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
33
|
-
* @property { string } type The type of the item. Possible values are 'row', 'column', 'stack', and 'component'.
|
|
34
|
-
* @property { Array<LayoutItem> } [content] An array of configurations for items that will be created as children of this item.
|
|
35
|
-
* @property { string } [componentName] Only a `component` type will have this property and it should be set to `view`.
|
|
36
|
-
* @property { View~options } [componentState] Only a `component` type will have this property and it represents the view
|
|
37
|
-
* options of a given component.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* @PORTED
|
|
41
|
-
* LayoutSettings Interface
|
|
42
|
-
* @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
|
|
43
|
-
* @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
|
|
44
|
-
* If true, stack headers are the only areas where tabs can be dropped.
|
|
45
|
-
* @property { boolean } [hasHeaders=true] Turns tab headers on or off.
|
|
46
|
-
* If false, the layout will be displayed with splitters only.
|
|
47
|
-
* @property {object} [newTabButton]
|
|
48
|
-
* Configuration of the Plus button that appears on each tabstrip. Upon pressing, a new tab
|
|
49
|
-
* will be added to the tabstrip with the specified url.
|
|
50
|
-
* @property {string} [newTabButton.url] Specifies the url that opens in the tab created upon pressing the button.
|
|
51
|
-
* @property { boolean } [popoutWholeStack=false] Whether the popout button will only act on the entire stack,
|
|
52
|
-
* as opposed to only the active tab.
|
|
53
|
-
* @property { boolean } [preventDragIn=false] If true, tabs can't be dragged into the window.
|
|
54
|
-
* @property { boolean } [preventDragOut=false] If true, tabs can't be dragged out of the window.
|
|
55
|
-
* @property { boolean } [preventSplitterResize=false] If true, tab contents can't be resized by the user.
|
|
56
|
-
* @property { boolean } [reorderEnabled=true] If true, the user can re-arrange the layout by
|
|
57
|
-
* dragging items by their tabs to the desired location.
|
|
58
|
-
* @property { boolean } [showCloseIcon=false] Whether to show the close button on stack header
|
|
59
|
-
* (not to be confused with close button on every tab).
|
|
60
|
-
* @property { boolean } [showMaximiseIcon=false] Whether to show the maximize button on stack header.
|
|
61
|
-
* The button will maximize the current tab to fill the entire window.
|
|
62
|
-
* @property { boolean } [showPopoutIcon=false] Whether to show the popout button on stack header.
|
|
63
|
-
* The button will create a new window with current tab as its content.
|
|
64
|
-
* In case `popoutWholeStack` is set to true, all tabs in the stack will be in the new window.
|
|
65
|
-
*/
|
|
66
|
-
/**
|
|
67
|
-
* @lends Platform#Layout
|
|
68
|
-
*/
|
|
69
5
|
export declare class LayoutModule extends Base {
|
|
70
6
|
#private;
|
|
71
7
|
/**
|
|
72
8
|
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
73
|
-
* @param
|
|
74
|
-
*
|
|
75
|
-
* @
|
|
9
|
+
* @param identity
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```js
|
|
13
|
+
* let windowIdentity;
|
|
14
|
+
* if (!fin.me.isWindow) {
|
|
15
|
+
* windowIdentity = fin.me.identity;
|
|
16
|
+
* } else if (fin.me.isView) {
|
|
17
|
+
* windowIdentity = (await fin.me.getCurrentWindow()).identity;
|
|
18
|
+
* } else {
|
|
19
|
+
* throw new Error('Not running in a platform View or Window');
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* const layout = await fin.Platform.Layout.wrap(windowIdentity);
|
|
23
|
+
* // Use wrapped instance to control layout, e.g.:
|
|
24
|
+
* const layoutConfig = await layout.getConfig();
|
|
25
|
+
* ```
|
|
76
26
|
* @static
|
|
77
27
|
*/
|
|
78
28
|
wrap(identity: OpenFin.Identity): Promise<OpenFin.Layout>;
|
|
79
29
|
/**
|
|
80
30
|
* Synchronously returns a Layout object that represents a Window's layout.
|
|
81
|
-
* @param
|
|
82
|
-
*
|
|
83
|
-
* @
|
|
31
|
+
* @param identity
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```js
|
|
35
|
+
* let windowIdentity;
|
|
36
|
+
* if (!fin.me.isWindow) {
|
|
37
|
+
* windowIdentity = fin.me.identity;
|
|
38
|
+
* } else if (fin.me.isView) {
|
|
39
|
+
* windowIdentity = (await fin.me.getCurrentWindow()).identity;
|
|
40
|
+
* } else {
|
|
41
|
+
* throw new Error('Not running in a platform View or Window');
|
|
42
|
+
* }
|
|
43
|
+
*
|
|
44
|
+
* const layout = fin.Platform.Layout.wrapSync(windowIdentity);
|
|
45
|
+
* // Use wrapped instance to control layout, e.g.:
|
|
46
|
+
* const layoutConfig = await layout.getConfig();
|
|
47
|
+
* ```
|
|
84
48
|
* @static
|
|
85
49
|
*/
|
|
86
50
|
wrapSync(identity: OpenFin.Identity): OpenFin.Layout;
|
|
87
51
|
/**
|
|
88
52
|
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
89
|
-
*
|
|
90
|
-
* @
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```js
|
|
56
|
+
* const layout = await fin.Platform.Layout.getCurrent();
|
|
57
|
+
* // Use wrapped instance to control layout, e.g.:
|
|
58
|
+
* const layoutConfig = await layout.getConfig();
|
|
59
|
+
* ```
|
|
91
60
|
* @static
|
|
92
61
|
*/
|
|
93
62
|
getCurrent(): Promise<OpenFin.Layout>;
|
|
94
63
|
/**
|
|
95
64
|
* Synchronously returns a Layout object that represents a Window's layout.
|
|
96
|
-
*
|
|
97
|
-
* @
|
|
65
|
+
*
|
|
66
|
+
* @remarks Cannot be called from a view.
|
|
67
|
+
*
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```js
|
|
71
|
+
* const layout = fin.Platform.Layout.getCurrentSync();
|
|
72
|
+
* // Use wrapped instance to control layout, e.g.:
|
|
73
|
+
* const layoutConfig = await layout.getConfig();
|
|
74
|
+
* ```
|
|
98
75
|
* @static
|
|
99
76
|
*/
|
|
100
77
|
getCurrentSync(): OpenFin.Layout;
|
|
@@ -103,8 +80,8 @@ export declare class LayoutModule extends Base {
|
|
|
103
80
|
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
104
81
|
* A Layout will <a href="tutorial-Layout.DOMEvents.html">emit events locally</a> on the DOM element representing the layout-container.
|
|
105
82
|
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
106
|
-
* @param
|
|
107
|
-
*
|
|
83
|
+
* @param options - Layout init options.
|
|
84
|
+
*
|
|
108
85
|
* @static
|
|
109
86
|
* @experimental
|
|
110
87
|
* @tutorial Layout.init
|
|
@@ -16,70 +16,6 @@ exports.LayoutModule = void 0;
|
|
|
16
16
|
/* eslint-disable no-undef, import/prefer-default-export */
|
|
17
17
|
const base_1 = require("../../base");
|
|
18
18
|
const Instance_1 = require("./Instance");
|
|
19
|
-
/**
|
|
20
|
-
* @PORTED
|
|
21
|
-
* InitLayoutOptions interface
|
|
22
|
-
* @typedef { object } InitLayoutOptions
|
|
23
|
-
* @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
|
|
24
|
-
* then an element with id `layout-container` is used. We recommend using a div element.
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* @PORTED
|
|
28
|
-
* PresetLayoutOptions interface
|
|
29
|
-
* @typedef { object } PresetLayoutOptions
|
|
30
|
-
* @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
|
|
31
|
-
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* LayoutConfig interface
|
|
35
|
-
* @typedef { object } LayoutConfig
|
|
36
|
-
* @property { Array<LayoutItem> } content Content of the layout. There can only be one top-level LayoutItem in the content array.
|
|
37
|
-
* We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}
|
|
38
|
-
* or our {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
39
|
-
* @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
|
|
40
|
-
*/
|
|
41
|
-
/**
|
|
42
|
-
* @PORTED
|
|
43
|
-
* LayoutItem Interface
|
|
44
|
-
* @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
|
|
45
|
-
* to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
|
|
46
|
-
* {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
47
|
-
* @property { string } type The type of the item. Possible values are 'row', 'column', 'stack', and 'component'.
|
|
48
|
-
* @property { Array<LayoutItem> } [content] An array of configurations for items that will be created as children of this item.
|
|
49
|
-
* @property { string } [componentName] Only a `component` type will have this property and it should be set to `view`.
|
|
50
|
-
* @property { View~options } [componentState] Only a `component` type will have this property and it represents the view
|
|
51
|
-
* options of a given component.
|
|
52
|
-
*/
|
|
53
|
-
/**
|
|
54
|
-
* @PORTED
|
|
55
|
-
* LayoutSettings Interface
|
|
56
|
-
* @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
|
|
57
|
-
* @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
|
|
58
|
-
* If true, stack headers are the only areas where tabs can be dropped.
|
|
59
|
-
* @property { boolean } [hasHeaders=true] Turns tab headers on or off.
|
|
60
|
-
* If false, the layout will be displayed with splitters only.
|
|
61
|
-
* @property {object} [newTabButton]
|
|
62
|
-
* Configuration of the Plus button that appears on each tabstrip. Upon pressing, a new tab
|
|
63
|
-
* will be added to the tabstrip with the specified url.
|
|
64
|
-
* @property {string} [newTabButton.url] Specifies the url that opens in the tab created upon pressing the button.
|
|
65
|
-
* @property { boolean } [popoutWholeStack=false] Whether the popout button will only act on the entire stack,
|
|
66
|
-
* as opposed to only the active tab.
|
|
67
|
-
* @property { boolean } [preventDragIn=false] If true, tabs can't be dragged into the window.
|
|
68
|
-
* @property { boolean } [preventDragOut=false] If true, tabs can't be dragged out of the window.
|
|
69
|
-
* @property { boolean } [preventSplitterResize=false] If true, tab contents can't be resized by the user.
|
|
70
|
-
* @property { boolean } [reorderEnabled=true] If true, the user can re-arrange the layout by
|
|
71
|
-
* dragging items by their tabs to the desired location.
|
|
72
|
-
* @property { boolean } [showCloseIcon=false] Whether to show the close button on stack header
|
|
73
|
-
* (not to be confused with close button on every tab).
|
|
74
|
-
* @property { boolean } [showMaximiseIcon=false] Whether to show the maximize button on stack header.
|
|
75
|
-
* The button will maximize the current tab to fill the entire window.
|
|
76
|
-
* @property { boolean } [showPopoutIcon=false] Whether to show the popout button on stack header.
|
|
77
|
-
* The button will create a new window with current tab as its content.
|
|
78
|
-
* In case `popoutWholeStack` is set to true, all tabs in the stack will be in the new window.
|
|
79
|
-
*/
|
|
80
|
-
/**
|
|
81
|
-
* @lends Platform#Layout
|
|
82
|
-
*/
|
|
83
19
|
class LayoutModule extends base_1.Base {
|
|
84
20
|
constructor() {
|
|
85
21
|
super(...arguments);
|
|
@@ -89,8 +25,8 @@ class LayoutModule extends base_1.Base {
|
|
|
89
25
|
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
90
26
|
* A Layout will <a href="tutorial-Layout.DOMEvents.html">emit events locally</a> on the DOM element representing the layout-container.
|
|
91
27
|
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
92
|
-
* @param
|
|
93
|
-
*
|
|
28
|
+
* @param options - Layout init options.
|
|
29
|
+
*
|
|
94
30
|
* @static
|
|
95
31
|
* @experimental
|
|
96
32
|
* @tutorial Layout.init
|
|
@@ -111,9 +47,23 @@ class LayoutModule extends base_1.Base {
|
|
|
111
47
|
}
|
|
112
48
|
/**
|
|
113
49
|
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
114
|
-
* @param
|
|
115
|
-
*
|
|
116
|
-
* @
|
|
50
|
+
* @param identity
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```js
|
|
54
|
+
* let windowIdentity;
|
|
55
|
+
* if (!fin.me.isWindow) {
|
|
56
|
+
* windowIdentity = fin.me.identity;
|
|
57
|
+
* } else if (fin.me.isView) {
|
|
58
|
+
* windowIdentity = (await fin.me.getCurrentWindow()).identity;
|
|
59
|
+
* } else {
|
|
60
|
+
* throw new Error('Not running in a platform View or Window');
|
|
61
|
+
* }
|
|
62
|
+
*
|
|
63
|
+
* const layout = await fin.Platform.Layout.wrap(windowIdentity);
|
|
64
|
+
* // Use wrapped instance to control layout, e.g.:
|
|
65
|
+
* const layoutConfig = await layout.getConfig();
|
|
66
|
+
* ```
|
|
117
67
|
* @static
|
|
118
68
|
*/
|
|
119
69
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -125,9 +75,23 @@ class LayoutModule extends base_1.Base {
|
|
|
125
75
|
}
|
|
126
76
|
/**
|
|
127
77
|
* Synchronously returns a Layout object that represents a Window's layout.
|
|
128
|
-
* @param
|
|
129
|
-
*
|
|
130
|
-
* @
|
|
78
|
+
* @param identity
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```js
|
|
82
|
+
* let windowIdentity;
|
|
83
|
+
* if (!fin.me.isWindow) {
|
|
84
|
+
* windowIdentity = fin.me.identity;
|
|
85
|
+
* } else if (fin.me.isView) {
|
|
86
|
+
* windowIdentity = (await fin.me.getCurrentWindow()).identity;
|
|
87
|
+
* } else {
|
|
88
|
+
* throw new Error('Not running in a platform View or Window');
|
|
89
|
+
* }
|
|
90
|
+
*
|
|
91
|
+
* const layout = fin.Platform.Layout.wrapSync(windowIdentity);
|
|
92
|
+
* // Use wrapped instance to control layout, e.g.:
|
|
93
|
+
* const layoutConfig = await layout.getConfig();
|
|
94
|
+
* ```
|
|
131
95
|
* @static
|
|
132
96
|
*/
|
|
133
97
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -139,8 +103,13 @@ class LayoutModule extends base_1.Base {
|
|
|
139
103
|
}
|
|
140
104
|
/**
|
|
141
105
|
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
142
|
-
*
|
|
143
|
-
* @
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```js
|
|
109
|
+
* const layout = await fin.Platform.Layout.getCurrent();
|
|
110
|
+
* // Use wrapped instance to control layout, e.g.:
|
|
111
|
+
* const layoutConfig = await layout.getConfig();
|
|
112
|
+
* ```
|
|
144
113
|
* @static
|
|
145
114
|
*/
|
|
146
115
|
async getCurrent() {
|
|
@@ -155,8 +124,16 @@ class LayoutModule extends base_1.Base {
|
|
|
155
124
|
}
|
|
156
125
|
/**
|
|
157
126
|
* Synchronously returns a Layout object that represents a Window's layout.
|
|
158
|
-
*
|
|
159
|
-
* @
|
|
127
|
+
*
|
|
128
|
+
* @remarks Cannot be called from a view.
|
|
129
|
+
*
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* ```js
|
|
133
|
+
* const layout = fin.Platform.Layout.getCurrentSync();
|
|
134
|
+
* // Use wrapped instance to control layout, e.g.:
|
|
135
|
+
* const layoutConfig = await layout.getConfig();
|
|
136
|
+
* ```
|
|
160
137
|
* @static
|
|
161
138
|
*/
|
|
162
139
|
getCurrentSync() {
|
|
@@ -4,53 +4,188 @@ import { Base } from '../../base';
|
|
|
4
4
|
type Identity = OpenFin.Identity;
|
|
5
5
|
type InitLayoutOptions = OpenFin.InitLayoutOptions;
|
|
6
6
|
type PresetLayoutOptions = OpenFin.PresetLayoutOptions;
|
|
7
|
-
/**
|
|
8
|
-
* @lends Platform#Layout
|
|
9
|
-
*/
|
|
10
7
|
export declare class Layout extends Base {
|
|
11
8
|
#private;
|
|
9
|
+
/**
|
|
10
|
+
* Initialize the window's Layout.
|
|
11
|
+
*
|
|
12
|
+
* @remarks Must be called from a custom window that has a 'layout' option set upon creation of that window. If a containerId
|
|
13
|
+
* is not provided, this method attempts to find an element with the id `layout-container`.
|
|
14
|
+
*
|
|
15
|
+
* A Layout will emit events locally on the DOM element representing the layout-container. In order to capture the relevant
|
|
16
|
+
* events during Layout initiation, set up the listeners on the DOM element prior to calling init.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```js
|
|
20
|
+
* // if no options are included, the layout in the window options is initialized in an element with the id `layout-container`
|
|
21
|
+
* const layout = await fin.Platform.Layout.init();
|
|
22
|
+
* ```
|
|
23
|
+
* <br /><br />
|
|
24
|
+
* # Example
|
|
25
|
+
* To target a different HTML element use the options object.
|
|
26
|
+
* ```js
|
|
27
|
+
* const containerId = 'my-custom-container-id';
|
|
28
|
+
*
|
|
29
|
+
* const myLayoutContainer = document.getElementById(containerId);
|
|
30
|
+
*
|
|
31
|
+
* myLayoutContainer.addEventListener('tab-created', function(event) {
|
|
32
|
+
* const { tabSelector } = event.detail;
|
|
33
|
+
* const tabElement = document.getElementById(tabSelector);
|
|
34
|
+
* const existingColor = tabElement.style.backgroundColor;
|
|
35
|
+
* tabElement.style.backgroundColor = "red";
|
|
36
|
+
* setTimeout(() => {
|
|
37
|
+
* tabElement.style.backgroundColor = existingColor;
|
|
38
|
+
* }, 2000);
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // initialize the layout into an existing HTML element with the div `my-custom-container-id`
|
|
42
|
+
* // the window must have been created with a layout in its window options
|
|
43
|
+
* const layout = await fin.Platform.Layout.init({ containerId });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
12
46
|
init: (options?: InitLayoutOptions) => Promise<Layout>;
|
|
13
47
|
identity: Identity;
|
|
14
48
|
private platform;
|
|
15
49
|
wire: Transport;
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
16
53
|
constructor(identity: OpenFin.Identity, wire: Transport);
|
|
17
54
|
/**
|
|
18
55
|
* Returns the configuration of the window's layout. Returns the same information that is returned for all windows in getSnapshot.
|
|
19
|
-
*
|
|
20
|
-
* @
|
|
56
|
+
*
|
|
57
|
+
* @remarks Cannot be called from a View.
|
|
58
|
+
*
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```js
|
|
62
|
+
* const layout = fin.Platform.Layout.getCurrentSync();
|
|
63
|
+
* // Use wrapped instance to get the layout configuration of the current window's Layout:
|
|
64
|
+
* const layoutConfig = await layout.getConfig();
|
|
65
|
+
* ```
|
|
21
66
|
*/
|
|
22
67
|
getConfig(): Promise<any>;
|
|
23
68
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
69
|
+
* Replaces a Platform window's layout with a new layout.
|
|
70
|
+
*
|
|
71
|
+
* @remarks Any views that were in the old layout but not the new layout will be destroyed. Views will be assigned a randomly generated name to avoid collisions.
|
|
72
|
+
* @example
|
|
73
|
+
* ```js
|
|
74
|
+
* let windowIdentity;
|
|
75
|
+
* if (fin.me.isWindow) {
|
|
76
|
+
* windowIdentity = fin.me.identity;
|
|
77
|
+
* } else if (fin.me.isView) {
|
|
78
|
+
* windowIdentity = (await fin.me.getCurrentWindow()).identity;
|
|
79
|
+
* } else {
|
|
80
|
+
* throw new Error('Not running in a platform View or Window');
|
|
81
|
+
* }
|
|
82
|
+
*
|
|
83
|
+
* const layout = fin.Platform.Layout.wrapSync(windowIdentity);
|
|
84
|
+
*
|
|
85
|
+
* const newLayout = {
|
|
86
|
+
* content: [
|
|
87
|
+
* {
|
|
88
|
+
* type: 'stack',
|
|
89
|
+
* content: [
|
|
90
|
+
* {
|
|
91
|
+
* type: 'component',
|
|
92
|
+
* componentName: 'view',
|
|
93
|
+
* componentState: {
|
|
94
|
+
* name: 'new_component_A1',
|
|
95
|
+
* processAffinity: 'ps_1',
|
|
96
|
+
* url: 'https://www.example.com'
|
|
97
|
+
* }
|
|
98
|
+
* },
|
|
99
|
+
* {
|
|
100
|
+
* type: 'component',
|
|
101
|
+
* componentName: 'view',
|
|
102
|
+
* componentState: {
|
|
103
|
+
* name: 'new_component_A2',
|
|
104
|
+
* url: 'https://cdn.openfin.co/embed-web/chart.html'
|
|
105
|
+
* }
|
|
106
|
+
* }
|
|
107
|
+
* ]
|
|
108
|
+
* }
|
|
109
|
+
* ]
|
|
110
|
+
* };
|
|
111
|
+
*
|
|
112
|
+
* layout.replace(newLayout);
|
|
113
|
+
* ```
|
|
26
114
|
*/
|
|
27
|
-
|
|
115
|
+
replace: (layout: OpenFin.LayoutOptions) => Promise<void>;
|
|
28
116
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
117
|
+
* Retrieves the top level content item of the layout.
|
|
118
|
+
*
|
|
119
|
+
* @remarks Cannot be called from a view.
|
|
120
|
+
*
|
|
121
|
+
*
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```js
|
|
125
|
+
* if (!fin.me.isWindow) {
|
|
126
|
+
* throw new Error('Not running in a platform View.');
|
|
127
|
+
* }
|
|
128
|
+
*
|
|
129
|
+
* // From the layout window
|
|
130
|
+
* const layout = fin.Platform.Layout.getCurrentSync();
|
|
131
|
+
* // Retrieves the ColumnOrRow instance
|
|
132
|
+
* const rootItem = await layout.getRootItem();
|
|
133
|
+
* const content = await rootItem.getContent();
|
|
134
|
+
* console.log(`The root ColumnOrRow instance has ${content.length} item(s)`);
|
|
135
|
+
* ```
|
|
35
136
|
*/
|
|
36
|
-
|
|
137
|
+
getRootItem(): Promise<OpenFin.ColumnOrRow | OpenFin.TabStack>;
|
|
37
138
|
/**
|
|
38
139
|
* Replaces the specified view with a view with the provided configuration.
|
|
39
|
-
*
|
|
140
|
+
*
|
|
141
|
+
* @remarks The old view is stripped of its listeners and either closed or attached to the provider window
|
|
40
142
|
* depending on `detachOnClose` view option.
|
|
41
|
-
*
|
|
42
|
-
* @param
|
|
43
|
-
* @
|
|
44
|
-
*
|
|
143
|
+
*
|
|
144
|
+
* @param viewToReplace Identity of the view to be replaced
|
|
145
|
+
* @param newView Creation options of the new view.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```js
|
|
149
|
+
* let currentWindow;
|
|
150
|
+
* if (fin.me.isWindow) {
|
|
151
|
+
* currentWindow = fin.me;
|
|
152
|
+
* } else if (fin.me.isView) {
|
|
153
|
+
* currentWindow = await fin.me.getCurrentWindow();
|
|
154
|
+
* } else {
|
|
155
|
+
* throw new Error('Not running in a platform View or Window');
|
|
156
|
+
* }
|
|
157
|
+
*
|
|
158
|
+
* const layout = fin.Platform.Layout.wrapSync(currentWindow.identity);
|
|
159
|
+
* const viewToReplace = (await currentWindow.getCurrentViews())[0];
|
|
160
|
+
* const newViewConfig = {url: 'https://example.com'};
|
|
161
|
+
* await layout.replaceView(viewToReplace.identity, newViewConfig);
|
|
162
|
+
* ```
|
|
45
163
|
*/
|
|
46
164
|
replaceView: (viewToReplace: Identity, newView: OpenFin.PlatformViewCreationOptions) => Promise<void>;
|
|
47
165
|
/**
|
|
48
166
|
* Replaces a Platform window's layout with a preset layout arrangement using the existing Views attached to the window.
|
|
49
167
|
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
50
|
-
* @param
|
|
168
|
+
* @param options Mandatory object with `presetType` property that sets which preset layout arrangement to use.
|
|
51
169
|
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
52
|
-
*
|
|
53
|
-
* @
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```js
|
|
173
|
+
* let windowIdentity;
|
|
174
|
+
* if (fin.me.isWindow) {
|
|
175
|
+
* windowIdentity = fin.me.identity;
|
|
176
|
+
* } else if (fin.me.isView) {
|
|
177
|
+
* windowIdentity = (await fin.me.getCurrentWindow()).identity;
|
|
178
|
+
* } else {
|
|
179
|
+
* throw new Error('Not running in a platform View or Window');
|
|
180
|
+
* }
|
|
181
|
+
*
|
|
182
|
+
* const layout = fin.Platform.Layout.wrapSync(windowIdentity);
|
|
183
|
+
* await layout.applyPreset({ presetType: 'grid' });
|
|
184
|
+
*
|
|
185
|
+
* // wait 5 seconds until you change the layout from grid to tabs
|
|
186
|
+
* await new Promise (res => setTimeout(res, 5000));
|
|
187
|
+
* await layout.applyPreset({ presetType: 'tabs' });
|
|
188
|
+
* ```
|
|
54
189
|
*/
|
|
55
190
|
applyPreset: (options: PresetLayoutOptions) => Promise<void>;
|
|
56
191
|
}
|