@openfin/workspace-platform 4.13.0 → 4.14.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.
@@ -1,11 +1,11 @@
1
1
  /// <reference types="openfin-adapter/fin" />
2
- import type { AttachedPage, Page } from '@common/api/pages/shapes';
2
+ import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '@common/api/pages/shapes';
3
3
  export declare const getBrowserModule: (identity: OpenFin.Identity) => {
4
4
  identity: OpenFin.Identity;
5
5
  openfinWindow: import("openfin-adapter").Window;
6
6
  getPages: () => Promise<AttachedPage[]>;
7
7
  getPage: (pageId: string) => Promise<AttachedPage>;
8
- addPage: (page: Page) => Promise<void>;
8
+ addPage: (page: PageWithUpdatableRuntimeAttribs) => Promise<void>;
9
9
  removePage: (id: Page['pageId']) => Promise<void>;
10
10
  setActivePage: (id: Page['pageId']) => Promise<void>;
11
11
  updatePage: (req: any) => Promise<any>;
@@ -7,7 +7,7 @@ export declare const getBrowserApi: (identity: OpenFin.ApplicationIdentity) => {
7
7
  openfinWindow: import("openfin-adapter").Window;
8
8
  getPages: () => Promise<AttachedPage[]>;
9
9
  getPage: (pageId: string) => Promise<AttachedPage>;
10
- addPage: (page: Page) => Promise<void>;
10
+ addPage: (page: import("@common/api/pages/shapes").PageWithUpdatableRuntimeAttribs) => Promise<void>;
11
11
  removePage: (id: string) => Promise<void>;
12
12
  setActivePage: (id: string) => Promise<void>;
13
13
  updatePage: (req: any) => Promise<any>;
@@ -77,15 +77,39 @@ export interface BrowserWindowModule {
77
77
  openfinWindow: OpenFin.Window;
78
78
  /**
79
79
  * Get a page that is attached to the browser window.
80
+ *
81
+ * ```ts
82
+ * import * as WorkspacePlatform from '@client-platform/index';
83
+ *
84
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
85
+ * const windows = await workspacePlatform.Browser.getAllWindows();
86
+ * const page = await windows[0].getPage('MyPageId');
87
+ * ```
80
88
  * @param id the id of the page to get.
81
89
  */
82
90
  getPage(id: string): Promise<AttachedPage>;
83
91
  /**
84
92
  * Return all the pages that are attached to a browser window.
93
+ *
94
+ * ```ts
95
+ * import * as WorkspacePlatform from '@client-platform/index';
96
+ *
97
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
98
+ * const windows = await workspacePlatform.Browser.getAllWindows();
99
+ * const pages = await windows[0].getPages();
100
+ * ```
85
101
  */
86
102
  getPages(): Promise<AttachedPage[]>;
87
103
  /**
88
104
  * Set the active page for the browser window.
105
+ *
106
+ * ```ts
107
+ * import * as WorkspacePlatform from '@client-platform/index';
108
+ *
109
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
110
+ * const windows = await workspacePlatform.Browser.getAllWindows();
111
+ * await windows[0].setActivePage('MyPageId');
112
+ * ```
89
113
  * @param id the id of the attached page to set as active.
90
114
  */
91
115
  setActivePage(id: string): Promise<void>;
@@ -93,6 +117,35 @@ export interface BrowserWindowModule {
93
117
  * Attach a page to a browser window.
94
118
  * If a page with same id or title is attached to an existing browser window, an error will be thrown.
95
119
  *
120
+ * ```ts
121
+ * import * as WorkspacePlatform from '@client-platform/index';
122
+ *
123
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
124
+ * const layout = {
125
+ * content: [
126
+ * {
127
+ * type: 'stack',
128
+ * content: [
129
+ * {
130
+ * type: 'component',
131
+ * componentName: 'view',
132
+ * componentState: {
133
+ * name: 'myViewName',
134
+ * url: 'http://google.com'
135
+ * }
136
+ * }
137
+ * ]
138
+ * }
139
+ * ]
140
+ * };
141
+ * const page = {
142
+ * title: 'myPageTitle',
143
+ * pageId: 'myPageId',
144
+ * layout
145
+ * };
146
+ * const windows = await workspacePlatform.Browser.getAllWindows();
147
+ * await windows[0].addPage(page);
148
+ * ```
96
149
  * @param page the attach page to a browser window.
97
150
  */
98
151
  addPage(page: PageWithUpdatableRuntimeAttribs): 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.13.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.14.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"}