@openfin/workspace-platform 5.3.1 → 5.6.3
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/shapes.d.ts +279 -3
- package/client-api-platform/src/api/browser/browser-module.d.ts +2 -0
- package/client-api-platform/src/api/browser/index.d.ts +1 -0
- package/client-api-platform/src/api/context-menu/browser-logo-handler.d.ts +10 -0
- package/client-api-platform/src/api/context-menu/index.d.ts +6 -0
- package/client-api-platform/src/api/protocol.d.ts +4 -2
- package/client-api-platform/src/api/workspace-module.d.ts +1 -1
- package/client-api-platform/src/index.d.ts +11 -11
- package/client-api-platform/src/init/custom-actions.d.ts +3 -0
- package/client-api-platform/src/init/override-callback.d.ts +2 -1
- package/client-api-platform/src/init/utils.d.ts +3 -2
- package/client-api-platform/src/shapes.d.ts +154 -4
- package/common/src/api/browser-protocol.d.ts +14 -0
- package/common/src/api/pages/attached.d.ts +0 -1
- package/common/src/api/pages/legacy.d.ts +1 -1
- package/common/src/api/pages/shapes.d.ts +9 -0
- package/common/src/utils/context-menu.d.ts +12 -0
- package/common/src/utils/defer-auto-show.d.ts +18 -0
- package/common/src/utils/env.d.ts +6 -7
- package/common/src/utils/global-context-menu.d.ts +2 -0
- package/common/src/utils/landing-page.d.ts +11 -0
- package/common/src/utils/layout.d.ts +2 -1
- package/common/src/utils/merge-deep.d.ts +6 -0
- package/common/src/utils/strings.d.ts +0 -2
- package/common/src/utils/window.d.ts +4 -0
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/search-api/src/shapes.d.ts +45 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Use relative paths here rather than aliases which mess
|
|
3
|
-
* up the packaged typing files
|
|
3
|
+
* up the packaged typing files. When writing code examples,
|
|
4
|
+
* for documentation, please use async/await syntax over .then()!
|
|
4
5
|
*/
|
|
5
6
|
import type { Page } from '../../common/src/api/pages/shapes';
|
|
6
7
|
import type { Workspace } from '../../common/src/api/workspaces';
|
|
@@ -9,7 +10,7 @@ export type { Action, DispatchedSearchResult, SearchListenerRequest, SearchListe
|
|
|
9
10
|
export type { Workspace } from '../../common/src/api/workspaces';
|
|
10
11
|
export type { LayoutExtended, LayoutContentExtended, LayoutSettingsExtended, LayoutContentItemExtended, LayoutComponentExtended, LayoutComponentStateExtended, LayoutStack } from '../../common/src/utils/layout';
|
|
11
12
|
export type { Page, PageLayout, PageLayoutDetails } from '../../common/src/api/pages/shapes';
|
|
12
|
-
export { SearchTagBackground } from '../../search-api/src/
|
|
13
|
+
export { SearchTagBackground } from '../../search-api/src/shapes';
|
|
13
14
|
/**
|
|
14
15
|
* Describes the type of the app directory entry `manifest` attributes.
|
|
15
16
|
* Launch mechanics are determined by the manifest type.
|
|
@@ -241,22 +242,138 @@ export interface StorefrontProviderInfo {
|
|
|
241
242
|
export interface StorefrontProvider extends StorefrontProviderInfo {
|
|
242
243
|
/**
|
|
243
244
|
* Get a list of apps to populate the platform's Storefront with.
|
|
245
|
+
*
|
|
246
|
+
* ```ts
|
|
247
|
+
*
|
|
248
|
+
* const app : App = {
|
|
249
|
+
* appId: 'uid'
|
|
250
|
+
* title: 'My App'
|
|
251
|
+
* manifest: `https://openfin-iex.experolabs.com/openfin/manifests/cash-flow.json`,
|
|
252
|
+
* icons: [
|
|
253
|
+
* {
|
|
254
|
+
* src: '/icon.png'
|
|
255
|
+
* }
|
|
256
|
+
* ],
|
|
257
|
+
* contactEmail: contact@email.com,
|
|
258
|
+
* supportEmail: support@email.com,
|
|
259
|
+
* publisher: 'My Publisher',
|
|
260
|
+
* tags: [],
|
|
261
|
+
* images: [],
|
|
262
|
+
* intents: []
|
|
263
|
+
* }
|
|
264
|
+
*
|
|
265
|
+
* const getApps = async (): Promise<App[]> => {
|
|
266
|
+
* return [app];
|
|
267
|
+
* }
|
|
268
|
+
* ```
|
|
244
269
|
*/
|
|
245
270
|
getApps(): Promise<App[]>;
|
|
246
271
|
/**
|
|
247
272
|
* Get the main landing page for the platform's Storefront.
|
|
273
|
+
*
|
|
274
|
+
* ```ts
|
|
275
|
+
*
|
|
276
|
+
* const landingPage : StorefrontLandingPage = {
|
|
277
|
+
* hero: {
|
|
278
|
+
* title: 'My Landing Page',
|
|
279
|
+
* description: 'description',
|
|
280
|
+
* cta: navigationItems[0],
|
|
281
|
+
* image: {
|
|
282
|
+
* src: './images/image.png'
|
|
283
|
+
* }
|
|
284
|
+
* },
|
|
285
|
+
* topRow: {
|
|
286
|
+
* title: 'Top Row Title',
|
|
287
|
+
* items: //array of StorefrontNavigationItem
|
|
288
|
+
* },
|
|
289
|
+
* middleRow: {
|
|
290
|
+
* title: 'Middle Row Title',
|
|
291
|
+
* apps: //array of apps
|
|
292
|
+
* },
|
|
293
|
+
* bottomRow: {
|
|
294
|
+
* title: 'Bottom Row Title',
|
|
295
|
+
* items: //array of StorefrontNavigationItem
|
|
296
|
+
* }
|
|
297
|
+
* }
|
|
298
|
+
*
|
|
299
|
+
* const getLandingPage = async (): Promise<StorefrontLandingPage> => {
|
|
300
|
+
* return landingPage;
|
|
301
|
+
* }
|
|
302
|
+
*```
|
|
248
303
|
*/
|
|
249
304
|
getLandingPage(): Promise<StorefrontLandingPage>;
|
|
250
305
|
/**
|
|
251
306
|
* Get the Storefront navigation sections for the left nav bar.
|
|
307
|
+
* ```ts
|
|
308
|
+
* const navigationSections: [StorefrontNavigationSection, StorefrontNavigationSection] = [
|
|
309
|
+
* {
|
|
310
|
+
* id: 'first id',
|
|
311
|
+
* title: 'title',
|
|
312
|
+
* items: //array of navigation items
|
|
313
|
+
* },
|
|
314
|
+
* {
|
|
315
|
+
* id: 'second id'
|
|
316
|
+
* title: 'title',
|
|
317
|
+
* items: //array of navigation items
|
|
318
|
+
* }
|
|
319
|
+
* ]
|
|
320
|
+
*
|
|
321
|
+
* const getNavigation = async (): Promise<[StorefrontNavigationSection, StorefrontNavigationSection]> => {
|
|
322
|
+
* return navigationSections;
|
|
323
|
+
* }
|
|
324
|
+
*```
|
|
252
325
|
*/
|
|
253
326
|
getNavigation(): Promise<[StorefrontNavigationSection?, StorefrontNavigationSection?]>;
|
|
254
327
|
/**
|
|
255
328
|
* Get the footer for the platform's Storefront.
|
|
329
|
+
*
|
|
330
|
+
* ```ts
|
|
331
|
+
* const footer: StorefrontFooter = {
|
|
332
|
+
* logo: { src: './images/image', size: '32' },
|
|
333
|
+
* text: 'footer text',
|
|
334
|
+
* links: [
|
|
335
|
+
* { title:'title', url: 'https://openfin.co' },
|
|
336
|
+
* { title: 'title', url: 'https://openfin.co'}
|
|
337
|
+
* ]
|
|
338
|
+
* }
|
|
339
|
+
*
|
|
340
|
+
* const getFooter = async (): Promise<StorefrontFooter> => {
|
|
341
|
+
* return footer;
|
|
342
|
+
* }
|
|
343
|
+
* ```
|
|
256
344
|
*/
|
|
257
345
|
getFooter(): Promise<StorefrontFooter>;
|
|
258
346
|
/**
|
|
259
347
|
* Launch an app provided by the platform's Storefront.
|
|
348
|
+
*
|
|
349
|
+
* ```ts
|
|
350
|
+
* import { getStorefrontProvider } from "./my-provider";
|
|
351
|
+
*
|
|
352
|
+
* //Grab your provider
|
|
353
|
+
* const myStoreFrontProvider: StorefrontProvider = getStorefrontProvider();
|
|
354
|
+
*
|
|
355
|
+
* const app : App = {
|
|
356
|
+
* appId: 'uid'
|
|
357
|
+
* title: 'My App'
|
|
358
|
+
* manifest: `https://openfin-iex.experolabs.com/openfin/manifests/cash-flow.json`,
|
|
359
|
+
* icons: [
|
|
360
|
+
* {
|
|
361
|
+
* src: './image.png'
|
|
362
|
+
* }
|
|
363
|
+
* ],
|
|
364
|
+
* contactEmail: contact@email.com,
|
|
365
|
+
* supportEmail: support@email.com,
|
|
366
|
+
* publisher: 'My Publisher',
|
|
367
|
+
* tags: [],
|
|
368
|
+
* images: [],
|
|
369
|
+
* intents: []
|
|
370
|
+
* }
|
|
371
|
+
*
|
|
372
|
+
* const launch = async () => {
|
|
373
|
+
* await myStorefrontProvider.launchApp(app);
|
|
374
|
+
* }
|
|
375
|
+
* ```
|
|
376
|
+
* @param app the app to launch.
|
|
260
377
|
*/
|
|
261
378
|
launchApp(app: App): Promise<void>;
|
|
262
379
|
}
|
|
@@ -270,12 +387,58 @@ export interface StorefrontAPI {
|
|
|
270
387
|
* When a user selects your Storefront, the methods on the provider
|
|
271
388
|
* object are called to populate the UI. Throws an error if a provider with
|
|
272
389
|
* the same `id` already exists.
|
|
390
|
+
*
|
|
391
|
+
* ```ts
|
|
392
|
+
* import { Storefront, StorefrontProvider } from "@openfin/workspace";
|
|
393
|
+
*
|
|
394
|
+
* //Declare a provider
|
|
395
|
+
* const myStorefrontProvider: StorefrontProvider = {
|
|
396
|
+
* id: "my-storefront-id"
|
|
397
|
+
* title: "My StorefrontProvider"
|
|
398
|
+
* icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
|
|
399
|
+
* getApps: () => {...},
|
|
400
|
+
* getNavigation: () => {...},
|
|
401
|
+
* getLandingPage: () => {...},
|
|
402
|
+
* getFooter: () => {...},
|
|
403
|
+
* launchApp: () => {...}
|
|
404
|
+
* };
|
|
405
|
+
*
|
|
406
|
+
* const registerProvider = async () => {
|
|
407
|
+
* await Storefront.register(myStorefrontProvider);
|
|
408
|
+
* }
|
|
409
|
+
* ```
|
|
273
410
|
* @param provider the implementation of a Storefront provider.
|
|
274
411
|
|
|
275
412
|
*/
|
|
276
413
|
register(provider: StorefrontProvider): Promise<void>;
|
|
277
414
|
/**
|
|
278
415
|
* Deregister a provider.
|
|
416
|
+
*
|
|
417
|
+
* ```ts
|
|
418
|
+
* import { Storefront, StorefrontProvider } from "@openfin/workspace";
|
|
419
|
+
*
|
|
420
|
+
* //Instantiate a StorefrontProvider
|
|
421
|
+
* const myStorefrontProvider: StorefrontProvider = {
|
|
422
|
+
* id: "my-storefront-id"
|
|
423
|
+
* title: "My StoreFrontProvider"
|
|
424
|
+
* icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
|
|
425
|
+
* getApps: () => {...},
|
|
426
|
+
* getNavigation: () => {...},
|
|
427
|
+
* getLandingPage: () => {...},
|
|
428
|
+
* getFooter: () => {...},
|
|
429
|
+
* launchApp: () => {...}
|
|
430
|
+
* };
|
|
431
|
+
*
|
|
432
|
+
* const register = async () => {
|
|
433
|
+
* await Storefront.register(myStorefrontProvider);
|
|
434
|
+
* }
|
|
435
|
+
*
|
|
436
|
+
* //Do work with myStorefrontProvider
|
|
437
|
+
*
|
|
438
|
+
* const deregister = async () => {
|
|
439
|
+
* await Storefront.deregister("my-storefront-id");
|
|
440
|
+
* }
|
|
441
|
+
* ```
|
|
279
442
|
* @param id the id of the provider.
|
|
280
443
|
*/
|
|
281
444
|
deregister(id: string): Promise<void>;
|
|
@@ -283,12 +446,30 @@ export interface StorefrontAPI {
|
|
|
283
446
|
* Shows the Storefront window. Awaits for the latest [[`Storefront.register()`]]
|
|
284
447
|
* internally, so you don't have to. Throws an error if a [[StorefrontProvider]]
|
|
285
448
|
* doesn't exist (i.e., because `register()` not called previously).
|
|
449
|
+
*
|
|
450
|
+
* ```ts
|
|
451
|
+
* import { Storefront } from "@openfin/workspace";
|
|
452
|
+
*
|
|
453
|
+
* const show = async () => {
|
|
454
|
+
* await Storefront.show();
|
|
455
|
+
* //Do thing after show
|
|
456
|
+
* }
|
|
457
|
+
* ```
|
|
286
458
|
*/
|
|
287
459
|
show(): Promise<void>;
|
|
288
460
|
/**
|
|
289
461
|
* Hides the Storefront window. Awaits for the latest [[`Storefront.register()`]]
|
|
290
462
|
* internally, so you don't have to. Throws an error if a [[StorefrontProvider]]
|
|
291
463
|
* doesn't exist (i.e., because `register()` was not called previously).
|
|
464
|
+
*
|
|
465
|
+
* ```ts
|
|
466
|
+
* import { Storefront } from "@openfin/workspace";
|
|
467
|
+
*
|
|
468
|
+
* const hide = async () => {
|
|
469
|
+
* await Storefront.hidef();
|
|
470
|
+
* //Do thing after show
|
|
471
|
+
* }
|
|
472
|
+
* ```
|
|
292
473
|
*/
|
|
293
474
|
hide(): Promise<void>;
|
|
294
475
|
}
|
|
@@ -524,6 +705,20 @@ export declare type CLIDispatchedSearchResult = DispatchedSearchResult;
|
|
|
524
705
|
export interface CLIProvider extends SearchProvider {
|
|
525
706
|
/**
|
|
526
707
|
* Function that is called when a search request is triggered due to user input.
|
|
708
|
+
*
|
|
709
|
+
* ```ts
|
|
710
|
+
*
|
|
711
|
+
* import { getAllData, getResultsByQuery } from './get-all-data';
|
|
712
|
+
*
|
|
713
|
+
* const onUserInput = async({ query }): Promise<CLISearchResponse> => {
|
|
714
|
+
* if (!query) {
|
|
715
|
+
* return getAllData();
|
|
716
|
+
* }
|
|
717
|
+
*
|
|
718
|
+
* // Provide an implmentation to fetch query-filtered search results
|
|
719
|
+
* return getResultsByQuery(query);
|
|
720
|
+
* }
|
|
721
|
+
* ```
|
|
527
722
|
* @param req describes search request.
|
|
528
723
|
* @param res can be used to stream search results back to the requesting Workspace component.
|
|
529
724
|
* @returns an object that contains the search results to render in the requesting Workspace component.
|
|
@@ -532,6 +727,26 @@ export interface CLIProvider extends SearchProvider {
|
|
|
532
727
|
/**
|
|
533
728
|
* Callback that is invoked when ever a search result returned by this provider
|
|
534
729
|
* is interacted with from a Workspace component. (clicked, pressed enter, hotkey pressed, etc.)
|
|
730
|
+
*
|
|
731
|
+
*
|
|
732
|
+
* ```ts
|
|
733
|
+
* import { getAvailableCommands } from './my-commands';
|
|
734
|
+
*
|
|
735
|
+
* const onResultDispatch = async(result: CLIDispatchedSearchResult): Promise<void> => {
|
|
736
|
+
* try {
|
|
737
|
+
* //Grab the command corresponding to the result
|
|
738
|
+
* const availableCommands = await getAvailableCommands();
|
|
739
|
+
* const commandToExecute = availableCommands.find((command) => command.key === result.key);
|
|
740
|
+
*
|
|
741
|
+
* if (commantToExecute != undefined) {
|
|
742
|
+
* await commandToExecute.action();
|
|
743
|
+
* }
|
|
744
|
+
* } catch (err) {
|
|
745
|
+
* //Handle the error
|
|
746
|
+
* log.error('Error trying to action show command %s', err, result.key);
|
|
747
|
+
* }
|
|
748
|
+
* }
|
|
749
|
+
*```
|
|
535
750
|
* @param result the search result with the action that was selected by the user.
|
|
536
751
|
*/
|
|
537
752
|
onResultDispatch?(result: CLIDispatchedSearchResult): Promise<void>;
|
|
@@ -562,7 +777,9 @@ export interface HomeAPI {
|
|
|
562
777
|
* onUserInput: (req) => fetchMySearchResults(req.query)
|
|
563
778
|
* };
|
|
564
779
|
*
|
|
565
|
-
*
|
|
780
|
+
* const register = async () => {
|
|
781
|
+
* await Home.register(myCLIProvider);
|
|
782
|
+
* }
|
|
566
783
|
* ```
|
|
567
784
|
*
|
|
568
785
|
* @param provider the provider implementation.
|
|
@@ -570,15 +787,52 @@ export interface HomeAPI {
|
|
|
570
787
|
register(provider: HomeProvider | CLIProvider): Promise<void>;
|
|
571
788
|
/**
|
|
572
789
|
* Deregister a provider.
|
|
790
|
+
*
|
|
791
|
+
* ```ts
|
|
792
|
+
* import { Home , CLIProvider } from "@openfin/workspace";
|
|
793
|
+
*
|
|
794
|
+
* import { fetchMySearchResults } from "./my-fetch-implementation";
|
|
795
|
+
*
|
|
796
|
+
* const myCLIProvider: CLIProvider = {
|
|
797
|
+
* name: "my-cli-provider",
|
|
798
|
+
* title: "My CLI Provider",
|
|
799
|
+
* icon: "https://google.com/favicon.ico",
|
|
800
|
+
* onUserInput: (req) => fetchMySearchResults(req.query)
|
|
801
|
+
* };
|
|
802
|
+
*
|
|
803
|
+
* // Register and do some work with the provider
|
|
804
|
+
*
|
|
805
|
+
* const deregister = async () => {
|
|
806
|
+
* await Home.deregister("my-cli-provider");
|
|
807
|
+
* }
|
|
808
|
+
* ```
|
|
573
809
|
* @param providerId the name of the provider.
|
|
574
810
|
*/
|
|
575
811
|
deregister(providerId: string): Promise<void>;
|
|
576
812
|
/**
|
|
577
813
|
* Show the Home UI.
|
|
814
|
+
*
|
|
815
|
+
* ```ts
|
|
816
|
+
* import { Home } from './home'
|
|
817
|
+
*
|
|
818
|
+
* const show = async () => {
|
|
819
|
+
* await Home.show();
|
|
820
|
+
* // Do thing after show
|
|
821
|
+
* }
|
|
822
|
+
* ```
|
|
578
823
|
*/
|
|
579
824
|
show(): Promise<void>;
|
|
580
825
|
/**
|
|
581
826
|
* Hide the Home UI.
|
|
827
|
+
*
|
|
828
|
+
* ```ts
|
|
829
|
+
* import { Home } from './home'
|
|
830
|
+
*
|
|
831
|
+
* const hide = async () => {
|
|
832
|
+
* await Home.hide();
|
|
833
|
+
* // Do thing after hide
|
|
834
|
+
* }
|
|
835
|
+
* ```
|
|
582
836
|
*/
|
|
583
837
|
hide(): Promise<void>;
|
|
584
838
|
}
|
|
@@ -588,10 +842,32 @@ export interface HomeAPI {
|
|
|
588
842
|
export interface LegacyAPI {
|
|
589
843
|
/**
|
|
590
844
|
* Get the pages that a user had saved in a legacy version of Workspace. (pre 5.0.0)
|
|
845
|
+
*
|
|
846
|
+
* ```ts
|
|
847
|
+
* import { Legacy } from "@openfin/workspace";
|
|
848
|
+
*
|
|
849
|
+
* async logPages() {
|
|
850
|
+
* const pages = await Legacy.getPages();
|
|
851
|
+
* console.log(pages);
|
|
852
|
+
* }
|
|
853
|
+
*
|
|
854
|
+
* logPages();
|
|
855
|
+
* ```
|
|
591
856
|
*/
|
|
592
857
|
getPages(): Promise<Page[]>;
|
|
593
858
|
/**
|
|
594
859
|
* Get the workspaces that a user had saved in a legacy version of Workspace. (pre 5.0.0)
|
|
860
|
+
*
|
|
861
|
+
* ```ts
|
|
862
|
+
* import { Legacy } from "@openfin/workspace";
|
|
863
|
+
*
|
|
864
|
+
* async logWorkspaces() {
|
|
865
|
+
* const workspaces = await Legacy.getWorkspaces();
|
|
866
|
+
* console.log(workspaces);
|
|
867
|
+
* }
|
|
868
|
+
*
|
|
869
|
+
* logWorkspaces();
|
|
870
|
+
* ```
|
|
595
871
|
*/
|
|
596
872
|
getWorkspaces(): Promise<Workspace[]>;
|
|
597
873
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="openfin-adapter/fin" />
|
|
2
2
|
import type { AttachedPage, Page, PageWithUpdatableRuntimeAttribs } from '../../../../common/src/api/pages/shapes';
|
|
3
|
+
import { OpenGlobalContextMenuRequest } from '../../../../client-api-platform/src/shapes';
|
|
3
4
|
export declare const getBrowserModule: (identity: OpenFin.Identity) => {
|
|
4
5
|
identity: OpenFin.Identity;
|
|
5
6
|
openfinWindow: import("openfin-adapter").Window;
|
|
@@ -10,4 +11,5 @@ export declare const getBrowserModule: (identity: OpenFin.Identity) => {
|
|
|
10
11
|
setActivePage: (id: Page['pageId']) => Promise<void>;
|
|
11
12
|
updatePage: (req: any) => Promise<any>;
|
|
12
13
|
reorderPages: (req: any) => Promise<any>;
|
|
14
|
+
_openGlobalContextMenu: (req: OpenGlobalContextMenuRequest) => Promise<any>;
|
|
13
15
|
};
|
|
@@ -12,6 +12,7 @@ export declare const getBrowserApi: (identity: OpenFin.ApplicationIdentity) => {
|
|
|
12
12
|
setActivePage: (id: string) => Promise<void>;
|
|
13
13
|
updatePage: (req: any) => Promise<any>;
|
|
14
14
|
reorderPages: (req: any) => Promise<any>;
|
|
15
|
+
_openGlobalContextMenu: (req: import("../../shapes").OpenGlobalContextMenuRequest) => Promise<any>;
|
|
15
16
|
};
|
|
16
17
|
createWindow: (options: BrowserCreateWindowRequest) => Promise<BrowserWindowModule>;
|
|
17
18
|
getAllAttachedPages: () => Promise<AttachedPage[]>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NamedIdentity } from 'openfin-adapter/src/identity';
|
|
2
|
+
export declare enum MenuData {
|
|
3
|
+
NewWindow = "NEW_WINDOW",
|
|
4
|
+
NewPage = "NEW_PAGE",
|
|
5
|
+
CloseWindow = "CLOSE_WINDOW",
|
|
6
|
+
OpenStorefront = "OPEN_STOREFRONT",
|
|
7
|
+
Quit = "QUIT"
|
|
8
|
+
}
|
|
9
|
+
declare const handler: (winIdentity: NamedIdentity, data: MenuData) => Promise<void>;
|
|
10
|
+
export default handler;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NamedIdentity } from 'openfin-adapter/src/identity';
|
|
2
|
+
import { OpenGlobalContextMenuPayload, OpenGlobalContextMenuRequest } from '../../../../client-api-platform/src/shapes';
|
|
3
|
+
export declare function openGlobalContextMenuInternal(payload: OpenGlobalContextMenuRequest & {
|
|
4
|
+
identity: NamedIdentity;
|
|
5
|
+
}, callerIdentity: any): Promise<void>;
|
|
6
|
+
export declare const openGlobalContextMenu: (payload: OpenGlobalContextMenuPayload, callerIdentity: any) => Promise<void>;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* a Workspace Platform's address space.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* the value of the enum for the remote procedure in the Workspace Platform overrides and the override-callback.
|
|
8
8
|
* All of the registered channel action handlers can be found here in the platform's overrides:
|
|
9
9
|
* @see link: [Provider Protocol Handlers](https://github.com/openfin/workspace/client-api-platform/src/init/override-callback.ts)
|
|
10
10
|
*/
|
|
@@ -33,7 +33,9 @@ export declare enum ChannelAction {
|
|
|
33
33
|
GetSavedPageMetadata = "getSavedPageMetadata",
|
|
34
34
|
GetUniquePageTitle = "getUniquePageTitle",
|
|
35
35
|
GetLastFocusedBrowserWindow = "getLastFocusedBrowserWindow",
|
|
36
|
-
GetThemes = "getThemes"
|
|
36
|
+
GetThemes = "getThemes",
|
|
37
|
+
OpenGlobalContextMenuInternal = "openGlobalContextMenuInternal",
|
|
38
|
+
InvokeCustomActionInternal = "invokeCustomActionInternal"
|
|
37
39
|
}
|
|
38
40
|
/**
|
|
39
41
|
* Get a channel client for a specific Workspace platform.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="openfin-adapter/fin" />
|
|
2
|
-
import
|
|
2
|
+
import { WorkspacePlatformModule } from '../shapes';
|
|
3
3
|
export declare const getWorkspacePlatformModule: (identity: OpenFin.ApplicationIdentity) => WorkspacePlatformModule;
|
|
@@ -10,28 +10,28 @@ export * from './shapes';
|
|
|
10
10
|
* const customThemes: WorkspacePlatform.CustomThemes = [{
|
|
11
11
|
* label: "OpenFin's Custom Theme",
|
|
12
12
|
* palette: {
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
13
|
+
* // Required color options
|
|
14
|
+
* brandPrimary: '#F51F63',
|
|
15
|
+
* brandSecondary: '#1FF58A',
|
|
16
|
+
* backgroundPrimary: '#F8E71C', // hex, rgb/rgba, hsl/hsla only - no string colors: 'red'
|
|
17
17
|
* }
|
|
18
18
|
* }
|
|
19
19
|
*
|
|
20
20
|
* const overrideCallback: WorkspacePlatform.BrowserOverrideCallback = async (
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* WorkspacePlatformProvider
|
|
22
|
+
* ) => {
|
|
23
23
|
* class Override extends WorkspacePlatformProvider {
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* async quit(payload, callerIdentity) {
|
|
25
|
+
* return super.quit(payload, callerIdentity);
|
|
26
|
+
* }
|
|
27
27
|
* }
|
|
28
28
|
* return new Override();
|
|
29
29
|
* };
|
|
30
30
|
*
|
|
31
31
|
*
|
|
32
32
|
* await WorkspacePlatform.init({
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* browser: { overrideCallback },
|
|
34
|
+
* theme: customThemes
|
|
35
35
|
* });
|
|
36
36
|
* ```
|
|
37
37
|
* @param options options for configuring the platform.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/// <reference types="openfin-adapter/fin" />
|
|
2
2
|
import type { BrowserInitConfig } from '../../../client-api-platform/src/shapes';
|
|
3
|
-
|
|
3
|
+
import { WorkspacePlatformProvider } from '..';
|
|
4
|
+
export declare const getOverrideCallback: (initOptions: BrowserInitConfig) => OpenFin.OverrideCallback<WorkspacePlatformProvider>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="openfin-adapter/fin" />
|
|
2
2
|
import { Identity } from 'openfin-adapter';
|
|
3
|
+
import type { CustomThemeOptions } from '../../../common/src/api/theming';
|
|
3
4
|
import { BrowserCreateWindowRequest } from '..';
|
|
4
|
-
export declare function overrideViewOptions(options: Partial<OpenFin.ViewOptions>, initOptions: OpenFin.ViewOptions):
|
|
5
|
+
export declare function overrideViewOptions(options: Partial<OpenFin.ViewOptions>, initOptions: OpenFin.ViewOptions): any;
|
|
5
6
|
export declare function preserveInteropIfManifestConflict(opts: Partial<OpenFin.ViewOptions>, fetchManifest: ({ manifestUrl: string }: {
|
|
6
7
|
manifestUrl: any;
|
|
7
8
|
}, callerIdentity: Identity) => any, callerIdentity: Identity): Promise<any>;
|
|
@@ -40,5 +41,5 @@ export declare const initWorkspacePlatformOptions: (options: LegacyWindowOptions
|
|
|
40
41
|
* @param options - options used to handle layout settings
|
|
41
42
|
* @returns processed or unprocesseed options
|
|
42
43
|
*/
|
|
43
|
-
export declare const applyBrowserDefaults: (options: OpenFin.PlatformWindowCreationOptions, initOptions: BrowserCreateWindowRequest) => OpenFin.PlatformWindowCreationOptions;
|
|
44
|
+
export declare const applyBrowserDefaults: (options: OpenFin.PlatformWindowCreationOptions, initOptions: BrowserCreateWindowRequest, theme: CustomThemeOptions) => OpenFin.PlatformWindowCreationOptions;
|
|
44
45
|
export {};
|