@openfin/workspace-platform 4.15.0 → 4.16.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.
|
@@ -79,7 +79,7 @@ export interface BrowserWindowModule {
|
|
|
79
79
|
* Get a page that is attached to the browser window.
|
|
80
80
|
*
|
|
81
81
|
* ```ts
|
|
82
|
-
* import * as WorkspacePlatform from '@
|
|
82
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
83
83
|
*
|
|
84
84
|
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
85
85
|
* const windows = await workspacePlatform.Browser.getAllWindows();
|
|
@@ -92,7 +92,7 @@ export interface BrowserWindowModule {
|
|
|
92
92
|
* Return all the pages that are attached to a browser window.
|
|
93
93
|
*
|
|
94
94
|
* ```ts
|
|
95
|
-
* import * as WorkspacePlatform from '@
|
|
95
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
96
96
|
*
|
|
97
97
|
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
98
98
|
* const windows = await workspacePlatform.Browser.getAllWindows();
|
|
@@ -104,7 +104,7 @@ export interface BrowserWindowModule {
|
|
|
104
104
|
* Set the active page for the browser window.
|
|
105
105
|
*
|
|
106
106
|
* ```ts
|
|
107
|
-
* import * as WorkspacePlatform from '@
|
|
107
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
108
108
|
*
|
|
109
109
|
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
110
110
|
* const windows = await workspacePlatform.Browser.getAllWindows();
|
|
@@ -118,7 +118,7 @@ export interface BrowserWindowModule {
|
|
|
118
118
|
* If a page with same id or title is attached to an existing browser window, an error will be thrown.
|
|
119
119
|
*
|
|
120
120
|
* ```ts
|
|
121
|
-
* import * as WorkspacePlatform from '@
|
|
121
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
122
122
|
*
|
|
123
123
|
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
124
124
|
* const layout = {
|
|
@@ -179,7 +179,7 @@ export interface BrowserWindowFactory {
|
|
|
179
179
|
* Get a list of all pages that are attached to any running browser window.
|
|
180
180
|
*
|
|
181
181
|
* ```ts
|
|
182
|
-
* import * as WorkspacePlatform from '@
|
|
182
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
183
183
|
*
|
|
184
184
|
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
185
185
|
* const attachedPages = await workspacePlatform.Browser.getAllAttachedPages();
|
|
@@ -190,7 +190,7 @@ export interface BrowserWindowFactory {
|
|
|
190
190
|
* Get all the Browser Windows that are running in the Workspace Platform.
|
|
191
191
|
*
|
|
192
192
|
* ```ts
|
|
193
|
-
* import * as WorkspacePlatform from '@
|
|
193
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
194
194
|
*
|
|
195
195
|
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
196
196
|
* const windows = await workspacePlatform.Browser.getAllWindows();
|
|
@@ -201,7 +201,7 @@ export interface BrowserWindowFactory {
|
|
|
201
201
|
* Create a new browser window.
|
|
202
202
|
*
|
|
203
203
|
* ```ts
|
|
204
|
-
* import * as WorkspacePlatform from '@
|
|
204
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
205
205
|
*
|
|
206
206
|
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
207
207
|
* const layout = {
|
|
@@ -255,25 +255,108 @@ export interface BrowserWindowFactory {
|
|
|
255
255
|
export interface WorkspacePlatformStorage {
|
|
256
256
|
/**
|
|
257
257
|
* Get all pages that are saved in persistent storage.
|
|
258
|
+
*
|
|
259
|
+
* ```ts
|
|
260
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
261
|
+
*
|
|
262
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
263
|
+
* const pages = await workspacePlatform.Storage.getPages();
|
|
264
|
+
* ```
|
|
258
265
|
*/
|
|
259
266
|
getPages(): Promise<Page[]>;
|
|
260
267
|
/**
|
|
261
268
|
* Get a specific page in persistent storage.
|
|
269
|
+
*
|
|
270
|
+
* ```ts
|
|
271
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
272
|
+
*
|
|
273
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
274
|
+
* const myPage = await workspacePlatform.Storage.getPage('myPageId');
|
|
275
|
+
* ```
|
|
262
276
|
* @param id the id of the page to get.
|
|
263
277
|
*/
|
|
264
278
|
getPage(id: string): Promise<Page>;
|
|
265
279
|
/**
|
|
266
280
|
* Create a page in persistent storage.
|
|
281
|
+
*
|
|
282
|
+
* ```ts
|
|
283
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
284
|
+
*
|
|
285
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
286
|
+
* const layout = {
|
|
287
|
+
* content: [
|
|
288
|
+
* {
|
|
289
|
+
* type: 'stack',
|
|
290
|
+
* content: [
|
|
291
|
+
* {
|
|
292
|
+
* type: 'component',
|
|
293
|
+
* componentName: 'view',
|
|
294
|
+
* componentState: {
|
|
295
|
+
* name: 'myViewName',
|
|
296
|
+
* url: 'http://google.com'
|
|
297
|
+
* }
|
|
298
|
+
* }
|
|
299
|
+
* ]
|
|
300
|
+
* }
|
|
301
|
+
* ]
|
|
302
|
+
* };
|
|
303
|
+
* const page = {
|
|
304
|
+
* title: 'myPageTitle',
|
|
305
|
+
* pageId: 'myPageId',
|
|
306
|
+
* layout
|
|
307
|
+
* };
|
|
308
|
+
* await workspacePlatform.Storage.createPage({page});
|
|
309
|
+
* ```
|
|
267
310
|
* @param page the page to create in persistent storage.
|
|
268
311
|
*/
|
|
269
312
|
createPage(page: CreateSavedPageRequest): Promise<void>;
|
|
270
313
|
/**
|
|
271
314
|
* Update a page in persistent storage.
|
|
315
|
+
*
|
|
316
|
+
* ```ts
|
|
317
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
318
|
+
*
|
|
319
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
320
|
+
* const layout = {
|
|
321
|
+
* content: [
|
|
322
|
+
* {
|
|
323
|
+
* type: 'stack',
|
|
324
|
+
* content: [
|
|
325
|
+
* {
|
|
326
|
+
* type: 'component',
|
|
327
|
+
* componentName: 'view',
|
|
328
|
+
* componentState: {
|
|
329
|
+
* name: 'myViewName',
|
|
330
|
+
* url: 'http://google.com'
|
|
331
|
+
* }
|
|
332
|
+
* }
|
|
333
|
+
* ]
|
|
334
|
+
* }
|
|
335
|
+
* ]
|
|
336
|
+
* };
|
|
337
|
+
* const page = {
|
|
338
|
+
* title: 'myPageTitle',
|
|
339
|
+
* pageId: 'myPageId',
|
|
340
|
+
* layout
|
|
341
|
+
* };
|
|
342
|
+
* const req = {
|
|
343
|
+
* pageId: 'myPageId',
|
|
344
|
+
* page
|
|
345
|
+
* };
|
|
346
|
+
* await workspacePlatform.Storage.updatePage(req);
|
|
347
|
+
* ```
|
|
272
348
|
* @param req the update saved page request.
|
|
273
349
|
*/
|
|
274
350
|
updatePage(req: UpdateSavedPageRequest): Promise<void>;
|
|
275
351
|
/**
|
|
276
352
|
* Delete a page from persistent storage.
|
|
353
|
+
*
|
|
354
|
+
* ```ts
|
|
355
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
356
|
+
*
|
|
357
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
358
|
+
* await workspacePlatform.Storage.deletePage('myPageId');
|
|
359
|
+
* ```
|
|
277
360
|
* @param id the id of the page to delete.
|
|
278
361
|
*/
|
|
279
362
|
deletePage(id: string): Promise<void>;
|
|
@@ -283,6 +366,35 @@ export interface WorkspacePlatformStorage {
|
|
|
283
366
|
* This is a helper function that will call `getPage` to determine if a page is already in storage.
|
|
284
367
|
* If the page is already in storage, it will call `updatePage`.
|
|
285
368
|
* If it does not exist in storage, the function will call `createPage` instead.
|
|
369
|
+
*
|
|
370
|
+
* ```ts
|
|
371
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
372
|
+
*
|
|
373
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
374
|
+
* const layout = {
|
|
375
|
+
* content: [
|
|
376
|
+
* {
|
|
377
|
+
* type: 'stack',
|
|
378
|
+
* content: [
|
|
379
|
+
* {
|
|
380
|
+
* type: 'component',
|
|
381
|
+
* componentName: 'view',
|
|
382
|
+
* componentState: {
|
|
383
|
+
* name: 'myViewName',
|
|
384
|
+
* url: 'http://google.com'
|
|
385
|
+
* }
|
|
386
|
+
* }
|
|
387
|
+
* ]
|
|
388
|
+
* }
|
|
389
|
+
* ]
|
|
390
|
+
* };
|
|
391
|
+
* const page = {
|
|
392
|
+
* title: 'myPageTitle',
|
|
393
|
+
* pageId: 'myPageId',
|
|
394
|
+
* layout
|
|
395
|
+
* };
|
|
396
|
+
* await workspacePlatform.Storage.savePage(page);
|
|
397
|
+
* ```
|
|
286
398
|
* @param page the page to save.
|
|
287
399
|
*/
|
|
288
400
|
savePage(page: Page): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@openfin/workspace-platform","description":"An API for creating your own Workspace platform.","contributors":[],"version":"4.
|
|
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"}
|