@openfin/workspace-platform 4.10.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>;
@@ -124,14 +177,65 @@ export interface BrowserWindowFactory {
124
177
  wrapSync: (identity: OpenFin.Identity) => BrowserWindowModule;
125
178
  /**
126
179
  * Get a list of all pages that are attached to any running browser window.
180
+ *
181
+ * ```ts
182
+ * import * as WorkspacePlatform from '@client-platform/index';
183
+ *
184
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
185
+ * const attachedPages = await workspacePlatform.Browser.getAllAttachedPages();
186
+ * ```
127
187
  */
128
188
  getAllAttachedPages(): Promise<AttachedPage[]>;
129
189
  /**
130
190
  * Get all the Browser Windows that are running in the Workspace Platform.
191
+ *
192
+ * ```ts
193
+ * import * as WorkspacePlatform from '@client-platform/index';
194
+ *
195
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
196
+ * const windows = await workspacePlatform.Browser.getAllWindows();
197
+ * ```
131
198
  */
132
199
  getAllWindows(): Promise<BrowserWindowModule[]>;
133
200
  /**
134
201
  * Create a new browser window.
202
+ *
203
+ * ```ts
204
+ * import * as WorkspacePlatform from '@client-platform/index';
205
+ *
206
+ * const workspacePlatform = WorkspacePlatform.getCurrentSync();
207
+ * const layout = {
208
+ * content: [
209
+ * {
210
+ * type: 'stack',
211
+ * content: [
212
+ * {
213
+ * type: 'component',
214
+ * componentName: 'view',
215
+ * componentState: {
216
+ * name: 'myViewName',
217
+ * url: 'http://google.com'
218
+ * }
219
+ * }
220
+ * ]
221
+ * }
222
+ * ]
223
+ * };
224
+ * const page = {
225
+ * title: 'myPageTitle',
226
+ * pageId: 'myPageId',
227
+ * layout
228
+ * };
229
+ * const options: BrowserCreateWindowRequest = {
230
+ * workspacePlatform {
231
+ * pages: [page],
232
+ * title: 'My Window Title',
233
+ * favicon: 'https://google.com/favicon.ico'
234
+ * }
235
+ * };
236
+ * const window = await workspacePlatform.Browser.createWindow(options);
237
+ * ```
238
+ *
135
239
  * @param options the browser window creation options
136
240
  */
137
241
  createWindow(options: BrowserCreateWindowRequest): Promise<BrowserWindowModule>;
@@ -258,8 +362,6 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
258
362
  export interface WorkspacePlatformInitConfig {
259
363
  /** Config for overriding browser options and behavior. */
260
364
  browser?: BrowserInitConfig;
261
- /** License key for Workspace Platform. */
262
- licenseKey: string;
263
365
  /** Custom Themes object */
264
366
  theme?: CustomThemes;
265
367
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@openfin/workspace-platform","description":"An API for creating your own Workspace platform.","contributors":[],"version":"4.10.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"}