@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
|
@@ -13,10 +13,10 @@ const base_1 = require("../../base");
|
|
|
13
13
|
const common_utils_1 = require("../common-utils");
|
|
14
14
|
const layout_entities_1 = require("./entities/layout-entities");
|
|
15
15
|
const layout_constants_1 = require("./layout.constants");
|
|
16
|
-
/**
|
|
17
|
-
* @lends Platform#Layout
|
|
18
|
-
*/
|
|
19
16
|
class Layout extends base_1.Base {
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
20
|
// eslint-disable-next-line no-shadow
|
|
21
21
|
constructor(identity, wire) {
|
|
22
22
|
super(wire);
|
|
@@ -27,12 +27,51 @@ class Layout extends base_1.Base {
|
|
|
27
27
|
*/
|
|
28
28
|
_Layout_layoutClient.set(this, new lazy_1.Lazy(async () => layout_entities_1.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(), layout_constants_1.LAYOUT_CONTROLLER_ID, this.identity)));
|
|
29
29
|
/**
|
|
30
|
-
* Replaces a Platform window's layout with a new layout.
|
|
31
|
-
*
|
|
32
|
-
* @
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
30
|
+
* Replaces a Platform window's layout with a new layout.
|
|
31
|
+
*
|
|
32
|
+
* @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.
|
|
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
|
+
*
|
|
46
|
+
* const newLayout = {
|
|
47
|
+
* content: [
|
|
48
|
+
* {
|
|
49
|
+
* type: 'stack',
|
|
50
|
+
* content: [
|
|
51
|
+
* {
|
|
52
|
+
* type: 'component',
|
|
53
|
+
* componentName: 'view',
|
|
54
|
+
* componentState: {
|
|
55
|
+
* name: 'new_component_A1',
|
|
56
|
+
* processAffinity: 'ps_1',
|
|
57
|
+
* url: 'https://www.example.com'
|
|
58
|
+
* }
|
|
59
|
+
* },
|
|
60
|
+
* {
|
|
61
|
+
* type: 'component',
|
|
62
|
+
* componentName: 'view',
|
|
63
|
+
* componentState: {
|
|
64
|
+
* name: 'new_component_A2',
|
|
65
|
+
* url: 'https://cdn.openfin.co/embed-web/chart.html'
|
|
66
|
+
* }
|
|
67
|
+
* }
|
|
68
|
+
* ]
|
|
69
|
+
* }
|
|
70
|
+
* ]
|
|
71
|
+
* };
|
|
72
|
+
*
|
|
73
|
+
* layout.replace(newLayout);
|
|
74
|
+
* ```
|
|
36
75
|
*/
|
|
37
76
|
this.replace = async (layout) => {
|
|
38
77
|
this.wire.sendAction('layout-replace').catch((e) => {
|
|
@@ -46,12 +85,29 @@ class Layout extends base_1.Base {
|
|
|
46
85
|
};
|
|
47
86
|
/**
|
|
48
87
|
* Replaces the specified view with a view with the provided configuration.
|
|
49
|
-
*
|
|
88
|
+
*
|
|
89
|
+
* @remarks The old view is stripped of its listeners and either closed or attached to the provider window
|
|
50
90
|
* depending on `detachOnClose` view option.
|
|
51
|
-
*
|
|
52
|
-
* @param
|
|
53
|
-
* @
|
|
54
|
-
*
|
|
91
|
+
*
|
|
92
|
+
* @param viewToReplace Identity of the view to be replaced
|
|
93
|
+
* @param newView Creation options of the new view.
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```js
|
|
97
|
+
* let currentWindow;
|
|
98
|
+
* if (fin.me.isWindow) {
|
|
99
|
+
* currentWindow = fin.me;
|
|
100
|
+
* } else if (fin.me.isView) {
|
|
101
|
+
* currentWindow = await fin.me.getCurrentWindow();
|
|
102
|
+
* } else {
|
|
103
|
+
* throw new Error('Not running in a platform View or Window');
|
|
104
|
+
* }
|
|
105
|
+
*
|
|
106
|
+
* const layout = fin.Platform.Layout.wrapSync(currentWindow.identity);
|
|
107
|
+
* const viewToReplace = (await currentWindow.getCurrentViews())[0];
|
|
108
|
+
* const newViewConfig = {url: 'https://example.com'};
|
|
109
|
+
* await layout.replaceView(viewToReplace.identity, newViewConfig);
|
|
110
|
+
* ```
|
|
55
111
|
*/
|
|
56
112
|
this.replaceView = async (viewToReplace, newView) => {
|
|
57
113
|
this.wire.sendAction('layout-replace-view').catch((e) => {
|
|
@@ -66,10 +122,27 @@ class Layout extends base_1.Base {
|
|
|
66
122
|
/**
|
|
67
123
|
* Replaces a Platform window's layout with a preset layout arrangement using the existing Views attached to the window.
|
|
68
124
|
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
69
|
-
* @param
|
|
125
|
+
* @param options Mandatory object with `presetType` property that sets which preset layout arrangement to use.
|
|
70
126
|
* The preset options are `columns`, `grid`, `rows`, and `tabs`.
|
|
71
|
-
*
|
|
72
|
-
* @
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```js
|
|
130
|
+
* let windowIdentity;
|
|
131
|
+
* if (fin.me.isWindow) {
|
|
132
|
+
* windowIdentity = fin.me.identity;
|
|
133
|
+
* } else if (fin.me.isView) {
|
|
134
|
+
* windowIdentity = (await fin.me.getCurrentWindow()).identity;
|
|
135
|
+
* } else {
|
|
136
|
+
* throw new Error('Not running in a platform View or Window');
|
|
137
|
+
* }
|
|
138
|
+
*
|
|
139
|
+
* const layout = fin.Platform.Layout.wrapSync(windowIdentity);
|
|
140
|
+
* await layout.applyPreset({ presetType: 'grid' });
|
|
141
|
+
*
|
|
142
|
+
* // wait 5 seconds until you change the layout from grid to tabs
|
|
143
|
+
* await new Promise (res => setTimeout(res, 5000));
|
|
144
|
+
* await layout.applyPreset({ presetType: 'tabs' });
|
|
145
|
+
* ```
|
|
73
146
|
*/
|
|
74
147
|
this.applyPreset = async (options) => {
|
|
75
148
|
this.wire.sendAction('layout-apply-preset').catch((e) => {
|
|
@@ -97,8 +170,16 @@ class Layout extends base_1.Base {
|
|
|
97
170
|
}
|
|
98
171
|
/**
|
|
99
172
|
* Returns the configuration of the window's layout. Returns the same information that is returned for all windows in getSnapshot.
|
|
100
|
-
*
|
|
101
|
-
* @
|
|
173
|
+
*
|
|
174
|
+
* @remarks Cannot be called from a View.
|
|
175
|
+
*
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* ```js
|
|
179
|
+
* const layout = fin.Platform.Layout.getCurrentSync();
|
|
180
|
+
* // Use wrapped instance to get the layout configuration of the current window's Layout:
|
|
181
|
+
* const layoutConfig = await layout.getConfig();
|
|
182
|
+
* ```
|
|
102
183
|
*/
|
|
103
184
|
async getConfig() {
|
|
104
185
|
this.wire.sendAction('layout-get-config').catch((e) => {
|
|
@@ -111,7 +192,24 @@ class Layout extends base_1.Base {
|
|
|
111
192
|
}
|
|
112
193
|
/**
|
|
113
194
|
* Retrieves the top level content item of the layout.
|
|
114
|
-
*
|
|
195
|
+
*
|
|
196
|
+
* @remarks Cannot be called from a view.
|
|
197
|
+
*
|
|
198
|
+
*
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* ```js
|
|
202
|
+
* if (!fin.me.isWindow) {
|
|
203
|
+
* throw new Error('Not running in a platform View.');
|
|
204
|
+
* }
|
|
205
|
+
*
|
|
206
|
+
* // From the layout window
|
|
207
|
+
* const layout = fin.Platform.Layout.getCurrentSync();
|
|
208
|
+
* // Retrieves the ColumnOrRow instance
|
|
209
|
+
* const rootItem = await layout.getRootItem();
|
|
210
|
+
* const content = await rootItem.getContent();
|
|
211
|
+
* console.log(`The root ColumnOrRow instance has ${content.length} item(s)`);
|
|
212
|
+
* ```
|
|
115
213
|
*/
|
|
116
214
|
async getRootItem() {
|
|
117
215
|
this.wire.sendAction('layout-get-root-item').catch(() => {
|
|
@@ -31,12 +31,131 @@ export declare abstract class LayoutNode {
|
|
|
31
31
|
*/
|
|
32
32
|
static newLayoutEntitiesClient: (client: OpenFin.ChannelClient, controllerId: string, identity: OpenFin.Identity) => Promise<LayoutEntitiesClient>;
|
|
33
33
|
static getEntity: (definition: OpenFin.LayoutEntityDefinition, client: LayoutEntitiesClient) => ColumnOrRow | TabStack;
|
|
34
|
+
/**
|
|
35
|
+
* Checks if the TabStack or ColumnOrRow is the root content item
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```js
|
|
39
|
+
* if (!fin.me.isView) {
|
|
40
|
+
* throw new Error('Not running in a platform View.');
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* const stack = await fin.me.getCurrentStack();
|
|
44
|
+
* const isRoot = await stack.isRoot();
|
|
45
|
+
* // The TabStack is root: false
|
|
46
|
+
* console.log(`The TabStack is root: ${isRoot}`);
|
|
47
|
+
*
|
|
48
|
+
* // Retrieves the parent ColumnOrRow
|
|
49
|
+
* const parent = await stack.getParent();
|
|
50
|
+
* const parentIsRoot = await parent.isRoot();
|
|
51
|
+
* // The parent ColumnOrRow is root: true
|
|
52
|
+
* console.log(`The parent ColumnOrRow is root: ${parentIsRoot}`);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
34
55
|
isRoot: () => Promise<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* Checks if the TabStack or ColumnOrRow exists
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```js
|
|
61
|
+
* if (!fin.me.isView) {
|
|
62
|
+
* throw new Error('Not running in a platform View.');
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* const stack = await fin.me.getCurrentStack();
|
|
66
|
+
* // Retrieves the parent ColumnOrRow
|
|
67
|
+
* const columnOrRow = await stack.getParent();
|
|
68
|
+
* let exists = await stack.exists();
|
|
69
|
+
* // or
|
|
70
|
+
* let exists = await columnOrRow.exists();
|
|
71
|
+
* // The entity exists: true
|
|
72
|
+
* console.log(`The entity exists: ${exists}`);
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
35
75
|
exists: () => Promise<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* Retrieves the parent of the TabStack or ColumnOrRow
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```js
|
|
81
|
+
* if (!fin.me.isView) {
|
|
82
|
+
* throw new Error('Not running in a platform View.');
|
|
83
|
+
* }
|
|
84
|
+
*
|
|
85
|
+
* const stack = await fin.me.getCurrentStack();
|
|
86
|
+
* // Retrieves the parent ColumnOrRow
|
|
87
|
+
* const columnOrRow = await stack.getParent();
|
|
88
|
+
*
|
|
89
|
+
* // undefined if entity is the root item
|
|
90
|
+
* let parent = await columnOrRow.getParent();
|
|
91
|
+
* // or
|
|
92
|
+
* let parent = await stack.getParent();
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
36
95
|
getParent: () => Promise<ColumnOrRow | TabStack | undefined>;
|
|
96
|
+
/**
|
|
97
|
+
* Creates a new TabStack adjacent to the given TabStack or ColumnOrRow. Inputs can be new views to create, or existing views.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```js
|
|
101
|
+
* if (!fin.me.isView) {
|
|
102
|
+
* throw new Error('Not running in a platform View.');
|
|
103
|
+
* }
|
|
104
|
+
*
|
|
105
|
+
* const stack = await fin.me.getCurrentStack();
|
|
106
|
+
* const columnOrRow = await stack.getParent();
|
|
107
|
+
*
|
|
108
|
+
* // Create view references by supplying a 'name' and 'url'
|
|
109
|
+
* const views = [
|
|
110
|
+
* // if 'name' is undefined, one will be generated
|
|
111
|
+
* // if 'url' is undefined, it will default the view URL to 'about:blank'
|
|
112
|
+
* { name: 'google-view', url: 'http://google.com/'},
|
|
113
|
+
* { name: 'of-developers-view', url: 'http://developers.openfin.co/'},
|
|
114
|
+
* ];
|
|
115
|
+
*
|
|
116
|
+
* // Create a view beforehand to be included in the new tab stack
|
|
117
|
+
* const outsideView = await fin.View.create({
|
|
118
|
+
* name: 'outside-bloomberg-view',
|
|
119
|
+
* url: 'https://bloomberg.com/',
|
|
120
|
+
* target: fin.me.identity,
|
|
121
|
+
* });
|
|
122
|
+
*
|
|
123
|
+
* // Views to add can be identities, or the reference views mentioned above
|
|
124
|
+
* const viewsToAdd = [outsideView.identity, ...views];
|
|
125
|
+
*
|
|
126
|
+
* // Possible position inputs: 'right' | 'left' | 'top' | 'bottom'
|
|
127
|
+
* let stackFrom = await columnOrRow.createAdjacentStack(viewsToAdd, { position: 'right' });
|
|
128
|
+
* // Or
|
|
129
|
+
* let newStack = await stack.createAdjacentStack(viewsToAdd, { position: 'right' });
|
|
130
|
+
* console.log(`A new TabStack created to the right has ${newStack.length} views in it`);
|
|
131
|
+
*
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
37
134
|
createAdjacentStack: (views: OpenFin.PlatformViewCreationOptions[], options: {
|
|
38
135
|
position?: OpenFin.LayoutPosition;
|
|
39
136
|
}) => Promise<TabStack>;
|
|
137
|
+
/**
|
|
138
|
+
* Retrieves the adjacent TabStacks of the given TabStack or ColumnOrRow
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```js
|
|
142
|
+
* if (!fin.me.isView) {
|
|
143
|
+
* throw new Error('Not running in a platform View.');
|
|
144
|
+
* }
|
|
145
|
+
*
|
|
146
|
+
* const stack = await fin.me.getCurrentStack();
|
|
147
|
+
* const columnOrRow = await stack.getParent();
|
|
148
|
+
* // Possible position inputs: 'right' | 'left' | 'top' | 'bottom'
|
|
149
|
+
* let rightStacks = await columnOrRow.getAdjacentStacks('right');
|
|
150
|
+
* let leftStacks = await columnOrRow.getAdjacentStacks('left');
|
|
151
|
+
* // or
|
|
152
|
+
* let rightStacks = await stack.getAdjacentStacks('right');
|
|
153
|
+
* let leftStacks = await stack.getAdjacentStacks('left');
|
|
154
|
+
*
|
|
155
|
+
* console.log(`The entity has ${rightStacks.length} stacks to the right, and ${leftStacks.length} stacks to the left`);
|
|
156
|
+
*
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
40
159
|
getAdjacentStacks: (edge: OpenFin.LayoutPosition) => Promise<TabStack[]>;
|
|
41
160
|
}
|
|
42
161
|
/**
|
|
@@ -64,7 +183,7 @@ export declare class TabStack extends LayoutNode {
|
|
|
64
183
|
* @memberof TabStack
|
|
65
184
|
* @instance
|
|
66
185
|
* @tutorial TabStack.isRoot
|
|
67
|
-
* @
|
|
186
|
+
* @returns Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
68
187
|
*/
|
|
69
188
|
/**
|
|
70
189
|
* Determines if this {@link TabStack} exists.
|
|
@@ -72,7 +191,7 @@ export declare class TabStack extends LayoutNode {
|
|
|
72
191
|
* @instance
|
|
73
192
|
* @memberof TabStack
|
|
74
193
|
* @tutorial TabStack.exists
|
|
75
|
-
* @
|
|
194
|
+
* @returns Resolves true if this is the TabStack exists, or false if it has been destroyed.
|
|
76
195
|
*/
|
|
77
196
|
/**
|
|
78
197
|
* Retrieves the parent {@link ColumnOrRow} of this {@link TabStack}, if one exists.
|
|
@@ -80,7 +199,7 @@ export declare class TabStack extends LayoutNode {
|
|
|
80
199
|
* @instance
|
|
81
200
|
* @memberof TabStack
|
|
82
201
|
* @tutorial TabStack.getParent
|
|
83
|
-
* @
|
|
202
|
+
* @returns is the root content item or does not exist.
|
|
84
203
|
*/
|
|
85
204
|
/**
|
|
86
205
|
* Returns all the adjacent stacks that share an edge with the given {@link TabStack}.
|
|
@@ -88,7 +207,7 @@ export declare class TabStack extends LayoutNode {
|
|
|
88
207
|
* @instance
|
|
89
208
|
* @memberof TabStack
|
|
90
209
|
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
91
|
-
*
|
|
210
|
+
*
|
|
92
211
|
* @tutorial TabStack.getAdjacentStacks
|
|
93
212
|
*/
|
|
94
213
|
/**
|
|
@@ -102,9 +221,9 @@ export declare class TabStack extends LayoutNode {
|
|
|
102
221
|
* @function createAdjacentStack
|
|
103
222
|
* @instance
|
|
104
223
|
* @memberof TabStack
|
|
105
|
-
* @param
|
|
106
|
-
* @param
|
|
107
|
-
* @returns
|
|
224
|
+
* @param views - List of identities or view creation options of the views to include in the stack
|
|
225
|
+
* @param options - Creation options.
|
|
226
|
+
* @returns The created TabStack.
|
|
108
227
|
* @tutorial TabStack.createAdjacentStack
|
|
109
228
|
* @experimental
|
|
110
229
|
*/
|
|
@@ -122,43 +241,102 @@ export declare class TabStack extends LayoutNode {
|
|
|
122
241
|
* If that happens and then getViews() is called, it will return the identities in a different order than
|
|
123
242
|
* than the currently rendered tab order.
|
|
124
243
|
*
|
|
125
|
-
*
|
|
244
|
+
*
|
|
126
245
|
* @throws If the {@link TabStack} has been destroyed.
|
|
127
|
-
* @
|
|
246
|
+
* @example
|
|
247
|
+
* ```js
|
|
248
|
+
* if (!fin.me.isView) {
|
|
249
|
+
* throw new Error('Not running in a platform View.');
|
|
250
|
+
* }
|
|
251
|
+
*
|
|
252
|
+
* const stack = await fin.me.getCurrentStack();
|
|
253
|
+
* // Alternatively, you can wrap any view and get the stack from there
|
|
254
|
+
* // const viewFromSomewhere = fin.View.wrapSync(someView.identity);
|
|
255
|
+
* // const stack = await viewFromSomewhere.getCurrentStack();
|
|
256
|
+
* const views = await stack.getViews();
|
|
257
|
+
* console.log(`Stack contains ${views.length} view(s)`);
|
|
258
|
+
* ```
|
|
128
259
|
* @experimental
|
|
129
260
|
*/
|
|
130
261
|
getViews: () => Promise<OpenFin.Identity[]>;
|
|
131
262
|
/**
|
|
132
263
|
* Adds or creates a view in this {@link TabStack}.
|
|
133
264
|
*
|
|
134
|
-
* Known Issue: If adding a view overflows the tab-container, the added view will be set as active
|
|
265
|
+
* @remarks Known Issue: If adding a view overflows the tab-container, the added view will be set as active
|
|
135
266
|
* and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
136
267
|
*
|
|
137
|
-
* @param
|
|
138
|
-
* @param
|
|
139
|
-
* @returns
|
|
268
|
+
* @param view The identity of an existing view to add, or options to create a view.
|
|
269
|
+
* @param options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
|
|
270
|
+
* @returns Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
140
271
|
* @throws If the view does not exist or fails to create.
|
|
141
272
|
* @throws If the {@link TabStack} has been destroyed.
|
|
142
|
-
* @
|
|
273
|
+
* @example
|
|
274
|
+
* ```js
|
|
275
|
+
* if (!fin.me.isView) {
|
|
276
|
+
* throw new Error('Not running in a platform View.');
|
|
277
|
+
* }
|
|
278
|
+
*
|
|
279
|
+
* const stack = await fin.me.getCurrentStack();
|
|
280
|
+
* // Alternatively, you can wrap any view and get the stack from there
|
|
281
|
+
* // const viewFromSomewhere = fin.View.wrapSync(someView.identity);
|
|
282
|
+
* // const stack = await viewFromSomewhere.getCurrentStack();
|
|
283
|
+
* const googleViewIdentity = await stack.addView({ name: 'google-view', url: 'http://google.com/' });
|
|
284
|
+
* console.log('Identity of the google view just added', { googleViewIdentity });
|
|
285
|
+
* // pass in { index: number } to set the index in the stack. Here 1 means, end of the stack (defaults to 0)
|
|
286
|
+
* const appleViewIdentity = await stack.addView({ name: 'apple-view', url: 'http://apple.com/' }, { index: 1 });
|
|
287
|
+
* console.log('Identity of the apple view just added', { appleViewIdentity });
|
|
288
|
+
* ```
|
|
143
289
|
* @experimental
|
|
144
290
|
*/
|
|
145
291
|
addView: (view: OpenFin.Identity | OpenFin.PlatformViewCreationOptions, options?: OpenFin.AddViewToStackOptions) => Promise<OpenFin.Identity>;
|
|
146
292
|
/**
|
|
147
293
|
* Removes a view from this {@link TabStack}.
|
|
148
|
-
*
|
|
294
|
+
*
|
|
295
|
+
* @remarks Throws an exception if the view identity does not exist or was already destroyed.
|
|
296
|
+
*
|
|
297
|
+
* @param view - Identity of the view to remove.
|
|
149
298
|
* @throws If the view does not exist or does not belong to the stack.
|
|
150
299
|
* @throws If the {@link TabStack} has been destroyed.
|
|
151
|
-
*
|
|
152
|
-
* @
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```js
|
|
303
|
+
* if (!fin.me.isView) {
|
|
304
|
+
* throw new Error('Not running in a platform View.');
|
|
305
|
+
* }
|
|
306
|
+
*
|
|
307
|
+
* const stack = await fin.me.getCurrentStack();
|
|
308
|
+
* const googleViewIdentity = await stack.addView({ name: 'google-view', url: 'http://google.com/' });
|
|
309
|
+
*
|
|
310
|
+
* await stack.removeView(googleViewIdentity);
|
|
311
|
+
*
|
|
312
|
+
* try {
|
|
313
|
+
* await stack.removeView(googleViewIdentity);
|
|
314
|
+
* } catch (error) {
|
|
315
|
+
* // Tried to remove a view ('google-view') which does not belong to the stack.
|
|
316
|
+
* console.log(error);
|
|
317
|
+
* }
|
|
318
|
+
* ```
|
|
153
319
|
*/
|
|
154
320
|
removeView: (view: OpenFin.Identity) => Promise<void>;
|
|
155
321
|
/**
|
|
156
322
|
* Sets the active view of the {@link TabStack} without focusing it.
|
|
157
|
-
* @param
|
|
158
|
-
* @returns
|
|
323
|
+
* @param view - Identity of the view to activate.
|
|
324
|
+
* @returns Promise which resolves with void once the view has been activated.
|
|
159
325
|
* @throws If the {@link TabStack} has been destroyed.
|
|
160
326
|
* @throws If the view does not exist.
|
|
161
|
-
* @
|
|
327
|
+
* @example
|
|
328
|
+
* Change the active tab of a known View's TabStack:
|
|
329
|
+
* ```js
|
|
330
|
+
* const targetView = fin.View.wrapSync({ uuid: 'uuid', name: 'view-name' });
|
|
331
|
+
* const stack = await targetView.getCurrentStack();
|
|
332
|
+
* await stack.setActiveView(targetView.identity);
|
|
333
|
+
* ```
|
|
334
|
+
*
|
|
335
|
+
* Set the current View as active within its TabStack:
|
|
336
|
+
* ```js
|
|
337
|
+
* const stack = await fin.me.getCurrentStack();
|
|
338
|
+
* await stack.setActiveView(fin.me.identity);
|
|
339
|
+
* ```
|
|
162
340
|
* @experimental
|
|
163
341
|
*/
|
|
164
342
|
setActiveView: (view: OpenFin.Identity) => Promise<void>;
|
|
@@ -174,7 +352,7 @@ export declare class ColumnOrRow extends LayoutNode {
|
|
|
174
352
|
* @memberof ColumnOrRow
|
|
175
353
|
* @instance
|
|
176
354
|
* @tutorial ColumnOrRow.isRoot
|
|
177
|
-
* @
|
|
355
|
+
* @returns Resolves true if this TabStack is the top level content item, or false if it is not.
|
|
178
356
|
*/
|
|
179
357
|
/**
|
|
180
358
|
* Determines if this {@link ColumnOrRow} exists.
|
|
@@ -182,7 +360,7 @@ export declare class ColumnOrRow extends LayoutNode {
|
|
|
182
360
|
* @instance
|
|
183
361
|
* @memberof ColumnOrRow
|
|
184
362
|
* @tutorial ColumnOrRow.exists
|
|
185
|
-
* @
|
|
363
|
+
* @returns Resolves true if the TabStack exists, or false if it has been destroyed.
|
|
186
364
|
*/
|
|
187
365
|
/**
|
|
188
366
|
* Retrieves the parent {@link ColumnOrRow} of this {@link ColumnOrRow}, if one exists.
|
|
@@ -190,7 +368,8 @@ export declare class ColumnOrRow extends LayoutNode {
|
|
|
190
368
|
* @instance
|
|
191
369
|
* @memberof ColumnOrRow
|
|
192
370
|
* @tutorial ColumnOrRow.getParent
|
|
193
|
-
* @
|
|
371
|
+
* @returns Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if
|
|
372
|
+
* this {@link ColumnOrRow}does not exist or is the root content item.
|
|
194
373
|
*/
|
|
195
374
|
/**
|
|
196
375
|
* Returns all the adjacent stacks that share an edge with the given {@link ColumnOrRow}.
|
|
@@ -198,7 +377,7 @@ export declare class ColumnOrRow extends LayoutNode {
|
|
|
198
377
|
* @instance
|
|
199
378
|
* @memberof ColumnOrRow
|
|
200
379
|
* @param {LayoutPosition} edge - Edge to check for any adjacent stacks.
|
|
201
|
-
*
|
|
380
|
+
*
|
|
202
381
|
* @tutorial ColumnOrRow.getAdjacentStacks
|
|
203
382
|
*/
|
|
204
383
|
/**
|
|
@@ -212,9 +391,9 @@ export declare class ColumnOrRow extends LayoutNode {
|
|
|
212
391
|
* @function createAdjacentStack
|
|
213
392
|
* @instance
|
|
214
393
|
* @memberof ColumnOrRow
|
|
215
|
-
* @param
|
|
216
|
-
* @param
|
|
217
|
-
* @returns
|
|
394
|
+
* @param views - List of identities or view creation options of the views to include in the stack
|
|
395
|
+
* @param options - Creation options.
|
|
396
|
+
* @returns The created TabStack
|
|
218
397
|
* @tutorial ColumnOrRow.createAdjacentStack
|
|
219
398
|
* @experimental
|
|
220
399
|
*/
|
|
@@ -227,9 +406,22 @@ export declare class ColumnOrRow extends LayoutNode {
|
|
|
227
406
|
*/
|
|
228
407
|
readonly type: 'column' | 'row';
|
|
229
408
|
/**
|
|
230
|
-
* Retrieves
|
|
231
|
-
*
|
|
232
|
-
* @
|
|
409
|
+
* Retrieves the content array of the ColumnOrRow
|
|
410
|
+
*
|
|
411
|
+
* @example
|
|
412
|
+
* ```js
|
|
413
|
+
* if (!fin.me.isView) {
|
|
414
|
+
* throw new Error('Not running in a platform View.');
|
|
415
|
+
* }
|
|
416
|
+
*
|
|
417
|
+
* const stack = await fin.me.getCurrentStack();
|
|
418
|
+
* // Retrieves the parent ColumnOrRow
|
|
419
|
+
* const columnOrRow = await stack.getParent();
|
|
420
|
+
*
|
|
421
|
+
* // returns [TabStack]
|
|
422
|
+
* const contentArray = await columnOrRow.getContent();
|
|
423
|
+
* console.log(`The ColumnOrRow has ${contentArray.length} item(s)`);
|
|
424
|
+
* ```
|
|
233
425
|
*/
|
|
234
426
|
getContent: () => Promise<(ColumnOrRow | TabStack)[]>;
|
|
235
427
|
}
|