@openfin/core 30.73.27 → 30.74.6
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/LICENSE.md +4 -0
- package/package.json +2 -2
- package/src/OpenFin.d.ts +1726 -189
- package/src/OpenFin.js +3 -2
- package/src/api/api-exposer/api-consumer.d.ts +28 -0
- package/src/api/api-exposer/api-consumer.js +28 -0
- package/src/api/api-exposer/api-exposer.d.ts +35 -0
- package/src/api/api-exposer/api-exposer.js +38 -0
- package/src/api/api-exposer/decorators.d.ts +10 -0
- package/src/api/api-exposer/decorators.js +18 -0
- package/src/api/api-exposer/index.d.ts +4 -0
- package/src/api/api-exposer/index.js +20 -0
- package/src/api/api-exposer/strategies/index.d.ts +1 -0
- package/src/api/api-exposer/strategies/index.js +17 -0
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.d.ts +14 -0
- package/src/api/api-exposer/strategies/openfin-channels/channels-consumer.js +20 -0
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.d.ts +20 -0
- package/src/api/api-exposer/strategies/openfin-channels/channels-exposer.js +23 -0
- package/src/api/api-exposer/strategies/openfin-channels/index.d.ts +2 -0
- package/src/api/api-exposer/strategies/openfin-channels/index.js +18 -0
- package/src/api/application/Factory.d.ts +1 -0
- package/src/api/application/Factory.js +1 -0
- package/src/api/application/Instance.d.ts +2 -1
- package/src/api/application/Instance.js +1 -0
- package/src/api/base.d.ts +2 -2
- package/src/api/clipboard/index.d.ts +1 -0
- package/src/api/clipboard/index.js +1 -0
- package/src/api/events/base.d.ts +0 -3
- package/src/api/events/platform.d.ts +4 -5
- package/src/api/events/system.d.ts +5 -6
- package/src/api/events/view.d.ts +6 -3
- package/src/api/events/webcontents.d.ts +25 -3
- package/src/api/events/window.d.ts +21 -13
- package/src/api/external-application/Instance.d.ts +1 -1
- package/src/api/fin.d.ts +1 -1
- package/src/api/frame/Instance.d.ts +1 -1
- package/src/api/global-hotkey/index.d.ts +1 -1
- package/src/api/interappbus/channel/channel.d.ts +1 -1
- package/src/api/interappbus/channel/channels-docs.d.ts +7 -0
- package/src/api/interappbus/channel/channels-docs.js +7 -0
- package/src/api/interappbus/channel/client.d.ts +3 -2
- package/src/api/interappbus/channel/client.js +12 -5
- package/src/api/interappbus/channel/connection-manager.d.ts +1 -1
- package/src/api/interappbus/channel/index.d.ts +1 -1
- package/src/api/interappbus/channel/index.js +6 -8
- package/src/api/interappbus/channel/protocols/classic/message-receiver.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/classic/strategy.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/index.d.ts +3 -0
- package/src/api/interappbus/channel/protocols/rtc/endpoint.js +10 -2
- package/src/api/interappbus/channel/protocols/rtc/ice-manager.d.ts +1 -1
- package/src/api/interappbus/channel/protocols/rtc/strategy.js +1 -1
- package/src/api/interappbus/channel/provider.d.ts +1 -1
- package/src/api/interappbus/index.d.ts +1 -1
- package/src/api/interop/Factory.d.ts +1 -2
- package/src/api/interop/Factory.js +20 -4
- package/src/api/interop/InteropBroker.d.ts +16 -48
- package/src/api/interop/InteropBroker.js +39 -47
- package/src/api/interop/InteropClient.d.ts +10 -9
- package/src/api/interop/InteropClient.js +9 -8
- package/src/api/interop/SessionContextGroupClient.d.ts +1 -1
- package/src/api/interop/fdc3/PrivateChannelClient.d.ts +1 -0
- package/src/api/interop/fdc3/PrivateChannelClient.js +15 -7
- package/src/api/interop/fdc3/PrivateChannelProvider.d.ts +15 -1
- package/src/api/interop/fdc3/PrivateChannelProvider.js +80 -21
- package/src/api/interop/fdc3/fdc3-1.2.js +27 -12
- package/src/api/interop/fdc3/fdc3-2.0.d.ts +13 -12
- package/src/api/interop/fdc3/fdc3-2.0.js +33 -26
- package/src/api/interop/fdc3/fdc3.d.ts +4 -5
- package/src/api/interop/fdc3/overrideCheck.d.ts +4 -0
- package/src/api/interop/fdc3/overrideCheck.js +32 -0
- package/src/api/interop/fdc3/shapes/fdc3v2.d.ts +1 -1
- package/src/api/interop/fdc3/utils.d.ts +17 -0
- package/src/api/interop/fdc3/utils.js +52 -18
- package/src/api/interop/fdc3/versions.d.ts +1 -0
- package/src/api/interop/fdc3/versions.js +2 -0
- package/src/api/me.d.ts +1 -1
- package/src/api/platform/Factory.d.ts +6 -1
- package/src/api/platform/Factory.js +5 -0
- package/src/api/platform/Instance.d.ts +5 -3
- package/src/api/platform/Instance.js +5 -3
- package/src/api/platform/layout/Factory.d.ts +4 -0
- package/src/api/platform/layout/Factory.js +15 -3
- package/src/api/platform/layout/Instance.d.ts +7 -1
- package/src/api/platform/layout/Instance.js +26 -1
- package/src/api/platform/layout/controllers/layout-content-cache.d.ts +9 -0
- package/src/api/platform/layout/controllers/layout-content-cache.js +54 -0
- package/src/api/platform/layout/controllers/layout-entities-controller.d.ts +117 -0
- package/src/api/platform/layout/controllers/layout-entities-controller.js +270 -0
- package/src/api/platform/layout/entities/layout-entities.d.ts +144 -0
- package/src/api/platform/layout/entities/layout-entities.js +216 -0
- package/src/api/platform/layout/entities/shapes.d.ts +6 -0
- package/src/api/platform/layout/entities/shapes.js +2 -0
- package/src/api/platform/layout/layout.constants.d.ts +1 -0
- package/src/api/platform/layout/layout.constants.js +4 -0
- package/src/api/platform/layout/shapes.d.ts +3 -0
- package/src/api/platform/layout/utils/layout-traversal.d.ts +4 -0
- package/src/api/platform/layout/utils/layout-traversal.js +65 -0
- package/src/api/platform/layout/utils/view-overlay.d.ts +1 -1
- package/src/api/platform/provider.d.ts +162 -0
- package/src/api/platform/provider.js +2 -0
- package/src/api/snapshot-source/Factory.d.ts +1 -0
- package/src/api/snapshot-source/Factory.js +1 -0
- package/src/api/snapshot-source/Instance.d.ts +1 -1
- package/src/api/system/index.d.ts +1 -471
- package/src/api/system/index.js +6 -476
- package/src/api/view/Instance.d.ts +24 -5
- package/src/api/view/Instance.js +53 -8
- package/src/api/webcontents/main.d.ts +18 -4
- package/src/api/window/Instance.d.ts +26 -1
- package/src/api/window/Instance.js +25 -0
- package/src/browser.js +1 -1
- package/src/mock.js +1 -1
- package/src/namespaces.d.ts +21 -0
- package/src/namespaces.js +24 -0
- package/src/transport/fin_store.d.ts +1 -1
- package/src/transport/transport-errors.d.ts +6 -1
- package/src/transport/transport-errors.js +1 -2
- package/src/transport/transport.d.ts +9 -6
- package/src/transport/transport.js +11 -2
- package/src/util/channel-api-relay.d.ts +13 -0
- package/src/util/channel-api-relay.js +37 -0
- package/src/util/inaccessibleObject.d.ts +2 -0
- package/src/util/inaccessibleObject.js +49 -0
- package/src/util/lazy.d.ts +16 -0
- package/src/util/lazy.js +26 -0
- package/src/util/reversible-map.d.ts +11 -0
- package/src/util/reversible-map.js +49 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as OpenFin from '../../../OpenFin';
|
|
2
|
-
import Transport from '../../../transport/transport';
|
|
2
|
+
import { Transport } from '../../../transport/transport';
|
|
3
3
|
import { Base } from '../../base';
|
|
4
4
|
declare type Identity = OpenFin.Identity;
|
|
5
5
|
declare type InitLayoutOptions = OpenFin.InitLayoutOptions;
|
|
@@ -8,6 +8,7 @@ declare type PresetLayoutOptions = OpenFin.PresetLayoutOptions;
|
|
|
8
8
|
* @lends Platform#Layout
|
|
9
9
|
*/
|
|
10
10
|
export declare class Layout extends Base {
|
|
11
|
+
#private;
|
|
11
12
|
init: (options?: InitLayoutOptions) => Promise<Layout>;
|
|
12
13
|
identity: Identity;
|
|
13
14
|
private platform;
|
|
@@ -19,6 +20,11 @@ export declare class Layout extends Base {
|
|
|
19
20
|
* @tutorial Layout.getConfig
|
|
20
21
|
*/
|
|
21
22
|
getConfig(): Promise<any>;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves the top level content item of the layout.
|
|
25
|
+
* @return {Promise<TabStack | ColumnOrRow>}
|
|
26
|
+
*/
|
|
27
|
+
getRootItem(): Promise<OpenFin.ColumnOrRow | OpenFin.TabStack>;
|
|
22
28
|
/**
|
|
23
29
|
* Replaces a Platform window's layout with a new layout. Any views that were in the old layout but not the new layout
|
|
24
30
|
* will be destroyed.
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
7
|
+
var _Layout_layoutClient;
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.Layout = void 0;
|
|
10
|
+
const lazy_1 = require("../../../util/lazy");
|
|
4
11
|
const validate_1 = require("../../../util/validate");
|
|
5
|
-
const common_utils_1 = require("../common-utils");
|
|
6
12
|
const base_1 = require("../../base");
|
|
13
|
+
const common_utils_1 = require("../common-utils");
|
|
14
|
+
const layout_entities_1 = require("./entities/layout-entities");
|
|
15
|
+
const layout_constants_1 = require("./layout.constants");
|
|
7
16
|
/**
|
|
8
17
|
* @lends Platform#Layout
|
|
9
18
|
*/
|
|
@@ -11,6 +20,12 @@ class Layout extends base_1.Base {
|
|
|
11
20
|
// eslint-disable-next-line no-shadow
|
|
12
21
|
constructor(identity, wire) {
|
|
13
22
|
super(wire);
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
* Lazily constructed {@link LayoutEntitiesClient} bound to this platform's client and identity
|
|
26
|
+
* The client is for {@link LayoutEntitiesController}
|
|
27
|
+
*/
|
|
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)));
|
|
14
29
|
/**
|
|
15
30
|
* Replaces a Platform window's layout with a new layout. Any views that were in the old layout but not the new layout
|
|
16
31
|
* will be destroyed.
|
|
@@ -94,5 +109,15 @@ class Layout extends base_1.Base {
|
|
|
94
109
|
target: this.identity
|
|
95
110
|
});
|
|
96
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Retrieves the top level content item of the layout.
|
|
114
|
+
* @return {Promise<TabStack | ColumnOrRow>}
|
|
115
|
+
*/
|
|
116
|
+
async getRootItem() {
|
|
117
|
+
const client = await __classPrivateFieldGet(this, _Layout_layoutClient, "f").getValue();
|
|
118
|
+
const root = await client.getRoot();
|
|
119
|
+
return layout_entities_1.LayoutNode.getEntity(root, client);
|
|
120
|
+
}
|
|
97
121
|
}
|
|
98
122
|
exports.Layout = Layout;
|
|
123
|
+
_Layout_layoutClient = new WeakMap();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class LayoutContentCache {
|
|
2
|
+
private contentItemCache;
|
|
3
|
+
private contentItemCacheId;
|
|
4
|
+
private createCacheKey;
|
|
5
|
+
hasKey: (id: string) => boolean;
|
|
6
|
+
getItemOrUndefined: (id: string) => GoldenLayout.ContentItem | undefined;
|
|
7
|
+
getContentItemOrThrow: (id: string, expectedType?: string[]) => GoldenLayout.ContentItem;
|
|
8
|
+
getOrCreateEntityId: (contentItem: GoldenLayout.ContentItem) => string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LayoutContentCache = void 0;
|
|
4
|
+
const reversible_map_1 = require("../../../../util/reversible-map");
|
|
5
|
+
class LayoutContentCache {
|
|
6
|
+
constructor() {
|
|
7
|
+
// ContentItems currently do not have a unique id, this helps us to lookup items by value
|
|
8
|
+
this.contentItemCache = new reversible_map_1.ReversibleMap();
|
|
9
|
+
this.contentItemCacheId = 0;
|
|
10
|
+
this.createCacheKey = () => {
|
|
11
|
+
const key = `entity-${this.contentItemCacheId.toString()}`;
|
|
12
|
+
this.contentItemCacheId += 1;
|
|
13
|
+
return key;
|
|
14
|
+
};
|
|
15
|
+
this.hasKey = (id) => {
|
|
16
|
+
return this.contentItemCache.hasKey(id);
|
|
17
|
+
};
|
|
18
|
+
this.getItemOrUndefined = (id) => {
|
|
19
|
+
try {
|
|
20
|
+
return this.getContentItemOrThrow(id);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
this.getContentItemOrThrow = (id, expectedType) => {
|
|
27
|
+
if (!this.contentItemCache.hasKey(id)) {
|
|
28
|
+
throw new Error('Layout component has been destroyed or detached from the current layout.');
|
|
29
|
+
}
|
|
30
|
+
const contentItem = this.contentItemCache.getValue(id);
|
|
31
|
+
if (expectedType && !expectedType.includes(contentItem.type)) {
|
|
32
|
+
throw new Error(`Layout item is not the expected type. Expected ${expectedType.join(', ')}, got ${contentItem.type}.`);
|
|
33
|
+
}
|
|
34
|
+
return contentItem;
|
|
35
|
+
};
|
|
36
|
+
this.getOrCreateEntityId = (contentItem) => {
|
|
37
|
+
if (this.contentItemCache.hasValue(contentItem)) {
|
|
38
|
+
return this.contentItemCache.getKey(contentItem);
|
|
39
|
+
}
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
41
|
+
const onItemDestroyed = ({ origin, ...rest }) => {
|
|
42
|
+
if (origin === contentItem) {
|
|
43
|
+
this.contentItemCache.deleteValue(contentItem);
|
|
44
|
+
contentItem.unbind('itemDestroyed', onItemDestroyed);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
contentItem.on('itemDestroyed', onItemDestroyed);
|
|
48
|
+
const key = this.createCacheKey();
|
|
49
|
+
this.contentItemCache.setUnique(key, contentItem);
|
|
50
|
+
return key;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.LayoutContentCache = LayoutContentCache;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type * as OpenFin from '../../../../OpenFin';
|
|
2
|
+
import type { LayoutContentCache } from './layout-content-cache';
|
|
3
|
+
declare type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions;
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
* Controller for the layout entities apis, allowing alterations to be applied
|
|
7
|
+
* to an instance of layout manager in a structured manner.
|
|
8
|
+
*/
|
|
9
|
+
export declare class LayoutEntitiesController {
|
|
10
|
+
private layoutManager;
|
|
11
|
+
private layoutContentCache;
|
|
12
|
+
constructor(layoutManager: any, layoutContentCache: LayoutContentCache);
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
* @returns the root contentItem of the layout.
|
|
16
|
+
*/
|
|
17
|
+
getRoot: () => OpenFin.LayoutEntityDefinition;
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* Retrieves the containing stack of a given view identity.
|
|
21
|
+
* @param view Identity of the view to retrieve the stack of.
|
|
22
|
+
* @returns Stack containing the given view.
|
|
23
|
+
* @throws If the view does not belong to a stack within the layout manager.
|
|
24
|
+
*/
|
|
25
|
+
getStackByView: (view: OpenFin.Identity) => Promise<OpenFin.LayoutEntityDefinition | undefined>;
|
|
26
|
+
/**
|
|
27
|
+
* @internal
|
|
28
|
+
* Returns all views belonging to a given stack
|
|
29
|
+
*
|
|
30
|
+
* NOTE: Due to (TODO: ticket) Golden Layouts has an issue which changes the order of tabs
|
|
31
|
+
* when the amount of new views to add overflows the width of the container. This results
|
|
32
|
+
* in tabs being re-ordered in the UI, while the underlying content item array remains in the
|
|
33
|
+
* original order specified. So calling getStackViews() will return this underlying array order,
|
|
34
|
+
* with indexes that will not match up to the render-order of the tabs.
|
|
35
|
+
*
|
|
36
|
+
* @param id - Entity id of the stack.
|
|
37
|
+
* @returns A list of view identities in order of appearance.
|
|
38
|
+
* @throws if the content item associated with the entity id does not exist or is not a stack.
|
|
39
|
+
*/
|
|
40
|
+
getStackViews: (id: string) => OpenFin.Identity[];
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* Retrieves the content of a column or row and adds each to the
|
|
44
|
+
* entity cache to allow them to be addressed externally.
|
|
45
|
+
* @param id Entity id of the Column Or Row to retrieve the content of.
|
|
46
|
+
* @returns Array of layout entity definitions
|
|
47
|
+
* @throws if the entity associated with {@link id} is not in the entity cache, does not belogn to a layout, or is not a column/row.
|
|
48
|
+
*/
|
|
49
|
+
getContent(id: string): OpenFin.LayoutEntityDefinition[];
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
* Retrieves the parent content item of the given entity, and adds it to the entity cache
|
|
53
|
+
* so it can be addressed externally.
|
|
54
|
+
* @param id Entity id associated with a layout content item.
|
|
55
|
+
* @returns An entity definition for the given entity's parent, or undefined if the entity is the top level
|
|
56
|
+
* content item or has been removed from the layout entirely.
|
|
57
|
+
*/
|
|
58
|
+
getParent(id: string): OpenFin.LayoutEntityDefinition | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
* @param id Entity id associated with a layout content item.
|
|
62
|
+
* @returns true if the given entity is the root content item, false otherwise.
|
|
63
|
+
*/
|
|
64
|
+
isRoot: (id: string) => boolean;
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
* Checks whether the given entity exists.
|
|
68
|
+
* @param entityId Id of a content item within the layout
|
|
69
|
+
* @returns True if the content item exists and belongs to the layout.
|
|
70
|
+
*/
|
|
71
|
+
exists: (entityId: string) => boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
* Adds an existing view to the stack, or creates and adds a view to the given stack.
|
|
75
|
+
*
|
|
76
|
+
* NOTE: Due to (TODO: ticket) Golden Layouts has an issue which changes the order of tabs
|
|
77
|
+
* when the amount of new views to add overflows the width of the container. This results
|
|
78
|
+
* in tabs being re-ordered in the UI, while the underlying content item array remains in the
|
|
79
|
+
* original order specified. So calling getStackViews() will return this underlying array order,
|
|
80
|
+
* with indexes that will not match up to the render-order of the tabs.
|
|
81
|
+
*
|
|
82
|
+
* @param stackEntityId Entity id of the stack content item within the layout.
|
|
83
|
+
* @param viewCreationOrReference View identity or creation options
|
|
84
|
+
* @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)
|
|
85
|
+
* @returns Promise resolving with the identity of the newly added view.
|
|
86
|
+
* @throws If the view does not exist, fails to create, or the stack does not exist.
|
|
87
|
+
*/
|
|
88
|
+
addViewToStack: (stackEntityId: string, viewCreationOrReference: ViewCreationOrReference, { index }?: OpenFin.AddViewToStackOptions) => Promise<OpenFin.Identity>;
|
|
89
|
+
private findViewInStack;
|
|
90
|
+
/**
|
|
91
|
+
* @internal
|
|
92
|
+
* Removes a view from the given stack. If it's the only view, the stack will be destroyed, unless window creation
|
|
93
|
+
* option closeOnLastViewRemoved is set to false.
|
|
94
|
+
*
|
|
95
|
+
* @param stackEntityId Entity id of a stack content item to remove the view from.
|
|
96
|
+
* @param view Identity of the view to remove.
|
|
97
|
+
* @throws If the stack does not exist or the view does not exist or belong to the stack.
|
|
98
|
+
*/
|
|
99
|
+
removeViewFromStack: (stackEntityId: string, view: OpenFin.Identity) => Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
* Creates a new adjacent 'stack' and adds the views to it at the specified position
|
|
103
|
+
* @param targetId Entity id of the content item to add a stack adjacent to it
|
|
104
|
+
* @param views List of identities or view creation options of the views to include in the stack
|
|
105
|
+
* @param options Creation options, defaults to position: 'right'
|
|
106
|
+
* @returns the Entity Id of the new stack
|
|
107
|
+
*/
|
|
108
|
+
createAdjacentStack: (targetId: string, views: ViewCreationOrReference[], options: {
|
|
109
|
+
position?: OpenFin.LayoutPosition;
|
|
110
|
+
}) => Promise<string>;
|
|
111
|
+
getAdjacentStacks: ({ targetId, edge }: {
|
|
112
|
+
targetId: string;
|
|
113
|
+
edge: OpenFin.LayoutPosition;
|
|
114
|
+
}) => Promise<Pick<OpenFin.LayoutEntityDefinition, 'entityId'>[]>;
|
|
115
|
+
setStackActiveView: (stackEntityId: string, viewIdentity: OpenFin.Identity) => Promise<void>;
|
|
116
|
+
}
|
|
117
|
+
export {};
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.LayoutEntitiesController = void 0;
|
|
10
|
+
const decorators_1 = require("../../../api-exposer/decorators");
|
|
11
|
+
const layout_traversal_1 = require("../utils/layout-traversal");
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
* Controller for the layout entities apis, allowing alterations to be applied
|
|
15
|
+
* to an instance of layout manager in a structured manner.
|
|
16
|
+
*/
|
|
17
|
+
class LayoutEntitiesController {
|
|
18
|
+
constructor(
|
|
19
|
+
// workaround to prevent importing entire GoldenLayouts, also re-written at build time to type any
|
|
20
|
+
layoutManager, layoutContentCache) {
|
|
21
|
+
this.layoutManager = layoutManager;
|
|
22
|
+
this.layoutContentCache = layoutContentCache;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
* @returns the root contentItem of the layout.
|
|
26
|
+
*/
|
|
27
|
+
this.getRoot = () => {
|
|
28
|
+
const root = this.layoutManager.layout.root.contentItems[0];
|
|
29
|
+
return {
|
|
30
|
+
// TODO: fix typing
|
|
31
|
+
type: root.type,
|
|
32
|
+
entityId: this.layoutContentCache.getOrCreateEntityId(root)
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
* Retrieves the containing stack of a given view identity.
|
|
38
|
+
* @param view Identity of the view to retrieve the stack of.
|
|
39
|
+
* @returns Stack containing the given view.
|
|
40
|
+
* @throws If the view does not belong to a stack within the layout manager.
|
|
41
|
+
*/
|
|
42
|
+
this.getStackByView = async (view) => {
|
|
43
|
+
var _a, _b, _c, _d;
|
|
44
|
+
const viewComponent = this.layoutManager.getViewComponent(view);
|
|
45
|
+
if (!viewComponent || ((_b = (_a = viewComponent.container) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent.type) !== 'stack') {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const stack = (_d = (_c = viewComponent.container) === null || _c === void 0 ? void 0 : _c.parent) === null || _d === void 0 ? void 0 : _d.parent;
|
|
49
|
+
return { entityId: this.layoutContentCache.getOrCreateEntityId(stack), type: 'stack' };
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* @internal
|
|
53
|
+
* Returns all views belonging to a given stack
|
|
54
|
+
*
|
|
55
|
+
* NOTE: Due to (TODO: ticket) Golden Layouts has an issue which changes the order of tabs
|
|
56
|
+
* when the amount of new views to add overflows the width of the container. This results
|
|
57
|
+
* in tabs being re-ordered in the UI, while the underlying content item array remains in the
|
|
58
|
+
* original order specified. So calling getStackViews() will return this underlying array order,
|
|
59
|
+
* with indexes that will not match up to the render-order of the tabs.
|
|
60
|
+
*
|
|
61
|
+
* @param id - Entity id of the stack.
|
|
62
|
+
* @returns A list of view identities in order of appearance.
|
|
63
|
+
* @throws if the content item associated with the entity id does not exist or is not a stack.
|
|
64
|
+
*/
|
|
65
|
+
this.getStackViews = (id) => {
|
|
66
|
+
const stack = this.layoutContentCache.getContentItemOrThrow(id, ['stack']);
|
|
67
|
+
const views = stack.contentItems.map((ci) => {
|
|
68
|
+
var _a;
|
|
69
|
+
return ({
|
|
70
|
+
name: (_a = ci.config.componentState) === null || _a === void 0 ? void 0 : _a.name,
|
|
71
|
+
uuid: this.layoutManager.ofWindow.identity.uuid
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
return views;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
* @param id Entity id associated with a layout content item.
|
|
79
|
+
* @returns true if the given entity is the root content item, false otherwise.
|
|
80
|
+
*/
|
|
81
|
+
this.isRoot = (id) => {
|
|
82
|
+
var _a;
|
|
83
|
+
const ci = this.layoutContentCache.getContentItemOrThrow(id);
|
|
84
|
+
return !!((_a = ci.parent) === null || _a === void 0 ? void 0 : _a.isRoot);
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
* Checks whether the given entity exists.
|
|
89
|
+
* @param entityId Id of a content item within the layout
|
|
90
|
+
* @returns True if the content item exists and belongs to the layout.
|
|
91
|
+
*/
|
|
92
|
+
this.exists = (entityId) => {
|
|
93
|
+
return this.layoutContentCache.hasKey(entityId);
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
* Adds an existing view to the stack, or creates and adds a view to the given stack.
|
|
98
|
+
*
|
|
99
|
+
* NOTE: Due to (TODO: ticket) Golden Layouts has an issue which changes the order of tabs
|
|
100
|
+
* when the amount of new views to add overflows the width of the container. This results
|
|
101
|
+
* in tabs being re-ordered in the UI, while the underlying content item array remains in the
|
|
102
|
+
* original order specified. So calling getStackViews() will return this underlying array order,
|
|
103
|
+
* with indexes that will not match up to the render-order of the tabs.
|
|
104
|
+
*
|
|
105
|
+
* @param stackEntityId Entity id of the stack content item within the layout.
|
|
106
|
+
* @param viewCreationOrReference View identity or creation options
|
|
107
|
+
* @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)
|
|
108
|
+
* @returns Promise resolving with the identity of the newly added view.
|
|
109
|
+
* @throws If the view does not exist, fails to create, or the stack does not exist.
|
|
110
|
+
*/
|
|
111
|
+
this.addViewToStack = async (stackEntityId, viewCreationOrReference, { index } = { index: 0 }) => {
|
|
112
|
+
const currentStack = this.layoutContentCache.getContentItemOrThrow(stackEntityId);
|
|
113
|
+
if (index && index > currentStack.contentItems.length + 1) {
|
|
114
|
+
throw new Error(`Index '${index}' out of range, please exclude the index or specify a number between 0 and ${currentStack.contentItems.length}`);
|
|
115
|
+
}
|
|
116
|
+
const location = {
|
|
117
|
+
id: stackEntityId,
|
|
118
|
+
index
|
|
119
|
+
};
|
|
120
|
+
const { identity } = await this.layoutManager.platform.createView(viewCreationOrReference, {
|
|
121
|
+
...this.layoutManager.ofWindow.identity,
|
|
122
|
+
location,
|
|
123
|
+
});
|
|
124
|
+
return identity;
|
|
125
|
+
};
|
|
126
|
+
this.findViewInStack = (stack, viewIdentity) => {
|
|
127
|
+
return stack.contentItems.find((ci) => { var _a, _b; return ((_b = (_a = ci.config) === null || _a === void 0 ? void 0 : _a.componentState) === null || _b === void 0 ? void 0 : _b.name) === viewIdentity.name; });
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* @internal
|
|
131
|
+
* Removes a view from the given stack. If it's the only view, the stack will be destroyed, unless window creation
|
|
132
|
+
* option closeOnLastViewRemoved is set to false.
|
|
133
|
+
*
|
|
134
|
+
* @param stackEntityId Entity id of a stack content item to remove the view from.
|
|
135
|
+
* @param view Identity of the view to remove.
|
|
136
|
+
* @throws If the stack does not exist or the view does not exist or belong to the stack.
|
|
137
|
+
*/
|
|
138
|
+
this.removeViewFromStack = async (stackEntityId, view) => {
|
|
139
|
+
const stack = this.layoutContentCache.getContentItemOrThrow(stackEntityId, ['stack']);
|
|
140
|
+
const viewInstance = this.findViewInStack(stack, view);
|
|
141
|
+
if (!viewInstance) {
|
|
142
|
+
throw new Error(`Tried to remove a view ('${view.name}') which does not belong to the stack.`);
|
|
143
|
+
}
|
|
144
|
+
await this.layoutManager.platform.closeView(view);
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* @internal
|
|
148
|
+
* Creates a new adjacent 'stack' and adds the views to it at the specified position
|
|
149
|
+
* @param targetId Entity id of the content item to add a stack adjacent to it
|
|
150
|
+
* @param views List of identities or view creation options of the views to include in the stack
|
|
151
|
+
* @param options Creation options, defaults to position: 'right'
|
|
152
|
+
* @returns the Entity Id of the new stack
|
|
153
|
+
*/
|
|
154
|
+
this.createAdjacentStack = async (targetId, views, options) => {
|
|
155
|
+
if (views.length === 0) {
|
|
156
|
+
throw new Error('Cannot create stack with empty view array.');
|
|
157
|
+
}
|
|
158
|
+
const { position = 'right' } = options;
|
|
159
|
+
if (!['top', 'bottom', 'left', 'right'].includes(position)) {
|
|
160
|
+
throw new Error(`Invalid position '${position}' specified.`);
|
|
161
|
+
}
|
|
162
|
+
const currentStack = this.layoutContentCache.getContentItemOrThrow(targetId);
|
|
163
|
+
const { parent } = currentStack;
|
|
164
|
+
const containerType = ['top', 'bottom'].includes(position) ? 'column' : 'row';
|
|
165
|
+
const newContainer = this.layoutManager.layout.createContentItem({
|
|
166
|
+
type: containerType,
|
|
167
|
+
});
|
|
168
|
+
const newStack = this.layoutManager.layout.createContentItem({
|
|
169
|
+
type: 'stack'
|
|
170
|
+
});
|
|
171
|
+
parent.replaceChild(currentStack, newContainer);
|
|
172
|
+
newContainer.addChild(currentStack);
|
|
173
|
+
const offset = ['left', 'top'].includes(position) ? -1 : 1;
|
|
174
|
+
const newStackIndex = newContainer.contentItems.indexOf(currentStack) + offset;
|
|
175
|
+
newContainer.addChild(newStack, newStackIndex);
|
|
176
|
+
const entityId = this.layoutContentCache.getOrCreateEntityId(newStack);
|
|
177
|
+
// !! reverse the views list so we can utilize index=0 (prepending each tab)
|
|
178
|
+
// which will maintain correct order in the underlying GL structure and avoids the reflow bug
|
|
179
|
+
await Promise.all(views.reverse().map((view) => this.addViewToStack(entityId, view)));
|
|
180
|
+
return entityId;
|
|
181
|
+
};
|
|
182
|
+
this.getAdjacentStacks = async ({ targetId, edge }) => {
|
|
183
|
+
const contentItem = this.layoutContentCache.getContentItemOrThrow(targetId);
|
|
184
|
+
// call utils helper to traverse and return adjacent stacks
|
|
185
|
+
return (0, layout_traversal_1.getAdjacentStacks)(contentItem, edge).map((stack) => ({
|
|
186
|
+
entityId: this.layoutContentCache.getOrCreateEntityId(stack),
|
|
187
|
+
}));
|
|
188
|
+
};
|
|
189
|
+
this.setStackActiveView = async (stackEntityId, viewIdentity) => {
|
|
190
|
+
const stack = this.layoutContentCache.getContentItemOrThrow(stackEntityId, ['stack']);
|
|
191
|
+
const view = this.findViewInStack(stack, viewIdentity);
|
|
192
|
+
if (!view) {
|
|
193
|
+
throw new Error(`Tried to set a view ('${viewIdentity.name}') as active when it does not belong to the stack.`);
|
|
194
|
+
}
|
|
195
|
+
stack.setActiveContentItem(view, true);
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* @internal
|
|
200
|
+
* Retrieves the content of a column or row and adds each to the
|
|
201
|
+
* entity cache to allow them to be addressed externally.
|
|
202
|
+
* @param id Entity id of the Column Or Row to retrieve the content of.
|
|
203
|
+
* @returns Array of layout entity definitions
|
|
204
|
+
* @throws if the entity associated with {@link id} is not in the entity cache, does not belogn to a layout, or is not a column/row.
|
|
205
|
+
*/
|
|
206
|
+
getContent(id) {
|
|
207
|
+
const ci = this.layoutContentCache.getContentItemOrThrow(id, ['column', 'row']);
|
|
208
|
+
return ci.contentItems.map((item) => ({
|
|
209
|
+
type: item.type,
|
|
210
|
+
entityId: this.layoutContentCache.getOrCreateEntityId(item)
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
;
|
|
214
|
+
/**
|
|
215
|
+
* @internal
|
|
216
|
+
* Retrieves the parent content item of the given entity, and adds it to the entity cache
|
|
217
|
+
* so it can be addressed externally.
|
|
218
|
+
* @param id Entity id associated with a layout content item.
|
|
219
|
+
* @returns An entity definition for the given entity's parent, or undefined if the entity is the top level
|
|
220
|
+
* content item or has been removed from the layout entirely.
|
|
221
|
+
*/
|
|
222
|
+
getParent(id) {
|
|
223
|
+
const ci = this.layoutContentCache.getContentItemOrThrow(id);
|
|
224
|
+
if (ci.parent && !ci.parent.isRoot && ci.parent.contentItems.includes(ci)) {
|
|
225
|
+
return {
|
|
226
|
+
type: ci.parent.type,
|
|
227
|
+
entityId: this.layoutContentCache.getOrCreateEntityId(ci.parent)
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
return undefined;
|
|
231
|
+
}
|
|
232
|
+
;
|
|
233
|
+
}
|
|
234
|
+
__decorate([
|
|
235
|
+
(0, decorators_1.expose)()
|
|
236
|
+
], LayoutEntitiesController.prototype, "getRoot", void 0);
|
|
237
|
+
__decorate([
|
|
238
|
+
(0, decorators_1.expose)()
|
|
239
|
+
], LayoutEntitiesController.prototype, "getStackByView", void 0);
|
|
240
|
+
__decorate([
|
|
241
|
+
(0, decorators_1.expose)()
|
|
242
|
+
], LayoutEntitiesController.prototype, "getStackViews", void 0);
|
|
243
|
+
__decorate([
|
|
244
|
+
(0, decorators_1.expose)()
|
|
245
|
+
], LayoutEntitiesController.prototype, "getContent", null);
|
|
246
|
+
__decorate([
|
|
247
|
+
(0, decorators_1.expose)()
|
|
248
|
+
], LayoutEntitiesController.prototype, "getParent", null);
|
|
249
|
+
__decorate([
|
|
250
|
+
(0, decorators_1.expose)()
|
|
251
|
+
], LayoutEntitiesController.prototype, "isRoot", void 0);
|
|
252
|
+
__decorate([
|
|
253
|
+
(0, decorators_1.expose)()
|
|
254
|
+
], LayoutEntitiesController.prototype, "exists", void 0);
|
|
255
|
+
__decorate([
|
|
256
|
+
(0, decorators_1.expose)()
|
|
257
|
+
], LayoutEntitiesController.prototype, "addViewToStack", void 0);
|
|
258
|
+
__decorate([
|
|
259
|
+
(0, decorators_1.expose)()
|
|
260
|
+
], LayoutEntitiesController.prototype, "removeViewFromStack", void 0);
|
|
261
|
+
__decorate([
|
|
262
|
+
(0, decorators_1.expose)()
|
|
263
|
+
], LayoutEntitiesController.prototype, "createAdjacentStack", void 0);
|
|
264
|
+
__decorate([
|
|
265
|
+
(0, decorators_1.expose)()
|
|
266
|
+
], LayoutEntitiesController.prototype, "getAdjacentStacks", void 0);
|
|
267
|
+
__decorate([
|
|
268
|
+
(0, decorators_1.expose)()
|
|
269
|
+
], LayoutEntitiesController.prototype, "setStackActiveView", void 0);
|
|
270
|
+
exports.LayoutEntitiesController = LayoutEntitiesController;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type * as OpenFin from '../../../../OpenFin';
|
|
2
|
+
import { LayoutEntitiesClient } from '../shapes';
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
* Supplies an ApiClient for {@link LayoutEntitiesController} and helper methods
|
|
6
|
+
* for the entities {@link TabStack} AND {@link ColumnOrRow} to use.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class LayoutNode {
|
|
9
|
+
#private;
|
|
10
|
+
/** @internal */
|
|
11
|
+
protected constructor(client: LayoutEntitiesClient, entityId: string);
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
* The type of this node, one of: 'row' | 'column' | 'stack';
|
|
15
|
+
*/
|
|
16
|
+
readonly abstract type: OpenFin.LayoutEntityTypes;
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
* This instance's unique id used when calling the layout-entities-controller api client
|
|
20
|
+
*/
|
|
21
|
+
protected readonly entityId: string;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
* Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch
|
|
25
|
+
* @param client
|
|
26
|
+
* @param controllerId
|
|
27
|
+
* @param identity
|
|
28
|
+
* @returns a new instance of {@link LayoutEntitiesClient} with bound to the controllerId
|
|
29
|
+
*/
|
|
30
|
+
static newLayoutEntitiesClient: (client: OpenFin.ChannelClient, controllerId: string, identity: OpenFin.Identity) => Promise<LayoutEntitiesClient>;
|
|
31
|
+
static getEntity: (definition: OpenFin.LayoutEntityDefinition, client: LayoutEntitiesClient) => ColumnOrRow | TabStack;
|
|
32
|
+
/**
|
|
33
|
+
* Determines if this {@link ColumnOrRow} or {@link TabStack} is the top level content item in the current layout.
|
|
34
|
+
* @returns Promise resolving true if this is the root, or false otherwise.
|
|
35
|
+
*/
|
|
36
|
+
isRoot: () => Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Determines if this {@link ColumnOrRow} or {@link TabStack} is the top level
|
|
39
|
+
* content item in the current layout.
|
|
40
|
+
* @returns Promise resolving true if this is the root, or false otherwise.
|
|
41
|
+
*/
|
|
42
|
+
exists: () => Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves the parent {@link ColumnOrRow} or {@link TabStack} of this item, if one exists.
|
|
45
|
+
* @returns Promise resolving with the {@link ColumnOrRow} or {@link TabStack} that contains this item, or undefined if this is the root content item.
|
|
46
|
+
*/
|
|
47
|
+
getParent: () => Promise<ColumnOrRow | TabStack | undefined>;
|
|
48
|
+
/**
|
|
49
|
+
* Given a list of view creation options or references and a layout position, creates an adjacent {@link TabStack}
|
|
50
|
+
*
|
|
51
|
+
* Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active
|
|
52
|
+
* during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
53
|
+
* This means the views you pass to createAdjacentStack() may not render in the order given by the array.
|
|
54
|
+
* Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack.
|
|
55
|
+
*
|
|
56
|
+
* @param views List of identities or view creation options of the views to include in the stack
|
|
57
|
+
* @param options Creation options, defaults to position: 'right'
|
|
58
|
+
* @returns an instance of {@link TabStack} containing the given views
|
|
59
|
+
* @experimental
|
|
60
|
+
*/
|
|
61
|
+
createAdjacentStack: (views: OpenFin.PlatformViewCreationOptions[], options: {
|
|
62
|
+
position?: OpenFin.LayoutPosition;
|
|
63
|
+
}) => Promise<TabStack>;
|
|
64
|
+
/**
|
|
65
|
+
* Finds the immediate adjacent layout item given an edge Position
|
|
66
|
+
* @param edge
|
|
67
|
+
* @returns an array of {@link TabStack} found, if none found returns an empty array.
|
|
68
|
+
*/
|
|
69
|
+
getAdjacentStacks: (edge: OpenFin.LayoutPosition) => Promise<TabStack[]>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A {@link TabStack} is used to manage the state of a TabStack within an OpenFin Layout and
|
|
73
|
+
* traverse to its parent Content Item.
|
|
74
|
+
*/
|
|
75
|
+
export declare class TabStack extends LayoutNode {
|
|
76
|
+
#private;
|
|
77
|
+
/** @internal */
|
|
78
|
+
constructor(client: LayoutEntitiesClient, entityId: string);
|
|
79
|
+
/**
|
|
80
|
+
* Type of the content item. Always stack, but useful for distinguishing between a {@link TabStack} and {@link ColumnOrRow}.
|
|
81
|
+
*/
|
|
82
|
+
readonly type = "stack";
|
|
83
|
+
/**
|
|
84
|
+
* Retrieves a list of all views belonging to this {@link TabStack}.
|
|
85
|
+
*
|
|
86
|
+
* Known Issue: If adding a view overflows the tab-container width, the added view will be set as active
|
|
87
|
+
* and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
88
|
+
* If that happens and then getViews() is called, it will return the identities in a different order than
|
|
89
|
+
* than the currently rendered tab order.
|
|
90
|
+
*
|
|
91
|
+
* @returns Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
|
|
92
|
+
* @throws If the {@link TabStack} has been destroyed.
|
|
93
|
+
* @experimental
|
|
94
|
+
*/
|
|
95
|
+
getViews: () => Promise<OpenFin.Identity[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Adds or creates a view in this {@link TabStack}.
|
|
98
|
+
*
|
|
99
|
+
* Known Issue: If adding a view overflows the tab-container, the added view will be set as active
|
|
100
|
+
* and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged.
|
|
101
|
+
*
|
|
102
|
+
* @param view The identity of an existing view to add, or options to create a view.
|
|
103
|
+
* @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)
|
|
104
|
+
* @returns Resolves with the {@link OpenFin.Identity identity} of the added view.
|
|
105
|
+
* @throws If the view does not exist or fails to create.
|
|
106
|
+
* @throws If the {@link TabStack} has been destroyed.
|
|
107
|
+
* @experimental
|
|
108
|
+
*/
|
|
109
|
+
addView: (view: OpenFin.Identity | OpenFin.PlatformViewCreationOptions, options?: OpenFin.AddViewToStackOptions) => Promise<OpenFin.Identity>;
|
|
110
|
+
/**
|
|
111
|
+
* Removes a view from this {@link TabStack}.
|
|
112
|
+
* @param view {@link OpenFin.Identiy Identity} of the view to remove.
|
|
113
|
+
* @throws If the view does not exist or does not belong to the stack.
|
|
114
|
+
* @throws If the {@link TabStack} has been destroyed.
|
|
115
|
+
*/
|
|
116
|
+
removeView: (view: OpenFin.Identity) => Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Sets the active view of the {@link TabStack} without focusing it.
|
|
119
|
+
* @param view {@link OpenFin.Identity Identity} of the view to activate.
|
|
120
|
+
* @returns Promise which resolves with void once the view has been activated.
|
|
121
|
+
* @throws If the {@link TabStack} has been destroyed.
|
|
122
|
+
* @throws If the view does not exist.
|
|
123
|
+
* @tutorial TabStack.setActiveView
|
|
124
|
+
* @experimental
|
|
125
|
+
*/
|
|
126
|
+
setActiveView: (view: OpenFin.Identity) => Promise<void>;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* A {@link ColumnOrRow} is used to manage the state of a ColumnOrRow within an OpenFin Layout.
|
|
130
|
+
*/
|
|
131
|
+
export declare class ColumnOrRow extends LayoutNode {
|
|
132
|
+
#private;
|
|
133
|
+
/** @internal */
|
|
134
|
+
constructor(client: LayoutEntitiesClient, entityId: string, type: 'row' | 'column');
|
|
135
|
+
/**
|
|
136
|
+
* The type of this {@link ColumnOrRow}. Either 'row' or 'column'.
|
|
137
|
+
*/
|
|
138
|
+
readonly type: 'column' | 'row';
|
|
139
|
+
/**
|
|
140
|
+
* Retrieves a list of all content items belonging to this {@link ColumnOrRow} in order of appearance.
|
|
141
|
+
* @returns Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
|
|
142
|
+
*/
|
|
143
|
+
getContent: () => Promise<(ColumnOrRow | TabStack)[]>;
|
|
144
|
+
}
|