@openfin/core 33.76.31 → 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.
Files changed (116) hide show
  1. package/openfin-core-33.76.36.tgz +0 -0
  2. package/package.json +1 -1
  3. package/src/OpenFin.d.ts +27 -16
  4. package/src/api/application/Factory.d.ts +148 -100
  5. package/src/api/application/Factory.js +148 -100
  6. package/src/api/application/Instance.d.ts +477 -106
  7. package/src/api/application/Instance.js +474 -106
  8. package/src/api/application/index.d.ts +9 -0
  9. package/src/api/application/index.js +9 -0
  10. package/src/api/base.d.ts +69 -0
  11. package/src/api/base.js +69 -0
  12. package/src/api/clipboard/index.d.ts +111 -31
  13. package/src/api/clipboard/index.js +111 -31
  14. package/src/api/events/application.d.ts +12 -0
  15. package/src/api/events/application.js +12 -0
  16. package/src/api/events/channel.d.ts +5 -0
  17. package/src/api/events/channel.js +5 -0
  18. package/src/api/events/externalApplication.d.ts +5 -0
  19. package/src/api/events/externalApplication.js +5 -0
  20. package/src/api/events/frame.d.ts +5 -0
  21. package/src/api/events/globalHotkey.d.ts +5 -0
  22. package/src/api/events/platform.d.ts +9 -1
  23. package/src/api/events/platform.js +8 -0
  24. package/src/api/events/system.d.ts +13 -0
  25. package/src/api/events/system.js +13 -0
  26. package/src/api/events/view.d.ts +19 -9
  27. package/src/api/events/view.js +10 -0
  28. package/src/api/events/webcontents.d.ts +21 -10
  29. package/src/api/events/webcontents.js +11 -0
  30. package/src/api/events/window.d.ts +70 -1
  31. package/src/api/events/window.js +10 -0
  32. package/src/api/external-application/Factory.d.ts +16 -9
  33. package/src/api/external-application/Factory.js +16 -9
  34. package/src/api/external-application/Instance.d.ts +40 -32
  35. package/src/api/external-application/Instance.js +40 -32
  36. package/src/api/external-application/index.d.ts +9 -0
  37. package/src/api/external-application/index.js +9 -0
  38. package/src/api/fin.d.ts +3 -0
  39. package/src/api/fin.js +3 -0
  40. package/src/api/frame/Factory.d.ts +30 -13
  41. package/src/api/frame/Factory.js +30 -13
  42. package/src/api/frame/Instance.d.ts +51 -38
  43. package/src/api/frame/Instance.js +51 -38
  44. package/src/api/frame/index.d.ts +11 -0
  45. package/src/api/frame/index.js +11 -0
  46. package/src/api/global-hotkey/index.d.ts +81 -13
  47. package/src/api/global-hotkey/index.js +81 -13
  48. package/src/api/interappbus/channel/channel.d.ts +257 -0
  49. package/src/api/interappbus/channel/channel.js +257 -0
  50. package/src/api/interappbus/channel/channels-docs.d.ts +59 -57
  51. package/src/api/interappbus/channel/channels-docs.js +71 -68
  52. package/src/api/interappbus/channel/client.d.ts +93 -0
  53. package/src/api/interappbus/channel/client.js +93 -1
  54. package/src/api/interappbus/channel/index.d.ts +164 -0
  55. package/src/api/interappbus/channel/index.js +165 -1
  56. package/src/api/interappbus/channel/provider.d.ts +172 -0
  57. package/src/api/interappbus/channel/provider.js +172 -0
  58. package/src/api/interappbus/index.d.ts +55 -20
  59. package/src/api/interappbus/index.js +55 -20
  60. package/src/api/interop/Factory.d.ts +30 -10
  61. package/src/api/interop/Factory.js +30 -10
  62. package/src/api/interop/InteropBroker.d.ts +298 -70
  63. package/src/api/interop/InteropBroker.js +298 -70
  64. package/src/api/interop/InteropClient.d.ts +286 -62
  65. package/src/api/interop/InteropClient.js +286 -62
  66. package/src/api/interop/SessionContextGroupClient.d.ts +2 -2
  67. package/src/api/interop/SessionContextGroupClient.js +2 -2
  68. package/src/api/interop/fdc3/documentationStub.d.ts +14 -0
  69. package/src/api/interop/fdc3/documentationStub.js +17 -0
  70. package/src/api/interop/fdc3/fdc3-1.2.d.ts +31 -34
  71. package/src/api/interop/fdc3/fdc3-1.2.js +31 -34
  72. package/src/api/interop/fdc3/fdc3-2.0.d.ts +48 -51
  73. package/src/api/interop/fdc3/fdc3-2.0.js +48 -51
  74. package/src/api/interop/index.d.ts +8 -0
  75. package/src/api/interop/index.js +8 -0
  76. package/src/api/platform/Factory.d.ts +121 -65
  77. package/src/api/platform/Factory.js +122 -66
  78. package/src/api/platform/Instance.d.ts +551 -48
  79. package/src/api/platform/Instance.js +551 -49
  80. package/src/api/platform/index.d.ts +9 -0
  81. package/src/api/platform/index.js +9 -0
  82. package/src/api/platform/layout/Factory.d.ts +53 -76
  83. package/src/api/platform/layout/Factory.js +53 -76
  84. package/src/api/platform/layout/Instance.d.ts +158 -23
  85. package/src/api/platform/layout/Instance.js +118 -20
  86. package/src/api/platform/layout/entities/layout-entities.d.ts +222 -30
  87. package/src/api/platform/layout/entities/layout-entities.js +222 -30
  88. package/src/api/platform/layout/index.d.ts +9 -0
  89. package/src/api/platform/layout/index.js +9 -0
  90. package/src/api/platform/provider.d.ts +398 -51
  91. package/src/api/snapshot-source/Factory.d.ts +33 -18
  92. package/src/api/snapshot-source/Factory.js +33 -18
  93. package/src/api/snapshot-source/Instance.d.ts +30 -8
  94. package/src/api/snapshot-source/Instance.js +30 -8
  95. package/src/api/snapshot-source/index.d.ts +9 -0
  96. package/src/api/snapshot-source/index.js +9 -0
  97. package/src/api/system/index.d.ts +1137 -186
  98. package/src/api/system/index.js +1142 -186
  99. package/src/api/view/Factory.d.ts +54 -16
  100. package/src/api/view/Factory.js +54 -16
  101. package/src/api/view/Instance.d.ts +330 -216
  102. package/src/api/view/Instance.js +331 -217
  103. package/src/api/view/index.d.ts +9 -0
  104. package/src/api/view/index.js +9 -0
  105. package/src/api/webcontents/main.d.ts +890 -0
  106. package/src/api/webcontents/main.js +890 -0
  107. package/src/api/window/Factory.d.ts +67 -16
  108. package/src/api/window/Factory.js +67 -16
  109. package/src/api/window/Instance.d.ts +824 -316
  110. package/src/api/window/Instance.js +822 -320
  111. package/src/api/window/index.d.ts +11 -0
  112. package/src/api/window/index.js +11 -0
  113. package/src/namespaces.d.ts +1 -0
  114. package/src/namespaces.js +3 -1
  115. package/src/shapes/protocol.d.ts +4 -0
  116. package/openfin-core-33.76.31.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. Any views that were in the old layout but not the new layout
31
- * will be destroyed.
32
- * @param { LayoutConfig } layout New layout to implement in the target window.
33
- * Please see explanation of a layout {@link https://developers.openfin.co/docs/platform-api#section-layout here}.
34
- * @return { Promise<void> }
35
- * @tutorial Layout.replace
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
- * The old view is stripped of its listeners and either closed or attached to the provider window
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
- * @param { Identity } viewToReplace Identity of the view to be replaced
52
- * @param { View~options } newView Creation options of the new view.
53
- * @return { Promise<void> }
54
- * @tutorial Layout.replaceView
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 { PresetLayoutOptions } options Mandatory object with `presetType` property that sets which preset layout arrangement to use.
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
- * @return { Promise<void> }
72
- * @tutorial Layout.applyPreset
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
- * @return { Promise<LayoutConfig> }
101
- * @tutorial Layout.getConfig
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
- * @return {Promise<TabStack | ColumnOrRow>}
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
- * @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
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
- * @return {Promise<boolean>} Resolves true if this is the TabStack exists, or false if it has been destroyed.
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
- * @return {Promise<ColumnOrRow | TabStack | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link TabStack} is the root content item or does not exist.
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
- * @returns {Promise<TabStack[]>}
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 {View~options} views - List of identities or view creation options of the views to include in the stack
106
- * @param {StackCreationOptions} options - Creation options.
107
- * @returns {Promise<TabStack>} The created TabStack.
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
- * @returns {Promise<Identity[]>} Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}.
244
+ *
126
245
  * @throws If the {@link TabStack} has been destroyed.
127
- * @tutorial TabStack.getViews
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 {View~options} view The identity of an existing view to add, or options to create a view.
138
- * @param {TabStack~AddViewOptions} options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack)
139
- * @returns {Promise<identity>} Resolves with the {@link OpenFin.Identity identity} of the added view.
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
- * @tutorial TabStack.addView
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
- * @param {Identity} view - Identity of the view to remove.
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
- * @return {Promise<void>}
152
- * @tutorial TabStack.removeView
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 {Identity} view - Identity of the view to activate.
158
- * @returns {Promise<void>} Promise which resolves with void once the view has been activated.
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
- * @tutorial TabStack.setActiveView
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
- * @return {Promise<boolean>} Resolves true if this TabStack is the top level content item, or false if it is not.
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
- * @return {Promise<boolean>} Resolves true if the TabStack exists, or false if it has been destroyed.
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
- * @return {Promise<ColumnOrRow | undefined>} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link ColumnOrRow} does not exist or is the root content item.
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
- * @returns {Promise<TabStack[]>}
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 {View~options} views - List of identities or view creation options of the views to include in the stack
216
- * @param {StackCreationOptions} options - Creation options.
217
- * @returns {Promise<TabStack>} The created TabStack
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 a list of all content items belonging to this {@link ColumnOrRow} in order of appearance.
231
- * @returns {Promise<Array<ColumnOrRow | TabStack>>} Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}.
232
- * @tutorial ColumnOrRow.getContent
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
  }