@openfin/workspace 6.2.2 → 6.3.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.
- package/client-api/src/home.d.ts +2 -1
- package/client-api/src/index.d.ts +8 -5
- package/client-api/src/notifications.d.ts +13 -0
- package/client-api/src/shapes/common.d.ts +5 -0
- package/client-api/src/shapes/home.d.ts +415 -0
- package/client-api/src/shapes/index.d.ts +7 -0
- package/client-api/src/shapes/notifications.d.ts +20 -0
- package/client-api/src/shapes/store.d.ts +467 -0
- package/client-api/src/{templates.d.ts → shapes/templates.d.ts} +0 -0
- package/client-api/src/storefront.d.ts +2 -1
- package/client-api-platform/src/api/app-directory.d.ts +7 -0
- package/client-api-platform/src/api/browser/browser-module.d.ts +20 -0
- package/client-api-platform/src/api/browser/index.d.ts +26 -0
- package/client-api-platform/src/api/context-menu/browser-logo-handler.d.ts +3 -0
- package/client-api-platform/src/api/context-menu/browser-pagetab-handler.d.ts +3 -0
- package/client-api-platform/src/api/context-menu/browser-viewtab-handler.d.ts +3 -0
- package/client-api-platform/src/api/context-menu/index.d.ts +13 -0
- package/client-api-platform/src/api/index.d.ts +4 -0
- package/client-api-platform/src/api/pages/helper.d.ts +22 -0
- package/client-api-platform/src/api/pages/index.d.ts +30 -0
- package/client-api-platform/src/api/protocol.d.ts +51 -0
- package/client-api-platform/src/api/storage.d.ts +10 -0
- package/client-api-platform/src/api/theming.d.ts +5 -0
- package/client-api-platform/src/index.d.ts +3 -0
- package/client-api-platform/src/init/browser-window-focus.d.ts +19 -0
- package/client-api-platform/src/init/cleanup.d.ts +1 -0
- package/client-api-platform/src/init/custom-actions.d.ts +3 -0
- package/client-api-platform/src/init/index.d.ts +37 -0
- package/client-api-platform/src/init/override-callback.d.ts +4 -0
- package/client-api-platform/src/init/theming.d.ts +9 -0
- package/client-api-platform/src/init/utils.d.ts +33 -0
- package/client-api-platform/src/shapes.d.ts +1177 -0
- package/common/src/api/browser-protocol.d.ts +23 -0
- package/common/src/api/pages/attached.d.ts +100 -0
- package/common/src/api/pages/idb.d.ts +12 -0
- package/common/src/api/pages/legacy.d.ts +16 -0
- package/common/src/api/theming.d.ts +62 -0
- package/common/src/utils/context-menu.d.ts +12 -0
- package/common/src/utils/debounce.d.ts +16 -0
- package/common/src/utils/defer-show.d.ts +46 -0
- package/common/src/utils/global-context-menu.d.ts +3 -0
- package/common/src/utils/landing-page.d.ts +11 -0
- package/common/src/utils/merge-deep.d.ts +6 -0
- package/common/src/utils/page-tab-context-menu.d.ts +2 -0
- package/common/src/utils/route.d.ts +55 -0
- package/common/src/utils/shared-emitter.d.ts +10 -0
- package/common/src/utils/strings.d.ts +3 -0
- package/common/src/utils/theming.d.ts +57 -0
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/client-api/src/logger.d.ts +0 -1
- package/client-api/src/shapes.d.ts +0 -883
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use relative paths here rather than aliases which mess
|
|
3
|
+
* up the packaged typing files. When writing code examples,
|
|
4
|
+
* for documentation, please use async/await syntax over .then()!
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Describes the type of the app directory entry `manifest` attributes.
|
|
8
|
+
* Launch mechanics are determined by the manifest type.
|
|
9
|
+
*/
|
|
10
|
+
export declare enum AppManifestType {
|
|
11
|
+
/**
|
|
12
|
+
* A snapshot manifest.
|
|
13
|
+
*/
|
|
14
|
+
Snapshot = "snapshot",
|
|
15
|
+
/**
|
|
16
|
+
* A classic OpenFin app manifest.
|
|
17
|
+
*/
|
|
18
|
+
Manifest = "manifest",
|
|
19
|
+
/**
|
|
20
|
+
* A view manifest.
|
|
21
|
+
*/
|
|
22
|
+
View = "view",
|
|
23
|
+
/**
|
|
24
|
+
* A manifest for an external application.
|
|
25
|
+
*/
|
|
26
|
+
External = "external"
|
|
27
|
+
}
|
|
28
|
+
export interface AppIntent {
|
|
29
|
+
name: string;
|
|
30
|
+
displayName: string;
|
|
31
|
+
contexts: string[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Detailed metadata describing an image.
|
|
35
|
+
*/
|
|
36
|
+
export interface Image {
|
|
37
|
+
src: string;
|
|
38
|
+
type?: string;
|
|
39
|
+
size?: string;
|
|
40
|
+
purpose?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Detailed metadata describing an application.
|
|
44
|
+
*/
|
|
45
|
+
export interface App {
|
|
46
|
+
/**
|
|
47
|
+
* Unique identifier for an application.
|
|
48
|
+
*/
|
|
49
|
+
appId: string;
|
|
50
|
+
/**
|
|
51
|
+
* A UI friendly title for the application.
|
|
52
|
+
*/
|
|
53
|
+
title: string;
|
|
54
|
+
/**
|
|
55
|
+
* URL to application manifest.
|
|
56
|
+
*/
|
|
57
|
+
manifest: string;
|
|
58
|
+
/**
|
|
59
|
+
* UI friendly description for an application.
|
|
60
|
+
*/
|
|
61
|
+
description?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Describes the type of manifest resolved by the `manifest` field.
|
|
64
|
+
* Launch mechanics are determined by the manifest type.
|
|
65
|
+
*/
|
|
66
|
+
manifestType: AppManifestType | string;
|
|
67
|
+
/**
|
|
68
|
+
* A list of icons that can be rendered in UI for this application.
|
|
69
|
+
*/
|
|
70
|
+
icons: Image[];
|
|
71
|
+
/**
|
|
72
|
+
* A list of optional images that highlight application functionality.
|
|
73
|
+
*/
|
|
74
|
+
images?: Image[];
|
|
75
|
+
intents?: AppIntent[];
|
|
76
|
+
tags?: string[];
|
|
77
|
+
version?: string;
|
|
78
|
+
publisher: string;
|
|
79
|
+
contactEmail?: string;
|
|
80
|
+
supportEmail?: string;
|
|
81
|
+
}
|
|
82
|
+
export declare enum StorefrontTemplate {
|
|
83
|
+
LandingPage = "landingPage",
|
|
84
|
+
AppGrid = "appGrid"
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Represents a link to be rendered inside Storefront.
|
|
88
|
+
*/
|
|
89
|
+
export interface StorefrontLink {
|
|
90
|
+
/**
|
|
91
|
+
* A UI friendly title to render the link as.
|
|
92
|
+
*/
|
|
93
|
+
title: string;
|
|
94
|
+
/**
|
|
95
|
+
* When the rendered `title` text is clicked, the user will be navigated to this URL.
|
|
96
|
+
*/
|
|
97
|
+
url: string;
|
|
98
|
+
}
|
|
99
|
+
export interface StorefrontFooter {
|
|
100
|
+
/**
|
|
101
|
+
* A logo to be displayed on the Storefront's footer.
|
|
102
|
+
*/
|
|
103
|
+
logo: Image;
|
|
104
|
+
/**
|
|
105
|
+
* A set of links to display on Storefront's footer.
|
|
106
|
+
*/
|
|
107
|
+
links: [StorefrontLink?, StorefrontLink?, StorefrontLink?];
|
|
108
|
+
text: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Render a navigation section on the left panel of Storefront.
|
|
112
|
+
*/
|
|
113
|
+
export interface StorefrontNavigationSection {
|
|
114
|
+
/**
|
|
115
|
+
* Unique identifier for the navigation section.
|
|
116
|
+
*/
|
|
117
|
+
id: string;
|
|
118
|
+
/**
|
|
119
|
+
* The UI friendly title of the navigation section.
|
|
120
|
+
*/
|
|
121
|
+
title: string;
|
|
122
|
+
/**
|
|
123
|
+
* Navigation items to render under this section.
|
|
124
|
+
* 1-5 Navigation Items are supported.
|
|
125
|
+
*/
|
|
126
|
+
items: [
|
|
127
|
+
StorefrontNavigationItem,
|
|
128
|
+
StorefrontNavigationItem?,
|
|
129
|
+
StorefrontNavigationItem?,
|
|
130
|
+
StorefrontNavigationItem?,
|
|
131
|
+
StorefrontNavigationItem?
|
|
132
|
+
];
|
|
133
|
+
}
|
|
134
|
+
export interface StorefrontLandingPage {
|
|
135
|
+
hero?: {
|
|
136
|
+
title: string;
|
|
137
|
+
description: string;
|
|
138
|
+
cta: StorefrontNavigationItem;
|
|
139
|
+
image: Image;
|
|
140
|
+
};
|
|
141
|
+
topRow: {
|
|
142
|
+
title: string;
|
|
143
|
+
items: [
|
|
144
|
+
StorefrontDetailedNavigationItem?,
|
|
145
|
+
StorefrontDetailedNavigationItem?,
|
|
146
|
+
StorefrontDetailedNavigationItem?,
|
|
147
|
+
StorefrontDetailedNavigationItem?
|
|
148
|
+
];
|
|
149
|
+
};
|
|
150
|
+
middleRow: {
|
|
151
|
+
title: string;
|
|
152
|
+
apps: [App?, App?, App?, App?, App?, App?];
|
|
153
|
+
};
|
|
154
|
+
bottomRow: {
|
|
155
|
+
title: string;
|
|
156
|
+
items: [
|
|
157
|
+
StorefrontDetailedNavigationItem?,
|
|
158
|
+
StorefrontDetailedNavigationItem?,
|
|
159
|
+
StorefrontDetailedNavigationItem?
|
|
160
|
+
];
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Render a grid of applications in Storefront.
|
|
165
|
+
*/
|
|
166
|
+
export interface StorefrontAppGrid {
|
|
167
|
+
/**
|
|
168
|
+
* The apps to render in the grid.
|
|
169
|
+
*/
|
|
170
|
+
apps: App[];
|
|
171
|
+
}
|
|
172
|
+
export interface StorefrontNavigationItemBase {
|
|
173
|
+
/**
|
|
174
|
+
* An ID for referencing the navigation item. Must be unique.
|
|
175
|
+
*/
|
|
176
|
+
id: string;
|
|
177
|
+
/**
|
|
178
|
+
* UI friendly name for the navigation item.
|
|
179
|
+
*/
|
|
180
|
+
title: string;
|
|
181
|
+
}
|
|
182
|
+
export interface StorefrontNavigationItemDetails {
|
|
183
|
+
description: string;
|
|
184
|
+
image: Image;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Template for rendering a navigation item that renders a app grid when clicked.
|
|
188
|
+
*/
|
|
189
|
+
export interface StorefrontNavigationItemAppGrid extends StorefrontNavigationItemBase {
|
|
190
|
+
templateId: StorefrontTemplate.AppGrid;
|
|
191
|
+
/**
|
|
192
|
+
* Render an app grid when navigation item is pressed.
|
|
193
|
+
*/
|
|
194
|
+
templateData: StorefrontAppGrid;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Template for rendering a navigation item that renders another landing page when clicked.
|
|
198
|
+
*/
|
|
199
|
+
export interface StorefrontNavigationItemLandingPage extends StorefrontNavigationItemBase {
|
|
200
|
+
templateId: StorefrontTemplate.LandingPage;
|
|
201
|
+
/**
|
|
202
|
+
* Render a landing page when navigation item is pressed.
|
|
203
|
+
*/
|
|
204
|
+
templateData: StorefrontLandingPage;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Render an item in the navigation bar of Storefront.
|
|
208
|
+
*/
|
|
209
|
+
export declare type StorefrontNavigationItem = StorefrontNavigationItemAppGrid | StorefrontNavigationItemLandingPage;
|
|
210
|
+
/**
|
|
211
|
+
* Render an item in the navigation bar of Storefront with a description and image.
|
|
212
|
+
*/
|
|
213
|
+
export declare type StorefrontDetailedNavigationItem = StorefrontNavigationItem & StorefrontNavigationItemDetails;
|
|
214
|
+
export interface StorefrontProviderInfo {
|
|
215
|
+
/**
|
|
216
|
+
* Unique identifier for the Storefront provider.
|
|
217
|
+
*/
|
|
218
|
+
id: string;
|
|
219
|
+
/**
|
|
220
|
+
* A UI friendly title for the platform Storefront.
|
|
221
|
+
* This will be used in the Storefront selection dropdown.
|
|
222
|
+
*/
|
|
223
|
+
title: string;
|
|
224
|
+
/**
|
|
225
|
+
* Icon for storefront provider.
|
|
226
|
+
* Visible next to title in storefront provider selector UI
|
|
227
|
+
*/
|
|
228
|
+
icon: string;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Describes a Storefront provided by a platform.
|
|
232
|
+
* A platform must provide an object that satisfies this interface in order to register with the Storefront.
|
|
233
|
+
*/
|
|
234
|
+
export interface StorefrontProvider extends StorefrontProviderInfo {
|
|
235
|
+
/**
|
|
236
|
+
* Get a list of apps to populate the platform's Storefront with.
|
|
237
|
+
*
|
|
238
|
+
* ```ts
|
|
239
|
+
*
|
|
240
|
+
* const app : App = {
|
|
241
|
+
* appId: 'uid'
|
|
242
|
+
* title: 'My App'
|
|
243
|
+
* manifest: `https://openfin-iex.experolabs.com/openfin/manifests/cash-flow.json`,
|
|
244
|
+
* icons: [
|
|
245
|
+
* {
|
|
246
|
+
* src: '/icon.png'
|
|
247
|
+
* }
|
|
248
|
+
* ],
|
|
249
|
+
* contactEmail: contact@email.com,
|
|
250
|
+
* supportEmail: support@email.com,
|
|
251
|
+
* publisher: 'My Publisher',
|
|
252
|
+
* tags: [],
|
|
253
|
+
* images: [],
|
|
254
|
+
* intents: []
|
|
255
|
+
* }
|
|
256
|
+
*
|
|
257
|
+
* const getApps = async (): Promise<App[]> => {
|
|
258
|
+
* return [app];
|
|
259
|
+
* }
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
getApps(): Promise<App[]>;
|
|
263
|
+
/**
|
|
264
|
+
* Get the main landing page for the platform's Storefront.
|
|
265
|
+
*
|
|
266
|
+
* ```ts
|
|
267
|
+
*
|
|
268
|
+
* const landingPage : StorefrontLandingPage = {
|
|
269
|
+
* hero: {
|
|
270
|
+
* title: 'My Landing Page',
|
|
271
|
+
* description: 'description',
|
|
272
|
+
* cta: navigationItems[0],
|
|
273
|
+
* image: {
|
|
274
|
+
* src: './images/image.png'
|
|
275
|
+
* }
|
|
276
|
+
* },
|
|
277
|
+
* topRow: {
|
|
278
|
+
* title: 'Top Row Title',
|
|
279
|
+
* items: //array of StorefrontNavigationItem
|
|
280
|
+
* },
|
|
281
|
+
* middleRow: {
|
|
282
|
+
* title: 'Middle Row Title',
|
|
283
|
+
* apps: //array of apps
|
|
284
|
+
* },
|
|
285
|
+
* bottomRow: {
|
|
286
|
+
* title: 'Bottom Row Title',
|
|
287
|
+
* items: //array of StorefrontNavigationItem
|
|
288
|
+
* }
|
|
289
|
+
* }
|
|
290
|
+
*
|
|
291
|
+
* const getLandingPage = async (): Promise<StorefrontLandingPage> => {
|
|
292
|
+
* return landingPage;
|
|
293
|
+
* }
|
|
294
|
+
*```
|
|
295
|
+
*/
|
|
296
|
+
getLandingPage(): Promise<StorefrontLandingPage>;
|
|
297
|
+
/**
|
|
298
|
+
* Get the Storefront navigation sections for the left nav bar.
|
|
299
|
+
* ```ts
|
|
300
|
+
* const navigationSections: [StorefrontNavigationSection, StorefrontNavigationSection] = [
|
|
301
|
+
* {
|
|
302
|
+
* id: 'first id',
|
|
303
|
+
* title: 'title',
|
|
304
|
+
* items: //array of navigation items
|
|
305
|
+
* },
|
|
306
|
+
* {
|
|
307
|
+
* id: 'second id'
|
|
308
|
+
* title: 'title',
|
|
309
|
+
* items: //array of navigation items
|
|
310
|
+
* }
|
|
311
|
+
* ]
|
|
312
|
+
*
|
|
313
|
+
* const getNavigation = async (): Promise<[StorefrontNavigationSection, StorefrontNavigationSection]> => {
|
|
314
|
+
* return navigationSections;
|
|
315
|
+
* }
|
|
316
|
+
*```
|
|
317
|
+
*/
|
|
318
|
+
getNavigation(): Promise<[StorefrontNavigationSection?, StorefrontNavigationSection?]>;
|
|
319
|
+
/**
|
|
320
|
+
* Get the footer for the platform's Storefront.
|
|
321
|
+
*
|
|
322
|
+
* ```ts
|
|
323
|
+
* const footer: StorefrontFooter = {
|
|
324
|
+
* logo: { src: './images/image', size: '32' },
|
|
325
|
+
* text: 'footer text',
|
|
326
|
+
* links: [
|
|
327
|
+
* { title:'title', url: 'https://openfin.co' },
|
|
328
|
+
* { title: 'title', url: 'https://openfin.co'}
|
|
329
|
+
* ]
|
|
330
|
+
* }
|
|
331
|
+
*
|
|
332
|
+
* const getFooter = async (): Promise<StorefrontFooter> => {
|
|
333
|
+
* return footer;
|
|
334
|
+
* }
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
getFooter(): Promise<StorefrontFooter>;
|
|
338
|
+
/**
|
|
339
|
+
* Launch an app provided by the platform's Storefront.
|
|
340
|
+
*
|
|
341
|
+
* ```ts
|
|
342
|
+
* import { getStorefrontProvider } from "./my-provider";
|
|
343
|
+
*
|
|
344
|
+
* //Grab your provider
|
|
345
|
+
* const myStoreFrontProvider: StorefrontProvider = getStorefrontProvider();
|
|
346
|
+
*
|
|
347
|
+
* const app : App = {
|
|
348
|
+
* appId: 'uid'
|
|
349
|
+
* title: 'My App'
|
|
350
|
+
* manifest: `https://openfin-iex.experolabs.com/openfin/manifests/cash-flow.json`,
|
|
351
|
+
* icons: [
|
|
352
|
+
* {
|
|
353
|
+
* src: './image.png'
|
|
354
|
+
* }
|
|
355
|
+
* ],
|
|
356
|
+
* contactEmail: contact@email.com,
|
|
357
|
+
* supportEmail: support@email.com,
|
|
358
|
+
* publisher: 'My Publisher',
|
|
359
|
+
* tags: [],
|
|
360
|
+
* images: [],
|
|
361
|
+
* intents: []
|
|
362
|
+
* }
|
|
363
|
+
*
|
|
364
|
+
* const launch = async () => {
|
|
365
|
+
* await myStorefrontProvider.launchApp(app);
|
|
366
|
+
* }
|
|
367
|
+
* ```
|
|
368
|
+
* @param app the app to launch.
|
|
369
|
+
*/
|
|
370
|
+
launchApp(app: App): Promise<void>;
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Interface that contains functions for integrating with Storefront.
|
|
374
|
+
*/
|
|
375
|
+
export interface StorefrontAPI {
|
|
376
|
+
/**
|
|
377
|
+
* Registers a [[`StorefrontProvider`]]. Upon registering a provider,
|
|
378
|
+
* the title of your provider appears in the menu of the Storefront UI.
|
|
379
|
+
* When a user selects your Storefront, the methods on the provider
|
|
380
|
+
* object are called to populate the UI. Throws an error if a provider with
|
|
381
|
+
* the same `id` already exists.
|
|
382
|
+
*
|
|
383
|
+
* ```ts
|
|
384
|
+
* import { Storefront, StorefrontProvider } from "@openfin/workspace";
|
|
385
|
+
*
|
|
386
|
+
* //Declare a provider
|
|
387
|
+
* const myStorefrontProvider: StorefrontProvider = {
|
|
388
|
+
* id: "my-storefront-id"
|
|
389
|
+
* title: "My StorefrontProvider"
|
|
390
|
+
* icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
|
|
391
|
+
* getApps: () => {...},
|
|
392
|
+
* getNavigation: () => {...},
|
|
393
|
+
* getLandingPage: () => {...},
|
|
394
|
+
* getFooter: () => {...},
|
|
395
|
+
* launchApp: () => {...}
|
|
396
|
+
* };
|
|
397
|
+
*
|
|
398
|
+
* const registerProvider = async () => {
|
|
399
|
+
* await Storefront.register(myStorefrontProvider);
|
|
400
|
+
* }
|
|
401
|
+
* ```
|
|
402
|
+
* @param provider the implementation of a Storefront provider.
|
|
403
|
+
|
|
404
|
+
*/
|
|
405
|
+
register(provider: StorefrontProvider): Promise<void>;
|
|
406
|
+
/**
|
|
407
|
+
* Deregister a provider.
|
|
408
|
+
*
|
|
409
|
+
* ```ts
|
|
410
|
+
* import { Storefront, StorefrontProvider } from "@openfin/workspace";
|
|
411
|
+
*
|
|
412
|
+
* //Instantiate a StorefrontProvider
|
|
413
|
+
* const myStorefrontProvider: StorefrontProvider = {
|
|
414
|
+
* id: "my-storefront-id"
|
|
415
|
+
* title: "My StoreFrontProvider"
|
|
416
|
+
* icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
|
|
417
|
+
* getApps: () => {...},
|
|
418
|
+
* getNavigation: () => {...},
|
|
419
|
+
* getLandingPage: () => {...},
|
|
420
|
+
* getFooter: () => {...},
|
|
421
|
+
* launchApp: () => {...}
|
|
422
|
+
* };
|
|
423
|
+
*
|
|
424
|
+
* const register = async () => {
|
|
425
|
+
* await Storefront.register(myStorefrontProvider);
|
|
426
|
+
* }
|
|
427
|
+
*
|
|
428
|
+
* //Do work with myStorefrontProvider
|
|
429
|
+
*
|
|
430
|
+
* const deregister = async () => {
|
|
431
|
+
* await Storefront.deregister("my-storefront-id");
|
|
432
|
+
* }
|
|
433
|
+
* ```
|
|
434
|
+
* @param id the id of the provider.
|
|
435
|
+
*/
|
|
436
|
+
deregister(id: string): Promise<void>;
|
|
437
|
+
/**
|
|
438
|
+
* Shows the Storefront window. Awaits for the latest [[`Storefront.register()`]]
|
|
439
|
+
* internally, so you don't have to. Throws an error if a [[StorefrontProvider]]
|
|
440
|
+
* doesn't exist (i.e., because `register()` not called previously).
|
|
441
|
+
*
|
|
442
|
+
* ```ts
|
|
443
|
+
* import { Storefront } from "@openfin/workspace";
|
|
444
|
+
*
|
|
445
|
+
* const show = async () => {
|
|
446
|
+
* await Storefront.show();
|
|
447
|
+
* //Do thing after show
|
|
448
|
+
* }
|
|
449
|
+
* ```
|
|
450
|
+
*/
|
|
451
|
+
show(): Promise<void>;
|
|
452
|
+
/**
|
|
453
|
+
* Hides the Storefront window. Awaits for the latest [[`Storefront.register()`]]
|
|
454
|
+
* internally, so you don't have to. Throws an error if a [[StorefrontProvider]]
|
|
455
|
+
* doesn't exist (i.e., because `register()` was not called previously).
|
|
456
|
+
*
|
|
457
|
+
* ```ts
|
|
458
|
+
* import { Storefront } from "@openfin/workspace";
|
|
459
|
+
*
|
|
460
|
+
* const hide = async () => {
|
|
461
|
+
* await Storefront.hidef();
|
|
462
|
+
* //Do thing after show
|
|
463
|
+
* }
|
|
464
|
+
* ```
|
|
465
|
+
*/
|
|
466
|
+
hide(): Promise<void>;
|
|
467
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LaunchAppRequest } from '../shapes';
|
|
2
|
+
/**
|
|
3
|
+
* Launch the app described by an App Directory entry.
|
|
4
|
+
* @param app the app directory entry.
|
|
5
|
+
* @param opts launch options.
|
|
6
|
+
*/
|
|
7
|
+
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | import("openfin-adapter").Application | import("openfin-adapter").View | import("openfin-adapter/src/api/platform").Platform | import("openfin-adapter").Identity>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../../../common/src/api/pages/shapes';
|
|
3
|
+
import { OpenPageTabContextMenuRequest } from '../../../../client-api-platform/src/index';
|
|
4
|
+
import { OpenGlobalContextMenuRequest, OpenViewTabContextMenuRequest, ToolbarOptions, WindowStateButtonOptions } from '../../../../client-api-platform/src/shapes';
|
|
5
|
+
export declare const getBrowserModule: (identity: OpenFin.Identity) => {
|
|
6
|
+
identity: OpenFin.Identity;
|
|
7
|
+
openfinWindow: import("openfin-adapter").Window;
|
|
8
|
+
getPages: () => Promise<AttachedPage[]>;
|
|
9
|
+
getPage: (pageId: string) => Promise<AttachedPage>;
|
|
10
|
+
addPage: (page: PageWithUpdatableRuntimeAttribs) => Promise<void>;
|
|
11
|
+
removePage: (id: Page['pageId']) => Promise<void>;
|
|
12
|
+
setActivePage: (id: Page['pageId']) => Promise<void>;
|
|
13
|
+
updatePage: (req: any) => Promise<any>;
|
|
14
|
+
reorderPages: (req: any) => Promise<any>;
|
|
15
|
+
_openGlobalContextMenu: (req: OpenGlobalContextMenuRequest) => Promise<any>;
|
|
16
|
+
replaceToolbarOptions: (options: ToolbarOptions) => Promise<void>;
|
|
17
|
+
replaceWindowStateButtonOptions: (options: WindowStateButtonOptions) => Promise<void>;
|
|
18
|
+
_openViewTabContextMenu: (req: OpenViewTabContextMenuRequest) => Promise<any>;
|
|
19
|
+
_openPageTabContextMenu: (req: OpenPageTabContextMenuRequest) => Promise<any>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
import type { AttachedPage } from '../../../../common/src/api/pages/shapes';
|
|
3
|
+
import type { BrowserCreateWindowRequest, BrowserWindowModule } from '../../shapes';
|
|
4
|
+
export declare const getBrowserApi: (identity: OpenFin.ApplicationIdentity) => {
|
|
5
|
+
wrapSync: (windowIdentity: OpenFin.Identity) => {
|
|
6
|
+
identity: OpenFin.Identity;
|
|
7
|
+
openfinWindow: import("openfin-adapter").Window;
|
|
8
|
+
getPages: () => Promise<AttachedPage[]>;
|
|
9
|
+
getPage: (pageId: string) => Promise<AttachedPage>;
|
|
10
|
+
addPage: (page: import("@common/api/pages/shapes").PageWithUpdatableRuntimeAttribs) => Promise<void>;
|
|
11
|
+
removePage: (id: string) => Promise<void>;
|
|
12
|
+
setActivePage: (id: string) => Promise<void>;
|
|
13
|
+
updatePage: (req: any) => Promise<any>;
|
|
14
|
+
reorderPages: (req: any) => Promise<any>;
|
|
15
|
+
_openGlobalContextMenu: (req: import("../../shapes").OpenGlobalContextMenuRequest) => Promise<any>;
|
|
16
|
+
replaceToolbarOptions: (options: import("../../shapes").ToolbarOptions) => Promise<void>;
|
|
17
|
+
replaceWindowStateButtonOptions: (options: import("../../shapes").WindowStateButtonOptions) => Promise<void>;
|
|
18
|
+
_openViewTabContextMenu: (req: import("../../shapes").OpenViewTabContextMenuRequest) => Promise<any>;
|
|
19
|
+
_openPageTabContextMenu: (req: import("../../shapes").OpenPageTabContextMenuRequest) => Promise<any>;
|
|
20
|
+
};
|
|
21
|
+
createWindow: (options: BrowserCreateWindowRequest) => Promise<BrowserWindowModule>;
|
|
22
|
+
getAllAttachedPages: () => Promise<AttachedPage[]>;
|
|
23
|
+
getAllWindows: () => Promise<BrowserWindowModule[]>;
|
|
24
|
+
getUniquePageTitle: (title?: string) => Promise<any>;
|
|
25
|
+
getLastFocusedWindow: () => Promise<any>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { OpenPageTabContextMenuPayload } from '../../../../client-api-platform/src/index';
|
|
2
|
+
import { PageTabContextMenuItemData } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
export declare const pageTabContextMenuItemHandler: (data: PageTabContextMenuItemData, payload: OpenPageTabContextMenuPayload) => Promise<void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NamedIdentity } from 'openfin-adapter/src/identity';
|
|
2
|
+
import { OpenPageTabContextMenuPayload } from '../../../../client-api-platform/src/index';
|
|
3
|
+
import { OpenGlobalContextMenuPayload, OpenGlobalContextMenuRequest, OpenPageTabContextMenuRequest, OpenViewTabContextMenuPayload, OpenViewTabContextMenuRequest } from '../../../../client-api-platform/src/shapes';
|
|
4
|
+
export declare function openGlobalContextMenuInternal(payload: OpenGlobalContextMenuRequest & {
|
|
5
|
+
identity: NamedIdentity;
|
|
6
|
+
}, callerIdentity: any): Promise<void>;
|
|
7
|
+
export declare const openCommonContextMenu: (payload: OpenGlobalContextMenuPayload | OpenViewTabContextMenuPayload | OpenPageTabContextMenuPayload, callerIdentity: any) => Promise<void>;
|
|
8
|
+
export declare function openViewTabContextMenuInternal(payload: OpenViewTabContextMenuRequest & {
|
|
9
|
+
identity: NamedIdentity;
|
|
10
|
+
}, callerIdentity: any): Promise<void>;
|
|
11
|
+
export declare function openPageTabContextMenuInternal(payload: OpenPageTabContextMenuRequest & {
|
|
12
|
+
identity: NamedIdentity;
|
|
13
|
+
}, callerIdentity: any): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
import { SnapshotExtended } from '../../../../common/src/utils/snapshot';
|
|
3
|
+
/**
|
|
4
|
+
* Get a snapshot with pages.
|
|
5
|
+
*
|
|
6
|
+
* Makes sure that the layout of the page is up to date with the window's layout.
|
|
7
|
+
*
|
|
8
|
+
* @returns a snapshot with windows that contain pages.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getSnapshotWithPages(superGetSnapshot?: () => Promise<SnapshotExtended>): Promise<SnapshotExtended>;
|
|
11
|
+
/**
|
|
12
|
+
* Launch a snapshot that contains windows with pages.
|
|
13
|
+
*
|
|
14
|
+
* If a page with the same ID is already launched in the platform,
|
|
15
|
+
* focus and set it as the active page.
|
|
16
|
+
*
|
|
17
|
+
* If there is no page on the desktop with the same ID, launch
|
|
18
|
+
* the new window with the page.
|
|
19
|
+
*
|
|
20
|
+
* @param snapshot the snapshot to launch.
|
|
21
|
+
*/
|
|
22
|
+
export declare function applySnapshotWithPages(snapshot: OpenFin.Snapshot, superApplySnapshot?: (superSnapshot: OpenFin.Snapshot) => Promise<void>): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
import type { AttachPagesToWindowPayload } from '../../../../common/src/api/pages/shapes';
|
|
3
|
+
import type { CreateSavedPageRequest, Page, UpdateSavedPageRequest } from '../../../../client-api-platform/src/shapes';
|
|
4
|
+
/**
|
|
5
|
+
* Get all open pages in which are attached to a window.
|
|
6
|
+
* @returns the list of attached pages.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getAllAttachedPages: () => Promise<import("@client-platform/shapes").AttachedPage[]>;
|
|
9
|
+
export declare const createSavedPageInternal: ({ page }: CreateSavedPageRequest) => Promise<void>;
|
|
10
|
+
export declare const deleteSavedPageInternal: (id: string) => Promise<void>;
|
|
11
|
+
export declare const updateSavedPageInternal: ({ pageId, page }: UpdateSavedPageRequest) => Promise<any>;
|
|
12
|
+
export declare const savePage: (page: Page) => Promise<any>;
|
|
13
|
+
export declare const attachPagesToWindow: (payload: AttachPagesToWindowPayload) => Promise<void>;
|
|
14
|
+
export declare const updatePageForWindow: (payload: any) => Promise<void>;
|
|
15
|
+
export declare const detachPagesFromWindow: (payload: any) => Promise<void>;
|
|
16
|
+
export declare const setActivePage: (payload: any) => Promise<void>;
|
|
17
|
+
export declare const getPagesForWindow: (identity: OpenFin.Identity) => Promise<import("@client-platform/shapes").AttachedPage[]>;
|
|
18
|
+
export declare const getPageForWindow: ({ identity, pageId }: {
|
|
19
|
+
identity: any;
|
|
20
|
+
pageId: any;
|
|
21
|
+
}) => Promise<import("@client-platform/shapes").AttachedPage>;
|
|
22
|
+
export declare const reorderPagesForWindow: (payload: any) => Promise<void>;
|
|
23
|
+
export declare const getActivePageIdForWindow: (identity: any) => Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Checks if a given page name is unique
|
|
26
|
+
* If not, add a progressive number to it
|
|
27
|
+
* @param initialName The initial name to test
|
|
28
|
+
* @returns string: a unique page name
|
|
29
|
+
*/
|
|
30
|
+
export declare function getUniquePageTitle(initialName?: string): Promise<string>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
/**
|
|
3
|
+
* All of the remote procedures that can be called in the
|
|
4
|
+
* a Workspace Platform's address space.
|
|
5
|
+
*
|
|
6
|
+
* When adding a new channel action make sure to add a function that's name matches
|
|
7
|
+
* the value of the enum for the remote procedure in the Workspace Platform overrides and the override-callback.
|
|
8
|
+
* All of the registered channel action handlers can be found here in the platform's overrides:
|
|
9
|
+
* @see link: [Provider Protocol Handlers](https://github.com/openfin/workspace/client-api-platform/src/init/override-callback.ts)
|
|
10
|
+
*/
|
|
11
|
+
export declare enum ChannelAction {
|
|
12
|
+
LaunchApp = "launchApp",
|
|
13
|
+
SavePage = "savePage",
|
|
14
|
+
GetSavedPage = "getSavedPage",
|
|
15
|
+
CreateSavedPage = "createSavedPage",
|
|
16
|
+
UpdateSavedPage = "updateSavedPage",
|
|
17
|
+
DeleteSavedPage = "deleteSavedPage",
|
|
18
|
+
GetSavedPages = "getSavedPages",
|
|
19
|
+
CreateSavedPageInternal = "createSavedPageInternal",
|
|
20
|
+
UpdateSavedPageInternal = "updateSavedPageInternal",
|
|
21
|
+
DeleteSavedPageInternal = "deleteSavedPageInternal",
|
|
22
|
+
SharePage = "sharePage",
|
|
23
|
+
UpdatePageForWindow = "updatePageForWindow",
|
|
24
|
+
AttachPagesToWindow = "attachPagesToWindow",
|
|
25
|
+
DetachPagesFromWindow = "detachPagesFromWindow",
|
|
26
|
+
ReorderPagesForWindow = "reorderPagesForWindow",
|
|
27
|
+
SetActivePage = "setActivePage",
|
|
28
|
+
GetAllAttachedPages = "getAllAttachedPages",
|
|
29
|
+
GetActivePageIdForWindow = "getActivePageIdForWindow",
|
|
30
|
+
GetPagesForWindow = "getPagesForWindow",
|
|
31
|
+
GetPageForWindow = "getPageForWindow",
|
|
32
|
+
GetSavedPageMetadata = "getSavedPageMetadata",
|
|
33
|
+
GetUniquePageTitle = "getUniquePageTitle",
|
|
34
|
+
GetLastFocusedBrowserWindow = "getLastFocusedBrowserWindow",
|
|
35
|
+
GetThemes = "getThemes",
|
|
36
|
+
OpenGlobalContextMenuInternal = "openGlobalContextMenuInternal",
|
|
37
|
+
OpenViewTabContextMenuInternal = "openViewTabContextMenuInternal",
|
|
38
|
+
OpenPageTabContextMenuInternal = "openPageTabContextMenuInternal",
|
|
39
|
+
InvokeCustomActionInternal = "invokeCustomActionInternal"
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get a channel client for a specific Workspace platform.
|
|
43
|
+
*
|
|
44
|
+
* The channel client can execute remote procedures on the platform via its `dispatch` function.
|
|
45
|
+
* A call to the `dispatch` function will block until the channel action has concluded execution
|
|
46
|
+
* in the Workspace platform's address space.
|
|
47
|
+
* For a list of supported procedures, see the `ChannelAction` enum.
|
|
48
|
+
*
|
|
49
|
+
* @returns the channel client for the Workspace platform.
|
|
50
|
+
*/
|
|
51
|
+
export declare const getChannelClient: (identity: OpenFin.ApplicationIdentity) => Promise<import("openfin-adapter").ChannelClient>;
|