@openfin/core 25.68.30 → 25.70.2
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.d.ts +30 -826
- package/README.md +12 -2
- package/package.json +1 -1
- package/src/api/application/Factory.d.ts +145 -145
- package/src/api/application/Factory.js +229 -229
- package/src/api/application/Instance.d.ts +301 -302
- package/src/api/application/Instance.js +412 -412
- package/src/api/application/index.d.ts +3 -3
- package/src/api/application/index.js +15 -15
- package/src/api/base.d.ts +43 -43
- package/src/api/base.js +177 -177
- package/src/api/clipboard/index.d.ts +69 -69
- package/src/api/clipboard/index.js +88 -88
- package/src/api/events/application.d.ts +69 -0
- package/src/api/events/application.js +2 -0
- package/src/api/events/base.d.ts +17 -0
- package/src/api/events/base.js +2 -0
- package/src/api/events/channel.d.ts +10 -11
- package/src/api/events/channel.js +2 -2
- package/src/api/events/emitterMap.d.ts +11 -11
- package/src/api/events/emitterMap.js +35 -35
- package/src/api/events/eventAggregator.d.ts +5 -5
- package/src/api/events/eventAggregator.js +43 -43
- package/src/api/events/externalApplication.d.ts +5 -0
- package/src/api/events/externalApplication.js +2 -0
- package/src/api/events/frame.d.ts +9 -0
- package/src/api/events/frame.js +2 -0
- package/src/api/events/globalHotkey.d.ts +10 -0
- package/src/api/events/globalHotkey.js +2 -0
- package/src/api/events/platform.d.ts +18 -0
- package/src/api/events/platform.js +2 -0
- package/src/api/events/system.d.ts +22 -0
- package/src/api/events/system.js +2 -0
- package/src/api/events/view.d.ts +56 -0
- package/src/api/events/view.js +2 -0
- package/src/api/events/webcontents.d.ts +48 -0
- package/src/api/events/webcontents.js +2 -0
- package/src/api/events/window.d.ts +176 -0
- package/src/api/events/window.js +2 -0
- package/src/api/external-application/Factory.d.ts +26 -26
- package/src/api/external-application/Factory.js +40 -40
- package/src/api/external-application/Instance.d.ts +101 -102
- package/src/api/external-application/Instance.js +109 -109
- package/src/api/external-application/index.d.ts +3 -3
- package/src/api/external-application/index.js +15 -15
- package/src/api/fin.d.ts +49 -49
- package/src/api/fin.js +43 -43
- package/src/api/frame/Factory.d.ts +36 -36
- package/src/api/frame/Factory.js +69 -69
- package/src/api/frame/Instance.d.ts +121 -121
- package/src/api/frame/Instance.js +130 -130
- package/src/api/frame/index.d.ts +3 -3
- package/src/api/frame/index.js +15 -15
- package/src/api/global-hotkey/index.d.ts +38 -38
- package/src/api/global-hotkey/index.js +58 -58
- package/src/api/interappbus/channel/channel.d.ts +26 -26
- package/src/api/interappbus/channel/channel.js +77 -77
- package/src/api/interappbus/channel/channels-docs.d.ts +318 -318
- package/src/api/interappbus/channel/channels-docs.js +376 -376
- package/src/api/interappbus/channel/client.d.ts +22 -22
- package/src/api/interappbus/channel/client.js +84 -84
- package/src/api/interappbus/channel/connection-manager.d.ts +28 -28
- package/src/api/interappbus/channel/connection-manager.js +244 -244
- package/src/api/interappbus/channel/index.d.ts +22 -23
- package/src/api/interappbus/channel/index.js +121 -121
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +13 -13
- package/src/api/interappbus/channel/protocols/classic/message-receiver.js +73 -73
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +22 -22
- package/src/api/interappbus/channel/protocols/classic/strategy.js +84 -84
- package/src/api/interappbus/channel/protocols/combined/strategy.d.ts +20 -20
- package/src/api/interappbus/channel/protocols/combined/strategy.js +58 -58
- package/src/api/interappbus/channel/protocols/index.d.ts +44 -44
- package/src/api/interappbus/channel/protocols/index.js +2 -2
- package/src/api/interappbus/channel/protocols/protocol-manager.d.ts +10 -10
- package/src/api/interappbus/channel/protocols/protocol-manager.js +43 -43
- package/src/api/interappbus/channel/protocols/rtc/endpoint.d.ts +23 -23
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +135 -135
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +30 -30
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.js +131 -131
- package/src/api/interappbus/channel/protocols/rtc/strategy.d.ts +22 -22
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +87 -87
- package/src/api/interappbus/channel/protocols/strategy-types.d.ts +13 -13
- package/src/api/interappbus/channel/protocols/strategy-types.js +2 -2
- package/src/api/interappbus/channel/protocols/strategy.d.ts +15 -15
- package/src/api/interappbus/channel/protocols/strategy.js +2 -2
- package/src/api/interappbus/channel/provider.d.ts +31 -31
- package/src/api/interappbus/channel/provider.js +160 -160
- package/src/api/interappbus/index.d.ts +85 -86
- package/src/api/interappbus/index.js +175 -175
- package/src/api/interop/Factory.d.ts +37 -37
- package/src/api/interop/Factory.js +54 -54
- package/src/api/interop/InteropBroker.d.ts +363 -363
- package/src/api/interop/InteropBroker.js +914 -914
- package/src/api/interop/InteropClient.d.ts +268 -268
- package/src/api/interop/InteropClient.js +450 -450
- package/src/api/interop/SessionContextGroupBroker.d.ts +26 -26
- package/src/api/interop/SessionContextGroupBroker.js +107 -107
- package/src/api/interop/SessionContextGroupClient.d.ts +20 -20
- package/src/api/interop/SessionContextGroupClient.js +85 -85
- package/src/api/interop/fdc3/fdc3-1.2.d.ts +187 -187
- package/src/api/interop/fdc3/fdc3-1.2.js +385 -385
- package/src/api/interop/fdc3/fdc3.js +17 -17
- package/src/api/interop/fdc3/utils.d.ts +6 -6
- package/src/api/interop/fdc3/utils.js +17 -17
- package/src/api/interop/index.d.ts +4 -4
- package/src/api/interop/index.js +16 -16
- package/src/api/interop/utils.d.ts +11 -11
- package/src/api/interop/utils.js +36 -36
- package/src/api/me.d.ts +38 -35
- package/src/api/me.js +128 -60
- package/src/api/platform/Factory.d.ts +109 -109
- package/src/api/platform/Factory.js +188 -188
- package/src/api/platform/Instance.d.ts +122 -122
- package/src/api/platform/Instance.js +298 -298
- package/src/api/platform/common-utils.d.ts +6 -6
- package/src/api/platform/common-utils.js +16 -16
- package/src/api/platform/index.d.ts +3 -3
- package/src/api/platform/index.js +15 -15
- package/src/api/platform/layout/Factory.d.ts +108 -108
- package/src/api/platform/layout/Factory.js +189 -189
- package/src/api/platform/layout/Instance.d.ts +49 -49
- package/src/api/platform/layout/Instance.js +99 -99
- package/src/api/platform/layout/index.d.ts +2 -2
- package/src/api/platform/layout/index.js +14 -14
- package/src/api/platform/layout/shapes.d.ts +11 -0
- package/src/api/{window → platform/layout}/shapes.js +2 -2
- package/src/api/snapshot-source/Factory.d.ts +36 -36
- package/src/api/snapshot-source/Factory.js +65 -65
- package/src/api/snapshot-source/Instance.d.ts +30 -30
- package/src/api/snapshot-source/Instance.js +134 -134
- package/src/api/snapshot-source/index.d.ts +3 -3
- package/src/api/snapshot-source/index.js +15 -15
- package/src/api/snapshot-source/utils.d.ts +1 -1
- package/src/api/snapshot-source/utils.js +5 -5
- package/src/api/system/index.d.ts +960 -961
- package/src/api/system/index.js +1241 -1241
- package/src/api/view/Factory.d.ts +49 -49
- package/src/api/view/Factory.js +103 -103
- package/src/api/view/Instance.d.ts +387 -380
- package/src/api/view/Instance.js +422 -415
- package/src/api/view/index.d.ts +3 -3
- package/src/api/view/index.js +15 -15
- package/src/api/webcontents/main.d.ts +36 -36
- package/src/api/webcontents/main.js +82 -82
- package/src/api/window/Factory.d.ts +44 -44
- package/src/api/window/Factory.js +91 -91
- package/src/api/window/Instance.d.ts +972 -966
- package/src/api/window/Instance.js +1209 -1202
- package/src/api/window/index.d.ts +3 -5
- package/src/api/window/index.js +15 -17
- package/src/environment/environment.d.ts +28 -25
- package/src/environment/environment.js +4 -4
- package/src/environment/node-env.d.ts +25 -26
- package/src/environment/node-env.js +64 -64
- package/src/environment/openfin-env.d.ts +29 -30
- package/src/environment/openfin-env.js +107 -107
- package/src/mock.d.ts +3 -3
- package/src/mock.js +91 -90
- package/src/shapes/ERROR_BOX_TYPES.d.ts +1 -0
- package/src/shapes/ERROR_BOX_TYPES.js +2 -0
- package/src/shapes/WebOptions.d.ts +12 -0
- package/src/shapes/WebOptions.js +2 -0
- package/src/shapes/WindowOptions.d.ts +42 -0
- package/src/shapes/WindowOptions.js +2 -0
- package/src/shapes/protocol.d.ts +178 -0
- package/src/shapes/protocol.js +2 -0
- package/src/transport/fin_store.d.ts +4 -4
- package/src/transport/fin_store.js +16 -16
- package/src/transport/transport-errors.d.ts +18 -18
- package/src/transport/transport-errors.js +37 -37
- package/src/transport/transport.d.ts +56 -43
- package/src/transport/transport.js +181 -181
- package/src/transport/wire.d.ts +71 -11
- package/src/transport/wire.js +32 -32
- package/src/util/asyncFilter.d.ts +1 -1
- package/src/util/asyncFilter.js +7 -7
- package/src/util/errors.d.ts +9 -5
- package/src/util/errors.js +11 -11
- package/src/util/exhaustive.d.ts +1 -1
- package/src/util/exhaustive.js +7 -7
- package/src/util/http.d.ts +11 -11
- package/src/util/http.js +83 -83
- package/src/util/normalize-config.d.ts +3 -5
- package/src/util/normalize-config.js +47 -47
- package/src/util/promises.d.ts +5 -5
- package/src/util/promises.js +27 -27
- package/src/util/ref-counter.d.ts +7 -7
- package/src/util/ref-counter.js +51 -51
- package/src/util/runtimeVersioning.d.ts +3 -3
- package/src/util/runtimeVersioning.js +25 -25
- package/src/util/utilTypes.d.ts +8 -8
- package/src/util/utilTypes.js +2 -2
- package/src/util/validate.d.ts +3 -3
- package/src/util/validate.js +11 -11
- package/docs.README(OLD).md +0 -82
- package/resources/win/OpenFinRVM.exe +0 -0
- package/src/api/window/bounds-changed.d.ts +0 -10
- package/src/api/window/bounds-changed.js +0 -6
- package/src/api/window/shapes.d.ts +0 -13
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
const Factory_1 = require("./Factory");
|
|
14
|
-
exports.default = Factory_1.default;
|
|
15
|
-
__exportStar(require("./Instance"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
const Factory_1 = require("./Factory");
|
|
14
|
+
exports.default = Factory_1.default;
|
|
15
|
+
__exportStar(require("./Instance"), exports);
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
import { Layout } from './Instance';
|
|
2
|
-
import { Base } from '../../base';
|
|
3
|
-
import InitLayoutOptions = OpenFin.InitLayoutOptions;
|
|
4
|
-
/**
|
|
5
|
-
* InitLayoutOptions interface
|
|
6
|
-
* @typedef { object } InitLayoutOptions
|
|
7
|
-
* @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
|
|
8
|
-
* then an element with id `layout-container` is used. We recommend using a div element.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* PresetLayoutOptions interface
|
|
12
|
-
* @typedef { object } PresetLayoutOptions
|
|
13
|
-
* @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
|
|
14
|
-
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* LayoutConfig interface
|
|
18
|
-
* @typedef { object } LayoutConfig
|
|
19
|
-
* @property { Array<LayoutItem> } content Content of the layout. There can only be one top-level LayoutItem in the content array.
|
|
20
|
-
* We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}
|
|
21
|
-
* or our {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
22
|
-
* @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* LayoutItem Interface
|
|
26
|
-
* @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
|
|
27
|
-
* to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
|
|
28
|
-
* {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
29
|
-
* @property { string } type The type of the item. Possible values are 'row', 'column', 'stack', and 'component'.
|
|
30
|
-
* @property { Array<LayoutItem> } [content] An array of configurations for items that will be created as children of this item.
|
|
31
|
-
* @property { string } [componentName] Only a `component` type will have this property and it should be set to `view`.
|
|
32
|
-
* @property { View~options } [componentState] Only a `component` type will have this property and it represents the view
|
|
33
|
-
* options of a given component.
|
|
34
|
-
*/
|
|
35
|
-
/**
|
|
36
|
-
* LayoutSettings Interface
|
|
37
|
-
* @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
|
|
38
|
-
* @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
|
|
39
|
-
* If true, stack headers are the only areas where tabs can be dropped.
|
|
40
|
-
* @property { boolean } [hasHeaders=true] Turns tab headers on or off.
|
|
41
|
-
* If false, the layout will be displayed with splitters only.
|
|
42
|
-
* @property {object} [newTabButton]
|
|
43
|
-
* Configuration of the Plus button that appears on each tabstrip. Upon pressing, a new tab
|
|
44
|
-
* will be added to the tabstrip with the specified url.
|
|
45
|
-
* @property {string} [newTabButton.url] Specifies the url that opens in the tab created upon pressing the button.
|
|
46
|
-
* @property { boolean } [popoutWholeStack=false] Whether the popout button will only act on the entire stack,
|
|
47
|
-
* as opposed to only the active tab.
|
|
48
|
-
* @property { boolean } [preventDragIn=false] If true, tabs can't be dragged into the window.
|
|
49
|
-
* @property { boolean } [preventDragOut=false] If true, tabs can't be dragged out of the window.
|
|
50
|
-
* @property { boolean } [preventSplitterResize=false] If true, tab contents can't be resized by the user.
|
|
51
|
-
* @property { boolean } [reorderEnabled=true] If true, the user can re-arrange the layout by
|
|
52
|
-
* dragging items by their tabs to the desired location.
|
|
53
|
-
* @property { boolean } [showCloseIcon=false] Whether to show the close button on stack header
|
|
54
|
-
* (not to be confused with close button on every tab).
|
|
55
|
-
* @property { boolean } [showMaximiseIcon=false] Whether to show the maximize button on stack header.
|
|
56
|
-
* The button will maximize the current tab to fill the entire window.
|
|
57
|
-
* @property { boolean } [showPopoutIcon=false] Whether to show the popout button on stack header.
|
|
58
|
-
* The button will create a new window with current tab as its content.
|
|
59
|
-
* In case `popoutWholeStack` is set to true, all tabs in the stack will be in the new window.
|
|
60
|
-
*/
|
|
61
|
-
/**
|
|
62
|
-
* @lends Platform#Layout
|
|
63
|
-
*/
|
|
64
|
-
export declare class LayoutModule extends Base {
|
|
65
|
-
#private;
|
|
66
|
-
/**
|
|
67
|
-
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
68
|
-
* @param { Identity } identity
|
|
69
|
-
* @return {Promise.<Layout>}
|
|
70
|
-
* @tutorial Layout.wrap
|
|
71
|
-
* @static
|
|
72
|
-
*/
|
|
73
|
-
wrap(identity: OpenFin.Identity): Promise<OpenFin.Layout>;
|
|
74
|
-
/**
|
|
75
|
-
* Synchronously returns a Layout object that represents a Window's layout.
|
|
76
|
-
* @param { Identity } identity
|
|
77
|
-
* @return {Layout}
|
|
78
|
-
* @tutorial Layout.wrapSync
|
|
79
|
-
* @static
|
|
80
|
-
*/
|
|
81
|
-
wrapSync(identity: OpenFin.Identity): OpenFin.Layout;
|
|
82
|
-
/**
|
|
83
|
-
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
84
|
-
* @return {Promise.<Layout>}
|
|
85
|
-
* @tutorial Layout.getCurrent
|
|
86
|
-
* @static
|
|
87
|
-
*/
|
|
88
|
-
getCurrent(): Promise<OpenFin.Layout>;
|
|
89
|
-
/**
|
|
90
|
-
* Synchronously returns a Layout object that represents a Window's layout.
|
|
91
|
-
* @return {Layout}
|
|
92
|
-
* @tutorial Layout.getCurrentSync
|
|
93
|
-
* @static
|
|
94
|
-
*/
|
|
95
|
-
getCurrentSync(): OpenFin.Layout;
|
|
96
|
-
/**
|
|
97
|
-
* Initialize the window's Layout. Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
|
98
|
-
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
99
|
-
* A Layout will <a href="tutorial-Layout.DOMEvents.html">emit events locally</a> on the DOM element representing the layout-container.
|
|
100
|
-
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
101
|
-
* @param { InitLayoutOptions } [options] - Layout init options.
|
|
102
|
-
* @return { Promise<Layout> }
|
|
103
|
-
* @static
|
|
104
|
-
* @experimental
|
|
105
|
-
* @tutorial Layout.init
|
|
106
|
-
*/
|
|
107
|
-
init: (options?: InitLayoutOptions) => Promise<OpenFin.Layout>;
|
|
108
|
-
}
|
|
1
|
+
import { Layout } from './Instance';
|
|
2
|
+
import { Base } from '../../base';
|
|
3
|
+
import InitLayoutOptions = OpenFin.InitLayoutOptions;
|
|
4
|
+
/**
|
|
5
|
+
* InitLayoutOptions interface
|
|
6
|
+
* @typedef { object } InitLayoutOptions
|
|
7
|
+
* @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
|
|
8
|
+
* then an element with id `layout-container` is used. We recommend using a div element.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* PresetLayoutOptions interface
|
|
12
|
+
* @typedef { object } PresetLayoutOptions
|
|
13
|
+
* @property { LayoutPresetTypes } presetType Which preset layout arrangement to use.
|
|
14
|
+
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* LayoutConfig interface
|
|
18
|
+
* @typedef { object } LayoutConfig
|
|
19
|
+
* @property { Array<LayoutItem> } content Content of the layout. There can only be one top-level LayoutItem in the content array.
|
|
20
|
+
* We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot}
|
|
21
|
+
* or our {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
22
|
+
* @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* LayoutItem Interface
|
|
26
|
+
* @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
|
|
27
|
+
* to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
|
|
28
|
+
* {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
29
|
+
* @property { string } type The type of the item. Possible values are 'row', 'column', 'stack', and 'component'.
|
|
30
|
+
* @property { Array<LayoutItem> } [content] An array of configurations for items that will be created as children of this item.
|
|
31
|
+
* @property { string } [componentName] Only a `component` type will have this property and it should be set to `view`.
|
|
32
|
+
* @property { View~options } [componentState] Only a `component` type will have this property and it represents the view
|
|
33
|
+
* options of a given component.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* LayoutSettings Interface
|
|
37
|
+
* @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
|
|
38
|
+
* @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
|
|
39
|
+
* If true, stack headers are the only areas where tabs can be dropped.
|
|
40
|
+
* @property { boolean } [hasHeaders=true] Turns tab headers on or off.
|
|
41
|
+
* If false, the layout will be displayed with splitters only.
|
|
42
|
+
* @property {object} [newTabButton]
|
|
43
|
+
* Configuration of the Plus button that appears on each tabstrip. Upon pressing, a new tab
|
|
44
|
+
* will be added to the tabstrip with the specified url.
|
|
45
|
+
* @property {string} [newTabButton.url] Specifies the url that opens in the tab created upon pressing the button.
|
|
46
|
+
* @property { boolean } [popoutWholeStack=false] Whether the popout button will only act on the entire stack,
|
|
47
|
+
* as opposed to only the active tab.
|
|
48
|
+
* @property { boolean } [preventDragIn=false] If true, tabs can't be dragged into the window.
|
|
49
|
+
* @property { boolean } [preventDragOut=false] If true, tabs can't be dragged out of the window.
|
|
50
|
+
* @property { boolean } [preventSplitterResize=false] If true, tab contents can't be resized by the user.
|
|
51
|
+
* @property { boolean } [reorderEnabled=true] If true, the user can re-arrange the layout by
|
|
52
|
+
* dragging items by their tabs to the desired location.
|
|
53
|
+
* @property { boolean } [showCloseIcon=false] Whether to show the close button on stack header
|
|
54
|
+
* (not to be confused with close button on every tab).
|
|
55
|
+
* @property { boolean } [showMaximiseIcon=false] Whether to show the maximize button on stack header.
|
|
56
|
+
* The button will maximize the current tab to fill the entire window.
|
|
57
|
+
* @property { boolean } [showPopoutIcon=false] Whether to show the popout button on stack header.
|
|
58
|
+
* The button will create a new window with current tab as its content.
|
|
59
|
+
* In case `popoutWholeStack` is set to true, all tabs in the stack will be in the new window.
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* @lends Platform#Layout
|
|
63
|
+
*/
|
|
64
|
+
export declare class LayoutModule extends Base {
|
|
65
|
+
#private;
|
|
66
|
+
/**
|
|
67
|
+
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
68
|
+
* @param { Identity } identity
|
|
69
|
+
* @return {Promise.<Layout>}
|
|
70
|
+
* @tutorial Layout.wrap
|
|
71
|
+
* @static
|
|
72
|
+
*/
|
|
73
|
+
wrap(identity: OpenFin.Identity): Promise<OpenFin.Layout>;
|
|
74
|
+
/**
|
|
75
|
+
* Synchronously returns a Layout object that represents a Window's layout.
|
|
76
|
+
* @param { Identity } identity
|
|
77
|
+
* @return {Layout}
|
|
78
|
+
* @tutorial Layout.wrapSync
|
|
79
|
+
* @static
|
|
80
|
+
*/
|
|
81
|
+
wrapSync(identity: OpenFin.Identity): OpenFin.Layout;
|
|
82
|
+
/**
|
|
83
|
+
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
84
|
+
* @return {Promise.<Layout>}
|
|
85
|
+
* @tutorial Layout.getCurrent
|
|
86
|
+
* @static
|
|
87
|
+
*/
|
|
88
|
+
getCurrent(): Promise<OpenFin.Layout>;
|
|
89
|
+
/**
|
|
90
|
+
* Synchronously returns a Layout object that represents a Window's layout.
|
|
91
|
+
* @return {Layout}
|
|
92
|
+
* @tutorial Layout.getCurrentSync
|
|
93
|
+
* @static
|
|
94
|
+
*/
|
|
95
|
+
getCurrentSync(): OpenFin.Layout;
|
|
96
|
+
/**
|
|
97
|
+
* Initialize the window's Layout. Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
|
98
|
+
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
99
|
+
* A Layout will <a href="tutorial-Layout.DOMEvents.html">emit events locally</a> on the DOM element representing the layout-container.
|
|
100
|
+
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
101
|
+
* @param { InitLayoutOptions } [options] - Layout init options.
|
|
102
|
+
* @return { Promise<Layout> }
|
|
103
|
+
* @static
|
|
104
|
+
* @experimental
|
|
105
|
+
* @tutorial Layout.init
|
|
106
|
+
*/
|
|
107
|
+
init: (options?: InitLayoutOptions) => Promise<OpenFin.Layout>;
|
|
108
|
+
}
|
|
@@ -1,190 +1,190 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
3
|
-
if (!privateMap.has(receiver)) {
|
|
4
|
-
throw new TypeError("attempted to get private field on non-instance");
|
|
5
|
-
}
|
|
6
|
-
return privateMap.get(receiver);
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
9
|
-
if (!privateMap.has(receiver)) {
|
|
10
|
-
throw new TypeError("attempted to set private field on non-instance");
|
|
11
|
-
}
|
|
12
|
-
privateMap.set(receiver, value);
|
|
13
|
-
return value;
|
|
14
|
-
};
|
|
15
|
-
var _layoutManager;
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.LayoutModule = void 0;
|
|
18
|
-
/* eslint-disable no-undef, import/prefer-default-export */
|
|
19
|
-
const Instance_1 = require("./Instance");
|
|
20
|
-
const base_1 = require("../../base");
|
|
21
|
-
/**
|
|
22
|
-
* InitLayoutOptions interface
|
|
23
|
-
* @typedef { object } InitLayoutOptions
|
|
24
|
-
* @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
|
|
25
|
-
* then an element with id `layout-container` is used. We recommend using a div element.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
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
|
-
* LayoutItem Interface
|
|
43
|
-
* @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
|
|
44
|
-
* to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
|
|
45
|
-
* {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
46
|
-
* @property { string } type The type of the item. Possible values are 'row', 'column', 'stack', and 'component'.
|
|
47
|
-
* @property { Array<LayoutItem> } [content] An array of configurations for items that will be created as children of this item.
|
|
48
|
-
* @property { string } [componentName] Only a `component` type will have this property and it should be set to `view`.
|
|
49
|
-
* @property { View~options } [componentState] Only a `component` type will have this property and it represents the view
|
|
50
|
-
* options of a given component.
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* LayoutSettings Interface
|
|
54
|
-
* @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
|
|
55
|
-
* @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
|
|
56
|
-
* If true, stack headers are the only areas where tabs can be dropped.
|
|
57
|
-
* @property { boolean } [hasHeaders=true] Turns tab headers on or off.
|
|
58
|
-
* If false, the layout will be displayed with splitters only.
|
|
59
|
-
* @property {object} [newTabButton]
|
|
60
|
-
* Configuration of the Plus button that appears on each tabstrip. Upon pressing, a new tab
|
|
61
|
-
* will be added to the tabstrip with the specified url.
|
|
62
|
-
* @property {string} [newTabButton.url] Specifies the url that opens in the tab created upon pressing the button.
|
|
63
|
-
* @property { boolean } [popoutWholeStack=false] Whether the popout button will only act on the entire stack,
|
|
64
|
-
* as opposed to only the active tab.
|
|
65
|
-
* @property { boolean } [preventDragIn=false] If true, tabs can't be dragged into the window.
|
|
66
|
-
* @property { boolean } [preventDragOut=false] If true, tabs can't be dragged out of the window.
|
|
67
|
-
* @property { boolean } [preventSplitterResize=false] If true, tab contents can't be resized by the user.
|
|
68
|
-
* @property { boolean } [reorderEnabled=true] If true, the user can re-arrange the layout by
|
|
69
|
-
* dragging items by their tabs to the desired location.
|
|
70
|
-
* @property { boolean } [showCloseIcon=false] Whether to show the close button on stack header
|
|
71
|
-
* (not to be confused with close button on every tab).
|
|
72
|
-
* @property { boolean } [showMaximiseIcon=false] Whether to show the maximize button on stack header.
|
|
73
|
-
* The button will maximize the current tab to fill the entire window.
|
|
74
|
-
* @property { boolean } [showPopoutIcon=false] Whether to show the popout button on stack header.
|
|
75
|
-
* The button will create a new window with current tab as its content.
|
|
76
|
-
* In case `popoutWholeStack` is set to true, all tabs in the stack will be in the new window.
|
|
77
|
-
*/
|
|
78
|
-
/**
|
|
79
|
-
* @lends Platform#Layout
|
|
80
|
-
*/
|
|
81
|
-
class LayoutModule extends base_1.Base {
|
|
82
|
-
constructor() {
|
|
83
|
-
super(...arguments);
|
|
84
|
-
_layoutManager.set(this, void 0);
|
|
85
|
-
/**
|
|
86
|
-
* Initialize the window's Layout. Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
|
87
|
-
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
88
|
-
* A Layout will <a href="tutorial-Layout.DOMEvents.html">emit events locally</a> on the DOM element representing the layout-container.
|
|
89
|
-
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
90
|
-
* @param { InitLayoutOptions } [options] - Layout init options.
|
|
91
|
-
* @return { Promise<Layout> }
|
|
92
|
-
* @static
|
|
93
|
-
* @experimental
|
|
94
|
-
* @tutorial Layout.init
|
|
95
|
-
*/
|
|
96
|
-
this.init = async (options = {}) => {
|
|
97
|
-
this.wire.sendAction('layout-init').catch((e) => {
|
|
98
|
-
// don't expose
|
|
99
|
-
});
|
|
100
|
-
if (!this.fin.me.isWindow) {
|
|
101
|
-
throw new Error('Layout.init can only be called from a Window context.');
|
|
102
|
-
}
|
|
103
|
-
else if (__classPrivateFieldGet(this, _layoutManager)) {
|
|
104
|
-
throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
|
|
105
|
-
}
|
|
106
|
-
// We need to go through environment to make sure it is only imported/bundled in OpenFin.
|
|
107
|
-
const ManagerConstructor = await this.wire.environment.getManagerConstructor();
|
|
108
|
-
__classPrivateFieldSet(this, _layoutManager, new ManagerConstructor());
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
110
|
-
// @ts-ignore - layout warning here for backwards compatibility, can remove layout check in .52
|
|
111
|
-
let { layout, containerId } = options;
|
|
112
|
-
if (layout) {
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
|
3
|
+
if (!privateMap.has(receiver)) {
|
|
4
|
+
throw new TypeError("attempted to get private field on non-instance");
|
|
5
|
+
}
|
|
6
|
+
return privateMap.get(receiver);
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
|
9
|
+
if (!privateMap.has(receiver)) {
|
|
10
|
+
throw new TypeError("attempted to set private field on non-instance");
|
|
11
|
+
}
|
|
12
|
+
privateMap.set(receiver, value);
|
|
13
|
+
return value;
|
|
14
|
+
};
|
|
15
|
+
var _layoutManager;
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.LayoutModule = void 0;
|
|
18
|
+
/* eslint-disable no-undef, import/prefer-default-export */
|
|
19
|
+
const Instance_1 = require("./Instance");
|
|
20
|
+
const base_1 = require("../../base");
|
|
21
|
+
/**
|
|
22
|
+
* InitLayoutOptions interface
|
|
23
|
+
* @typedef { object } InitLayoutOptions
|
|
24
|
+
* @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided
|
|
25
|
+
* then an element with id `layout-container` is used. We recommend using a div element.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
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
|
+
* LayoutItem Interface
|
|
43
|
+
* @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying
|
|
44
|
+
* to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our
|
|
45
|
+
* {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }.
|
|
46
|
+
* @property { string } type The type of the item. Possible values are 'row', 'column', 'stack', and 'component'.
|
|
47
|
+
* @property { Array<LayoutItem> } [content] An array of configurations for items that will be created as children of this item.
|
|
48
|
+
* @property { string } [componentName] Only a `component` type will have this property and it should be set to `view`.
|
|
49
|
+
* @property { View~options } [componentState] Only a `component` type will have this property and it represents the view
|
|
50
|
+
* options of a given component.
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* LayoutSettings Interface
|
|
54
|
+
* @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout
|
|
55
|
+
* @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged.
|
|
56
|
+
* If true, stack headers are the only areas where tabs can be dropped.
|
|
57
|
+
* @property { boolean } [hasHeaders=true] Turns tab headers on or off.
|
|
58
|
+
* If false, the layout will be displayed with splitters only.
|
|
59
|
+
* @property {object} [newTabButton]
|
|
60
|
+
* Configuration of the Plus button that appears on each tabstrip. Upon pressing, a new tab
|
|
61
|
+
* will be added to the tabstrip with the specified url.
|
|
62
|
+
* @property {string} [newTabButton.url] Specifies the url that opens in the tab created upon pressing the button.
|
|
63
|
+
* @property { boolean } [popoutWholeStack=false] Whether the popout button will only act on the entire stack,
|
|
64
|
+
* as opposed to only the active tab.
|
|
65
|
+
* @property { boolean } [preventDragIn=false] If true, tabs can't be dragged into the window.
|
|
66
|
+
* @property { boolean } [preventDragOut=false] If true, tabs can't be dragged out of the window.
|
|
67
|
+
* @property { boolean } [preventSplitterResize=false] If true, tab contents can't be resized by the user.
|
|
68
|
+
* @property { boolean } [reorderEnabled=true] If true, the user can re-arrange the layout by
|
|
69
|
+
* dragging items by their tabs to the desired location.
|
|
70
|
+
* @property { boolean } [showCloseIcon=false] Whether to show the close button on stack header
|
|
71
|
+
* (not to be confused with close button on every tab).
|
|
72
|
+
* @property { boolean } [showMaximiseIcon=false] Whether to show the maximize button on stack header.
|
|
73
|
+
* The button will maximize the current tab to fill the entire window.
|
|
74
|
+
* @property { boolean } [showPopoutIcon=false] Whether to show the popout button on stack header.
|
|
75
|
+
* The button will create a new window with current tab as its content.
|
|
76
|
+
* In case `popoutWholeStack` is set to true, all tabs in the stack will be in the new window.
|
|
77
|
+
*/
|
|
78
|
+
/**
|
|
79
|
+
* @lends Platform#Layout
|
|
80
|
+
*/
|
|
81
|
+
class LayoutModule extends base_1.Base {
|
|
82
|
+
constructor() {
|
|
83
|
+
super(...arguments);
|
|
84
|
+
_layoutManager.set(this, void 0);
|
|
85
|
+
/**
|
|
86
|
+
* Initialize the window's Layout. Must be called from a custom window that has a 'layout' option set upon creation of that window.
|
|
87
|
+
* If a containerId is not provided, this method attempts to find an element with the id `layout-container`.
|
|
88
|
+
* A Layout will <a href="tutorial-Layout.DOMEvents.html">emit events locally</a> on the DOM element representing the layout-container.
|
|
89
|
+
* In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`.
|
|
90
|
+
* @param { InitLayoutOptions } [options] - Layout init options.
|
|
91
|
+
* @return { Promise<Layout> }
|
|
92
|
+
* @static
|
|
93
|
+
* @experimental
|
|
94
|
+
* @tutorial Layout.init
|
|
95
|
+
*/
|
|
96
|
+
this.init = async (options = {}) => {
|
|
97
|
+
this.wire.sendAction('layout-init').catch((e) => {
|
|
98
|
+
// don't expose
|
|
99
|
+
});
|
|
100
|
+
if (!this.fin.me.isWindow) {
|
|
101
|
+
throw new Error('Layout.init can only be called from a Window context.');
|
|
102
|
+
}
|
|
103
|
+
else if (__classPrivateFieldGet(this, _layoutManager)) {
|
|
104
|
+
throw new Error('Layout for this window already initialized, please use Layout.replace call to replace the layout.');
|
|
105
|
+
}
|
|
106
|
+
// We need to go through environment to make sure it is only imported/bundled in OpenFin.
|
|
107
|
+
const ManagerConstructor = await this.wire.environment.getManagerConstructor();
|
|
108
|
+
__classPrivateFieldSet(this, _layoutManager, new ManagerConstructor());
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
110
|
+
// @ts-ignore - layout warning here for backwards compatibility, can remove layout check in .52
|
|
111
|
+
let { layout, containerId } = options;
|
|
112
|
+
if (layout) {
|
|
113
113
|
console.warn(`We recommend using a layout in window options.
|
|
114
|
-
This layout has not been sanitized and unexpected behavior can occur.`);
|
|
115
|
-
}
|
|
116
|
-
layout = layout || (await this.fin.Window.getCurrentSync().getOptions()).layout;
|
|
117
|
-
containerId = containerId || 'layout-container';
|
|
118
|
-
const container = document.getElementById(containerId);
|
|
119
|
-
// Should we error here if there is no container? Getting a typescript complaint on createLayout
|
|
120
|
-
// override here
|
|
121
|
-
// pull createChannelConnection out of LayoutManager and setup channel connections here using layoutmanager instance methods?
|
|
122
|
-
await __classPrivateFieldGet(this, _layoutManager).initManager();
|
|
123
|
-
await __classPrivateFieldGet(this, _layoutManager).createLayout(layout, container);
|
|
124
|
-
// Adding this to the returned instance undocumented/typed for Browser.
|
|
125
|
-
return Object.assign(this.getCurrentSync(), { layoutManager: __classPrivateFieldGet(this, _layoutManager) });
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
130
|
-
* @param { Identity } identity
|
|
131
|
-
* @return {Promise.<Layout>}
|
|
132
|
-
* @tutorial Layout.wrap
|
|
133
|
-
* @static
|
|
134
|
-
*/
|
|
135
|
-
// eslint-disable-next-line class-methods-use-this
|
|
136
|
-
async wrap(identity) {
|
|
137
|
-
this.wire.sendAction('layout-wrap').catch((e) => {
|
|
138
|
-
// don't expose
|
|
139
|
-
});
|
|
140
|
-
return new Instance_1.Layout(identity, this.wire);
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Synchronously returns a Layout object that represents a Window's layout.
|
|
144
|
-
* @param { Identity } identity
|
|
145
|
-
* @return {Layout}
|
|
146
|
-
* @tutorial Layout.wrapSync
|
|
147
|
-
* @static
|
|
148
|
-
*/
|
|
149
|
-
// eslint-disable-next-line class-methods-use-this
|
|
150
|
-
wrapSync(identity) {
|
|
151
|
-
this.wire.sendAction('layout-wrap-sync').catch((e) => {
|
|
152
|
-
// don't expose
|
|
153
|
-
});
|
|
154
|
-
return new Instance_1.Layout(identity, this.wire);
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
158
|
-
* @return {Promise.<Layout>}
|
|
159
|
-
* @tutorial Layout.getCurrent
|
|
160
|
-
* @static
|
|
161
|
-
*/
|
|
162
|
-
async getCurrent() {
|
|
163
|
-
this.wire.sendAction('layout-get-current').catch((e) => {
|
|
164
|
-
// don't expose
|
|
165
|
-
});
|
|
166
|
-
if (!this.fin.me.isWindow) {
|
|
167
|
-
throw new Error('You are not in a Window context. Only Windows can have a Layout.');
|
|
168
|
-
}
|
|
169
|
-
const { uuid, name } = this.fin.me;
|
|
170
|
-
return this.wrap({ uuid, name });
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Synchronously returns a Layout object that represents a Window's layout.
|
|
174
|
-
* @return {Layout}
|
|
175
|
-
* @tutorial Layout.getCurrentSync
|
|
176
|
-
* @static
|
|
177
|
-
*/
|
|
178
|
-
getCurrentSync() {
|
|
179
|
-
this.wire.sendAction('layout-get-current-sync').catch((e) => {
|
|
180
|
-
// don't expose
|
|
181
|
-
});
|
|
182
|
-
if (!this.fin.me.isWindow) {
|
|
183
|
-
throw new Error('You are not in a Window context. Only Windows can have a Layout.');
|
|
184
|
-
}
|
|
185
|
-
const { uuid, name } = this.fin.me;
|
|
186
|
-
return this.wrapSync({ uuid, name });
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
exports.LayoutModule = LayoutModule;
|
|
190
|
-
_layoutManager = new WeakMap();
|
|
114
|
+
This layout has not been sanitized and unexpected behavior can occur.`);
|
|
115
|
+
}
|
|
116
|
+
layout = layout || (await this.fin.Window.getCurrentSync().getOptions()).layout;
|
|
117
|
+
containerId = containerId || 'layout-container';
|
|
118
|
+
const container = document.getElementById(containerId);
|
|
119
|
+
// Should we error here if there is no container? Getting a typescript complaint on createLayout
|
|
120
|
+
// override here
|
|
121
|
+
// pull createChannelConnection out of LayoutManager and setup channel connections here using layoutmanager instance methods?
|
|
122
|
+
await __classPrivateFieldGet(this, _layoutManager).initManager();
|
|
123
|
+
await __classPrivateFieldGet(this, _layoutManager).createLayout(layout, container);
|
|
124
|
+
// Adding this to the returned instance undocumented/typed for Browser.
|
|
125
|
+
return Object.assign(this.getCurrentSync(), { layoutManager: __classPrivateFieldGet(this, _layoutManager) });
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
130
|
+
* @param { Identity } identity
|
|
131
|
+
* @return {Promise.<Layout>}
|
|
132
|
+
* @tutorial Layout.wrap
|
|
133
|
+
* @static
|
|
134
|
+
*/
|
|
135
|
+
// eslint-disable-next-line class-methods-use-this
|
|
136
|
+
async wrap(identity) {
|
|
137
|
+
this.wire.sendAction('layout-wrap').catch((e) => {
|
|
138
|
+
// don't expose
|
|
139
|
+
});
|
|
140
|
+
return new Instance_1.Layout(identity, this.wire);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Synchronously returns a Layout object that represents a Window's layout.
|
|
144
|
+
* @param { Identity } identity
|
|
145
|
+
* @return {Layout}
|
|
146
|
+
* @tutorial Layout.wrapSync
|
|
147
|
+
* @static
|
|
148
|
+
*/
|
|
149
|
+
// eslint-disable-next-line class-methods-use-this
|
|
150
|
+
wrapSync(identity) {
|
|
151
|
+
this.wire.sendAction('layout-wrap-sync').catch((e) => {
|
|
152
|
+
// don't expose
|
|
153
|
+
});
|
|
154
|
+
return new Instance_1.Layout(identity, this.wire);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Asynchronously returns a Layout object that represents a Window's layout.
|
|
158
|
+
* @return {Promise.<Layout>}
|
|
159
|
+
* @tutorial Layout.getCurrent
|
|
160
|
+
* @static
|
|
161
|
+
*/
|
|
162
|
+
async getCurrent() {
|
|
163
|
+
this.wire.sendAction('layout-get-current').catch((e) => {
|
|
164
|
+
// don't expose
|
|
165
|
+
});
|
|
166
|
+
if (!this.fin.me.isWindow) {
|
|
167
|
+
throw new Error('You are not in a Window context. Only Windows can have a Layout.');
|
|
168
|
+
}
|
|
169
|
+
const { uuid, name } = this.fin.me;
|
|
170
|
+
return this.wrap({ uuid, name });
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Synchronously returns a Layout object that represents a Window's layout.
|
|
174
|
+
* @return {Layout}
|
|
175
|
+
* @tutorial Layout.getCurrentSync
|
|
176
|
+
* @static
|
|
177
|
+
*/
|
|
178
|
+
getCurrentSync() {
|
|
179
|
+
this.wire.sendAction('layout-get-current-sync').catch((e) => {
|
|
180
|
+
// don't expose
|
|
181
|
+
});
|
|
182
|
+
if (!this.fin.me.isWindow) {
|
|
183
|
+
throw new Error('You are not in a Window context. Only Windows can have a Layout.');
|
|
184
|
+
}
|
|
185
|
+
const { uuid, name } = this.fin.me;
|
|
186
|
+
return this.wrapSync({ uuid, name });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
exports.LayoutModule = LayoutModule;
|
|
190
|
+
_layoutManager = new WeakMap();
|