@openfin/workspace-platform 4.16.0 → 4.17.0

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.
@@ -82,6 +82,7 @@ export interface BrowserWindowModule {
82
82
  * import * as WorkspacePlatform from '@openfin/workspace-platform';
83
83
  *
84
84
  * const workspacePlatform = WorkspacePlatform.getCurrentSync();
85
+ * // assume a browser window already exists
85
86
  * const windows = await workspacePlatform.Browser.getAllWindows();
86
87
  * const page = await windows[0].getPage('MyPageId');
87
88
  * ```
@@ -95,6 +96,7 @@ export interface BrowserWindowModule {
95
96
  * import * as WorkspacePlatform from '@openfin/workspace-platform';
96
97
  *
97
98
  * const workspacePlatform = WorkspacePlatform.getCurrentSync();
99
+ * // assume a browser window already exists
98
100
  * const windows = await workspacePlatform.Browser.getAllWindows();
99
101
  * const pages = await windows[0].getPages();
100
102
  * ```
@@ -107,6 +109,7 @@ export interface BrowserWindowModule {
107
109
  * import * as WorkspacePlatform from '@openfin/workspace-platform';
108
110
  *
109
111
  * const workspacePlatform = WorkspacePlatform.getCurrentSync();
112
+ * // assume a browser window already exists
110
113
  * const windows = await workspacePlatform.Browser.getAllWindows();
111
114
  * await windows[0].setActivePage('MyPageId');
112
115
  * ```
@@ -143,6 +146,7 @@ export interface BrowserWindowModule {
143
146
  * pageId: 'myPageId',
144
147
  * layout
145
148
  * };
149
+ * // assume a browser window already exists
146
150
  * const windows = await workspacePlatform.Browser.getAllWindows();
147
151
  * await windows[0].addPage(page);
148
152
  * ```
@@ -151,16 +155,69 @@ export interface BrowserWindowModule {
151
155
  addPage(page: PageWithUpdatableRuntimeAttribs): Promise<void>;
152
156
  /**
153
157
  * Remove an attached page from the browser window.
158
+ *
159
+ * ```ts
160
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
161
+ *
162
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
163
+ * // assume a browser window already exists
164
+ * const windows = await workspacePlatform.Browser.getAllWindows();
165
+ * await windows[0].removePage('myPageId');
166
+ * ```
154
167
  * @param id the id of the attached page to remove from the browser window.
155
168
  */
156
169
  removePage(id: string): Promise<void>;
157
170
  /**
158
171
  * Update a page in which is attached to the browser window.
172
+ *
173
+ * ```ts
174
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
175
+ *
176
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
177
+ * const layout = {
178
+ * content: [
179
+ * {
180
+ * type: 'stack',
181
+ * content: [
182
+ * {
183
+ * type: 'component',
184
+ * componentName: 'view',
185
+ * componentState: {
186
+ * name: 'myViewName',
187
+ * url: 'http://google.com'
188
+ * }
189
+ * }
190
+ * ]
191
+ * }
192
+ * ]
193
+ * };
194
+ * const page = {
195
+ * title: 'myPageTitle',
196
+ * pageId: 'myPageId',
197
+ * layout
198
+ * };
199
+ * // assume a browser window already exists
200
+ * const windows = await workspacePlatform.Browser.getAllWindows();
201
+ * const req = {
202
+ * pageId: 'myPageId',
203
+ * page
204
+ * };
205
+ * await windows[0].updatePage(req);
206
+ * ```
159
207
  * @param req the update request.
160
208
  */
161
209
  updatePage(req: UpdateAttachedPageRequest): Promise<void>;
162
210
  /**
163
211
  * Reorder pages attached to the browser window.
212
+ *
213
+ * ```ts
214
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
215
+ *
216
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
217
+ * // assume a browser window already exists and has three pages in it
218
+ * const windows = await workspacePlatform.Browser.getAllWindows();
219
+ * await windows[0].reorderPages(['myPageId2', 'myPageId1', 'myPageId3']);
220
+ * ```
164
221
  * @param req the reorder pages request.
165
222
  */
166
223
  reorderPages(req: ReorderPagesRequest): Promise<void>;
@@ -241,11 +298,25 @@ export interface BrowserWindowFactory {
241
298
  createWindow(options: BrowserCreateWindowRequest): Promise<BrowserWindowModule>;
242
299
  /**
243
300
  * Get a unique title for a page.
301
+ *
302
+ * ```ts
303
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
304
+ *
305
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
306
+ * const uniqueTitle = await workspacePlatform.Browser.getUniquePageTitle('myTitle');
307
+ * ```
244
308
  * @param title a prefix for the title.
245
309
  */
246
310
  getUniquePageTitle(title?: string): Promise<string>;
247
311
  /**
248
312
  * Get the identity of the last focused Browser window.
313
+ *
314
+ * ```ts
315
+ * import * as WorkspacePlatform from '@openfin/workspace-platform';
316
+ *
317
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
318
+ * const windowIdentity = await workspacePlatform.Browser.getLastFocusedWindow();
319
+ * ```
249
320
  */
250
321
  getLastFocusedWindow(): Promise<OpenFin.Identity>;
251
322
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@openfin/workspace-platform","description":"An API for creating your own Workspace platform.","contributors":[],"version":"4.16.0","main":"index.ts","scripts":{"deploy":"npm run deploy:npm && npm run deploy:docs","deploy:npm":"cd out && npm publish","deploy:docs":"aws s3 cp --recursive ./docs/ s3://cdn.openfin.co/workspace/api/platform/docs/","deploy:next":"npm run deploy:next:npm && npm run deploy:next:docs","deploy:next:npm":"cd out && npm publish --tag next","deploy:next:docs":"aws s3 cp --recursive ./docs/ s3://cdn.openfin.co/workspace/api/platform/docs/next/","cp:readme":"copyfiles README.md out","cp:package":"node ../common/scripts/cp-package.js","cp:next:package":"node ../common/scripts/cp-package-next.js","create:rootIndex":"node ../common/scripts/cp-root-index.js","package":"npm run cp:readme && npm run cp:package && npm run create:rootIndex","package:next":"npm run cp:readme && npm run cp:next:package && npm run create:rootIndex","clean":"rimraf ./out && rimraf ./docs","build:common":"cross-env ENV=prod webpack --mode=production --config ./webpack.common.config.js","build":"npm run clean && npm run build:common && npm run build:docs","build:docs":"typedoc --tsconfig ./tsconfig.json --readme none --disableSources ./src/index.ts","test":"jest --watch --colors","test:ci":"jest"},"keywords":["client","api","workspace","platform"],"license":"MIT"}
1
+ {"name":"@openfin/workspace-platform","description":"An API for creating your own Workspace platform.","contributors":[],"version":"4.17.0","main":"index.ts","scripts":{"deploy":"npm run deploy:npm && npm run deploy:docs","deploy:npm":"cd out && npm publish","deploy:docs":"aws s3 cp --recursive ./docs/ s3://cdn.openfin.co/workspace/api/platform/docs/","deploy:next":"npm run deploy:next:npm && npm run deploy:next:docs","deploy:next:npm":"cd out && npm publish --tag next","deploy:next:docs":"aws s3 cp --recursive ./docs/ s3://cdn.openfin.co/workspace/api/platform/docs/next/","cp:readme":"copyfiles README.md out","cp:package":"node ../common/scripts/cp-package.js","cp:next:package":"node ../common/scripts/cp-package-next.js","create:rootIndex":"node ../common/scripts/cp-root-index.js","package":"npm run cp:readme && npm run cp:package && npm run create:rootIndex","package:next":"npm run cp:readme && npm run cp:next:package && npm run create:rootIndex","clean":"rimraf ./out && rimraf ./docs","build:common":"cross-env ENV=prod webpack --mode=production --config ./webpack.common.config.js","build":"npm run clean && npm run build:common && npm run build:docs","build:docs":"typedoc --tsconfig ./tsconfig.json --readme none --disableSources ./src/index.ts","test":"jest --watch --colors","test:ci":"jest"},"keywords":["client","api","workspace","platform"],"license":"MIT"}