@openfin/workspace-platform 5.2.0 → 5.5.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/README.md +31 -4
- package/client-api/src/shapes.d.ts +597 -0
- package/{index.ts → client-api-platform/index.d.ts} +0 -0
- package/client-api-platform/src/api/app-directory.d.ts +7 -0
- package/client-api-platform/src/api/browser/browser-module.d.ts +13 -0
- package/client-api-platform/src/api/browser/index.d.ts +22 -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 +48 -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/api/workspace-module.d.ts +3 -0
- package/client-api-platform/src/index.d.ts +41 -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/index.d.ts +5 -0
- package/client-api-platform/src/init/override-callback.d.ts +3 -0
- package/client-api-platform/src/init/theming.d.ts +9 -0
- package/client-api-platform/src/init/utils.d.ts +45 -0
- package/client-api-platform/src/shapes.d.ts +673 -0
- package/client-api-platform/src/umd.d.ts +1 -0
- package/common/src/api/pages/attached.d.ts +101 -0
- package/common/src/api/pages/idb.d.ts +12 -0
- package/common/src/api/pages/index.d.ts +22 -0
- package/common/src/api/pages/legacy.d.ts +16 -0
- package/common/src/api/pages/shapes.d.ts +77 -0
- package/common/src/api/protocol.d.ts +64 -0
- package/common/src/api/theming.d.ts +62 -0
- package/common/src/api/workspaces/index.d.ts +7 -0
- package/common/src/utils/application.d.ts +38 -0
- package/common/src/utils/channels.d.ts +8 -0
- package/common/src/utils/debounce.d.ts +16 -0
- package/common/src/utils/defer-auto-show.d.ts +18 -0
- package/common/src/utils/env.d.ts +36 -0
- package/common/src/utils/layout.d.ts +52 -0
- package/common/src/utils/local-storage-key.d.ts +8 -0
- package/common/src/utils/logger/index.d.ts +26 -0
- package/common/src/utils/logger/manager.d.ts +35 -0
- package/common/src/utils/logger/shapes.d.ts +27 -0
- package/common/src/utils/route.d.ts +55 -0
- package/common/src/utils/shared-emitter.d.ts +10 -0
- package/common/src/utils/snapshot.d.ts +33 -0
- package/common/src/utils/strings.d.ts +5 -0
- package/common/src/utils/theming.d.ts +57 -0
- package/common/src/utils/umd.d.ts +2 -0
- package/common/src/utils/window.d.ts +150 -0
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/index.js.map +1 -0
- package/package.json +1 -34
- package/search-api/src/client/index.d.ts +6 -0
- package/search-api/src/client/internal.d.ts +38 -0
- package/search-api/src/client/remote/channel-client-factory.d.ts +2 -0
- package/search-api/src/client/remote/channel-client.d.ts +9 -0
- package/search-api/src/client/remote/data.d.ts +16 -0
- package/search-api/src/client/remote/disconnect.d.ts +7 -0
- package/search-api/src/client/remote/dispatch.d.ts +9 -0
- package/search-api/src/client/remote/requests.d.ts +5 -0
- package/search-api/src/client/remote/search-close.d.ts +14 -0
- package/search-api/src/common.d.ts +104 -0
- package/search-api/src/errors.d.ts +5 -0
- package/search-api/src/fin/index.d.ts +6 -0
- package/search-api/src/fin/shapes.d.ts +23 -0
- package/search-api/src/index.d.ts +7 -0
- package/search-api/src/internal-shapes.d.ts +134 -0
- package/search-api/src/logger.d.ts +1 -0
- package/search-api/src/provider/index.d.ts +8 -0
- package/search-api/src/provider/internal.d.ts +33 -0
- package/search-api/src/provider/remote/channel-factory.d.ts +6 -0
- package/search-api/src/provider/remote/channel.d.ts +23 -0
- package/search-api/src/provider/remote/connection.d.ts +20 -0
- package/search-api/src/provider/remote/data.d.ts +23 -0
- package/search-api/src/provider/remote/deregistration.d.ts +5 -0
- package/search-api/src/provider/remote/disconnect.d.ts +1 -0
- package/search-api/src/provider/remote/disconnection.d.ts +9 -0
- package/search-api/src/provider/remote/dispatch.d.ts +7 -0
- package/search-api/src/provider/remote/info.d.ts +5 -0
- package/search-api/src/provider/remote/registration.d.ts +23 -0
- package/search-api/src/provider/remote/search-close.d.ts +14 -0
- package/search-api/src/provider/remote/search.d.ts +8 -0
- package/search-api/src/shapes.d.ts +542 -0
- package/.eslintignore +0 -1
- package/.eslintrc.js +0 -2
- package/.prettierrc.js +0 -2
- package/babel.config.js +0 -2
- package/jest.config.js +0 -2
- package/src/api/app-directory.ts +0 -45
- package/src/api/browser/browser-module.ts +0 -65
- package/src/api/browser/index.ts +0 -46
- package/src/api/pages/helper.ts +0 -113
- package/src/api/pages/index.ts +0 -164
- package/src/api/protocol.ts +0 -60
- package/src/api/storage.ts +0 -32
- package/src/api/workspace-module.ts +0 -36
- package/src/index.ts +0 -35
- package/src/init/browser-window-focus.ts +0 -59
- package/src/init/cleanup.ts +0 -87
- package/src/init/index.ts +0 -42
- package/src/init/override-callback.ts +0 -159
- package/src/init/utils.ts +0 -164
- package/src/shapes.ts +0 -160
- package/src/umd.ts +0 -5
- package/tsconfig.json +0 -13
- package/webpack.common.config.js +0 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
import type { AttachedPage, AttachPagesToWindowPayload, DetachPagesFromWindowPayload, ReorderPagesForWindowPayload, SetActivePageForWindowPayload, UpdatePageForWindowPayload } from './shapes';
|
|
3
|
+
/**
|
|
4
|
+
* All of the remote procedures that can be called in the
|
|
5
|
+
* platform window's address space regarding attached pages.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ChannelAction {
|
|
8
|
+
GetPages = "get-pages",
|
|
9
|
+
GetActivePageForWindow = "get-active-page-for-window",
|
|
10
|
+
AttachPagesToWindow = "attach-pages-to-window",
|
|
11
|
+
DetachPagesFromWindow = "detach-pages-from-window",
|
|
12
|
+
SetActivePageForWindow = "set-active-page-for-window",
|
|
13
|
+
RenamePage = "rename-page",
|
|
14
|
+
ReorderPagesForWindow = "reorder-pages-for-window",
|
|
15
|
+
UpdatePageForWindow = "update-page-for-window",
|
|
16
|
+
UpdatePagesWindowOptions = "update-pages-window-options",
|
|
17
|
+
IsDetachingPages = "is-detaching-pages",
|
|
18
|
+
IsActivePageChanging = "is-active-page-changing"
|
|
19
|
+
}
|
|
20
|
+
export declare enum EventType {
|
|
21
|
+
AttachedPagesToWindow = "attached-pages-to-window",
|
|
22
|
+
DetachedPagesFromWindow = "detached-pages-from-window"
|
|
23
|
+
}
|
|
24
|
+
export declare const getWindowChannelId: (identity: OpenFin.Identity) => string;
|
|
25
|
+
export declare const getEventEmitter: (identity: OpenFin.Identity) => {
|
|
26
|
+
emit: (event: string | number, ...payload: any[]) => Promise<void>;
|
|
27
|
+
addListener: (event: string | number, listener: import("@common/utils/shared-emitter").Listener) => void;
|
|
28
|
+
removeListener: (event: string | number, listener: import("@common/utils/shared-emitter").Listener) => void;
|
|
29
|
+
once: (event: string | number, listener: import("@common/utils/shared-emitter").Listener) => void;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Get the pages attached to a window.
|
|
33
|
+
* @param identity the identity of the window to get the attached pages of.
|
|
34
|
+
* @returns the pages attached to the window.
|
|
35
|
+
*/
|
|
36
|
+
export declare const getPages: (identity: OpenFin.Identity) => Promise<AttachedPage[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Get the active attached page for the specified window.
|
|
39
|
+
* @param identity the window identity to get the active attached page of.
|
|
40
|
+
* @returns the active attached page for the window.
|
|
41
|
+
*/
|
|
42
|
+
export declare const getActivePageForWindow: (identity: OpenFin.Identity) => Promise<AttachedPage>;
|
|
43
|
+
/**
|
|
44
|
+
* Set the active attached page for the specified window.
|
|
45
|
+
* @param identity the window identity to set the active attached page of.
|
|
46
|
+
*/
|
|
47
|
+
export declare const setActivePageForWindow: (payload: SetActivePageForWindowPayload) => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Attach a page to an open window.
|
|
50
|
+
* If the page is already attached to a window, an error will be thrown.
|
|
51
|
+
*
|
|
52
|
+
* @param payload the attach pages to window payload.
|
|
53
|
+
*/
|
|
54
|
+
export declare const attachPagesToWindow: (payload: AttachPagesToWindowPayload) => Promise<void>;
|
|
55
|
+
/**
|
|
56
|
+
* Detach pages from the window they are currently attached to.
|
|
57
|
+
* A detached page will not have its views cleaned up.
|
|
58
|
+
*
|
|
59
|
+
* @param payload the detach pages from window payload.
|
|
60
|
+
*/
|
|
61
|
+
export declare const detachPagesFromWindow: (payload: DetachPagesFromWindowPayload) => Promise<void>;
|
|
62
|
+
export interface RenamePagePayload {
|
|
63
|
+
/** The OF window identity the page is attached to. */
|
|
64
|
+
identity: OpenFin.Identity;
|
|
65
|
+
/** The id of the page to change the name of. */
|
|
66
|
+
pageId: string;
|
|
67
|
+
/** The new title of the page. */
|
|
68
|
+
newTitle: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Rename an attached page.
|
|
72
|
+
* The page must be attached to the specified window.
|
|
73
|
+
*
|
|
74
|
+
* @param page the page to rename.
|
|
75
|
+
*/
|
|
76
|
+
export declare const renamePage: (payload: RenamePagePayload) => Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Reorder pages attached to an open window.
|
|
79
|
+
* @param payload the reorder pages for window payload.
|
|
80
|
+
*/
|
|
81
|
+
export declare const reorderPagesForWindow: (payload: ReorderPagesForWindowPayload) => Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Update a page attached to a window.
|
|
84
|
+
* @param payload the update page for window payload.
|
|
85
|
+
*/
|
|
86
|
+
export declare const updatePageForWindow: (payload: UpdatePageForWindowPayload) => Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Forces a window to save its attached page state to window options.
|
|
89
|
+
* @param identity the identity of the window to save the pages of in window options.
|
|
90
|
+
*/
|
|
91
|
+
export declare const updatePagesWindowOptions: (identity: OpenFin.Identity) => Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Check if the window identity is currently detaching pages.
|
|
94
|
+
* @param identity the OF window identity to check.
|
|
95
|
+
*/
|
|
96
|
+
export declare const isDetachingPages: (identity: OpenFin.Identity) => Promise<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* Check if the window identity is in the middle of changing active pages.
|
|
99
|
+
* @param identity the OF window identity to check.
|
|
100
|
+
*/
|
|
101
|
+
export declare const isActivePageChanging: (identity: OpenFin.Identity) => Promise<boolean>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Page } from '../../../../common/src/api/pages/shapes';
|
|
2
|
+
export declare const store: import("idb-keyval").UseStore;
|
|
3
|
+
export declare function getPage(id: string): Promise<Page>;
|
|
4
|
+
export declare function getPageList(filter?: string): Promise<Page[]>;
|
|
5
|
+
export declare function createPage({ page }: {
|
|
6
|
+
page: any;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export declare function deletePage(id: string): Promise<void>;
|
|
9
|
+
export declare function updatePage({ pageId, page }: {
|
|
10
|
+
pageId: any;
|
|
11
|
+
page: any;
|
|
12
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LayoutExtended } from '../../../../common/src/utils/layout';
|
|
2
|
+
import type { AttachedPage, Page, PageLayout, PageWithUpdatableRuntimeAttribs } from './shapes';
|
|
3
|
+
export declare function getLegacyPages(): Promise<Page[]>;
|
|
4
|
+
export declare function cleanPage(page: AttachedPage): Page;
|
|
5
|
+
/**
|
|
6
|
+
* Get a page layout.
|
|
7
|
+
* @param layout the layout to add details to.
|
|
8
|
+
* @returns the layout with extra details.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getPageLayout: (layout: any) => Promise<PageLayout>;
|
|
11
|
+
/**
|
|
12
|
+
* Generates a Page object which represents a page.
|
|
13
|
+
* @param title the title for the page.
|
|
14
|
+
* @param layout the layout for the page.
|
|
15
|
+
*/
|
|
16
|
+
export declare const makePage: (title: string, layout: LayoutExtended) => Promise<PageWithUpdatableRuntimeAttribs>;
|
|
17
|
+
/**
|
|
18
|
+
* Clone a page.
|
|
19
|
+
* @param page the page to clone.
|
|
20
|
+
* @returns a clone of the given page.
|
|
21
|
+
*/
|
|
22
|
+
export declare const clonePage: (page: Page) => Promise<PageWithUpdatableRuntimeAttribs>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AttachedPage, PageLayout } from '../../../../common/src/api/pages/shapes';
|
|
2
|
+
interface Workstack {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
isReadOnly: boolean;
|
|
6
|
+
layout: PageLayout;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function convertWorkstackToAttachedPage(workstack: Workstack & AttachedPage): AttachedPage;
|
|
10
|
+
/**
|
|
11
|
+
* Attempts to fix any misconfigurations in a list of attached pages.
|
|
12
|
+
* @param pages the pages to fix.
|
|
13
|
+
* @returns the fixed pages.
|
|
14
|
+
*/
|
|
15
|
+
export declare const fixAttachedPages: (pages: AttachedPage[]) => AttachedPage[];
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
import type { LayoutExtended } from '../../utils/layout';
|
|
3
|
+
export interface PageLayoutDetails {
|
|
4
|
+
/** The id of the machine that created the page. */
|
|
5
|
+
machineId: string;
|
|
6
|
+
/** The name of the machine that created the page. */
|
|
7
|
+
machineName?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare type PageLayout = LayoutExtended & {
|
|
10
|
+
layoutDetails?: PageLayoutDetails;
|
|
11
|
+
};
|
|
12
|
+
export interface Page {
|
|
13
|
+
/** A UI friendly title for the page. */
|
|
14
|
+
title: string;
|
|
15
|
+
/** The unique ID of the page. */
|
|
16
|
+
pageId: string;
|
|
17
|
+
/** An optional UI friendly description of the page. */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** A optional UI friendly tooltip for the page. */
|
|
20
|
+
tooltip?: string;
|
|
21
|
+
/** True if the page is read only. In this state, the page is locked and cannot be unlocked. */
|
|
22
|
+
isReadOnly?: boolean;
|
|
23
|
+
/** The layout of the page. */
|
|
24
|
+
layout: PageLayout;
|
|
25
|
+
}
|
|
26
|
+
declare type AttachedPageMetadata = {
|
|
27
|
+
/** The window the page is currently attached to. */
|
|
28
|
+
parentIdentity?: OpenFin.Identity;
|
|
29
|
+
/** True if the page is the currently active page for its parent window. */
|
|
30
|
+
isActive?: boolean;
|
|
31
|
+
/** True if the page has unsaved changes. */
|
|
32
|
+
hasUnsavedChanges?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare type AttachedPage = Page & AttachedPageMetadata;
|
|
35
|
+
export declare type PageWithUpdatableRuntimeAttribs = Page & Pick<AttachedPage, 'hasUnsavedChanges'>;
|
|
36
|
+
export interface DetachPagesFromWindowPayload {
|
|
37
|
+
/** The OF window identity to detach the pages from. */
|
|
38
|
+
identity: OpenFin.Identity;
|
|
39
|
+
/** The ids of the pages to detach. */
|
|
40
|
+
pageIds: string[];
|
|
41
|
+
}
|
|
42
|
+
export interface SetActivePageForWindowPayload {
|
|
43
|
+
/** The OF window identity to set the active page of. */
|
|
44
|
+
identity: OpenFin.Identity;
|
|
45
|
+
/**
|
|
46
|
+
* The id of the page to set as active.
|
|
47
|
+
* The page must be attached to the target window.
|
|
48
|
+
*/
|
|
49
|
+
pageId: string;
|
|
50
|
+
}
|
|
51
|
+
export interface ReorderPagesForWindowPayload {
|
|
52
|
+
/** The OF window identity the pages to change the order of. */
|
|
53
|
+
identity: OpenFin.Identity;
|
|
54
|
+
/** The ordered ids of the attached pages. */
|
|
55
|
+
pageIds: string[];
|
|
56
|
+
}
|
|
57
|
+
export interface UpdatePageForWindowPayload {
|
|
58
|
+
/** The OF window identity the pages to change the order of. */
|
|
59
|
+
identity: OpenFin.Identity;
|
|
60
|
+
/** The id of the attached page to update. */
|
|
61
|
+
pageId: string;
|
|
62
|
+
/** The partial updated state of the page. */
|
|
63
|
+
page: Partial<PageWithUpdatableRuntimeAttribs>;
|
|
64
|
+
}
|
|
65
|
+
export interface AttachPagesToWindowPayload {
|
|
66
|
+
/** The OF window identity to attach the pages to. */
|
|
67
|
+
identity: OpenFin.Identity;
|
|
68
|
+
/** The pages to attach. */
|
|
69
|
+
pages: PageWithUpdatableRuntimeAttribs[];
|
|
70
|
+
}
|
|
71
|
+
export interface GetSavedPageMetadataPayload {
|
|
72
|
+
/** The OF window identity to attach the pages to. */
|
|
73
|
+
identity: OpenFin.Identity;
|
|
74
|
+
/** The id of the page to get the save state of. */
|
|
75
|
+
pageId: string;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
/** The name of the channel for the centralized workspace protocol. */
|
|
3
|
+
export declare const channelName = "__of_workspace_protocol__";
|
|
4
|
+
/**
|
|
5
|
+
* All of the remote procedures that can be called in the
|
|
6
|
+
* Workspace Provider's address space.
|
|
7
|
+
*
|
|
8
|
+
* When adding a new channel action make sure to register a
|
|
9
|
+
* handler for the remote procedure in the Workspace Provider.
|
|
10
|
+
* All of the registered channel action handlers can be found here:
|
|
11
|
+
* @see link: [Provider Protocol Handlers](https://github.com/openfin/workspace/provider/src/api/protocol.ts)
|
|
12
|
+
*/
|
|
13
|
+
export declare enum ChannelAction {
|
|
14
|
+
RegisterStorefrontProvider = "register-storefront-provider",
|
|
15
|
+
DeregisterStorefrontProvider = "deregister-storefront-provider",
|
|
16
|
+
GetStorefrontProviders = "get-storefront-providers",
|
|
17
|
+
HideStorefront = "hide-storefront",
|
|
18
|
+
GetStorefrontProviderApps = "get-storefront-provider-apps",
|
|
19
|
+
GetStorefrontProviderLandingPage = "get-storefront-provider-landing-page",
|
|
20
|
+
GetStorefrontProviderFooter = "get-storefront-provider-footer",
|
|
21
|
+
GetStorefrontProviderNavigation = "get-storefront-provider-navigation",
|
|
22
|
+
LaunchStorefrontProviderApp = "launch-storefront-provider-app",
|
|
23
|
+
ShowStorefront = "show-storefront",
|
|
24
|
+
CreateStorefrontWindow = "create-storefront-window",
|
|
25
|
+
ShowHome = "show-home",
|
|
26
|
+
HideHome = "hide-home",
|
|
27
|
+
AssignHomeSearchContext = "assign-home-search-context",
|
|
28
|
+
GetLegacyPages = "get-legacy-pages",
|
|
29
|
+
GetLegacyWorkspaces = "get-legacy-workspaces",
|
|
30
|
+
GetComputedPlatformTheme = "get-computed-platform-theme"
|
|
31
|
+
}
|
|
32
|
+
export interface ChannelClient extends OpenFin.ChannelClient {
|
|
33
|
+
dispatch: (action: ChannelAction, payload: any) => Promise<any>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Get a channel client for the centralized Workspace protocol.
|
|
37
|
+
*
|
|
38
|
+
* The channel client is automatically connected to the Workspace Provider,
|
|
39
|
+
* in which acts as a centralized location for executing Workspace API logic.
|
|
40
|
+
*
|
|
41
|
+
* The channel client can execute remote procedures on the provider via its `dispatch` function.
|
|
42
|
+
* A call to the `dispatch` function will block until the channel action has concluded execution
|
|
43
|
+
* in the Workspace Provider's address space.
|
|
44
|
+
* For a list of supported procedures, see the `ChannelAction` enum.
|
|
45
|
+
*
|
|
46
|
+
* @returns the channel client for the centralized workspace protocol.
|
|
47
|
+
*/
|
|
48
|
+
export declare const getChannelClient: () => Promise<ChannelClient>;
|
|
49
|
+
/**
|
|
50
|
+
* Returns true if the current application was launched via a library (such as the Client APIs).
|
|
51
|
+
* Otherwise, returns false.
|
|
52
|
+
*/
|
|
53
|
+
export declare const isLaunchedViaLib: () => Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Launches the Workspace Provider.
|
|
56
|
+
* If the Workspace Provider is already running, does nothing.
|
|
57
|
+
*/
|
|
58
|
+
export declare const launchProvider: () => Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Launches the Workspace provider if it is not running.
|
|
61
|
+
* Then gets a Channel Client that is connected to the Workspace Provider.
|
|
62
|
+
* @returns the Channel Client that is connected to the Workspace Provider.
|
|
63
|
+
*/
|
|
64
|
+
export declare const getChannelClientAndLaunchProvider: () => Promise<ChannelClient>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
import type { ThemePaletteSet } from '@openfin/ui-library';
|
|
3
|
+
export interface ComputedThemes extends Array<ComputedTheme> {
|
|
4
|
+
}
|
|
5
|
+
export interface ComputedTheme {
|
|
6
|
+
label: string;
|
|
7
|
+
logoUrl?: string;
|
|
8
|
+
theme: ThemePaletteSet;
|
|
9
|
+
}
|
|
10
|
+
export interface CustomThemes extends Array<CustomThemeOptions> {
|
|
11
|
+
}
|
|
12
|
+
export interface CustomThemeOptions {
|
|
13
|
+
label: string;
|
|
14
|
+
logoUrl?: string;
|
|
15
|
+
palette: CustomPaletteSet;
|
|
16
|
+
}
|
|
17
|
+
export interface DefaultPaletteSet {
|
|
18
|
+
brandPrimary: string;
|
|
19
|
+
brandSecondary: string;
|
|
20
|
+
backgroundPrimary: string;
|
|
21
|
+
}
|
|
22
|
+
export interface CustomPaletteSet extends DefaultPaletteSet {
|
|
23
|
+
functional1?: string;
|
|
24
|
+
functional2?: string;
|
|
25
|
+
functional3?: string;
|
|
26
|
+
functional4?: string;
|
|
27
|
+
functional5?: string;
|
|
28
|
+
functional6?: string;
|
|
29
|
+
functional7?: string;
|
|
30
|
+
functional8?: string;
|
|
31
|
+
functional9?: string;
|
|
32
|
+
functional10?: string;
|
|
33
|
+
statusSuccess?: string;
|
|
34
|
+
statusWarning?: string;
|
|
35
|
+
statusCritical?: string;
|
|
36
|
+
statusActive?: string;
|
|
37
|
+
inputBackground?: string;
|
|
38
|
+
inputColor?: string;
|
|
39
|
+
inputPlaceholder?: string;
|
|
40
|
+
inputDisabled?: string;
|
|
41
|
+
inputFocused?: string;
|
|
42
|
+
textDefault?: string;
|
|
43
|
+
textHelp?: string;
|
|
44
|
+
textInactive?: string;
|
|
45
|
+
background1?: string;
|
|
46
|
+
background2?: string;
|
|
47
|
+
background3?: string;
|
|
48
|
+
background4?: string;
|
|
49
|
+
background5?: string;
|
|
50
|
+
background6?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* computeThemes()
|
|
54
|
+
* Accepts the array of registered CustomThemes objects
|
|
55
|
+
* Creates a light and dark palette from a tempalte overriding with custom options
|
|
56
|
+
* Uses createTheme to build theme object
|
|
57
|
+
* Creates a ThemePaletteSet
|
|
58
|
+
* @param customPalettes
|
|
59
|
+
* @returns theme object ready to be applied to the UI
|
|
60
|
+
*/
|
|
61
|
+
export declare const computeThemes: (customPalettes: CustomThemes) => ComputedThemes;
|
|
62
|
+
export declare const getComputedPlatformTheme: (platformIdentity: OpenFin.Identity) => Promise<ComputedTheme>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
export declare enum ApplicationUUID {
|
|
3
|
+
/**
|
|
4
|
+
* The UUID of workspace.
|
|
5
|
+
* Home is a part of this application.
|
|
6
|
+
*/
|
|
7
|
+
Workspace = "openfin-browser"
|
|
8
|
+
}
|
|
9
|
+
export interface ApplicationEvent {
|
|
10
|
+
viewIdentity?: OpenFin.Identity;
|
|
11
|
+
name?: string;
|
|
12
|
+
uuid?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare type ApplicationListener = (ev: ApplicationEvent) => void;
|
|
15
|
+
export declare enum ApplicationEventType {
|
|
16
|
+
RunRequested = "run-requested",
|
|
17
|
+
WindowOptionsChanged = "window-options-changed",
|
|
18
|
+
WindowClosed = "window-closed",
|
|
19
|
+
WindowCreated = "window-created"
|
|
20
|
+
}
|
|
21
|
+
export declare enum LaunchModeType {
|
|
22
|
+
FinProtocol = "fin-protocol"
|
|
23
|
+
}
|
|
24
|
+
export declare type ApplicationInfoExtended = OpenFin.ApplicationInfo & {
|
|
25
|
+
initialOptions: OpenFin.ApplicationInfo['initialOptions'] & {
|
|
26
|
+
userAppConfigArgs: any;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare const currentOFAppIdentity: {
|
|
30
|
+
uuid: string;
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const workspaceOFAppIdentity: {
|
|
34
|
+
name: ApplicationUUID;
|
|
35
|
+
uuid: ApplicationUUID;
|
|
36
|
+
};
|
|
37
|
+
export declare const getCurrentOFApplication: () => import("openfin-adapter").Application;
|
|
38
|
+
export declare const getWorkspaceOFApplication: () => import("openfin-adapter").Application;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make a function that connects to a channel.
|
|
3
|
+
* If already connected to the channel, will return the channel connection.
|
|
4
|
+
* If disconnected from the channel, will automatically reconnect.
|
|
5
|
+
* @param channelName the name of the channel to connect to.
|
|
6
|
+
* @returns the function to connect to the channel.
|
|
7
|
+
*/
|
|
8
|
+
export default function makeGetChannelClient(channelName: string): () => Promise<import("openfin-adapter").ChannelClient>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const makeDebouncedFunc: <T extends (...args: any[]) => Promise<any>>(func: T, debounceTimeout?: number) => T;
|
|
2
|
+
/**
|
|
3
|
+
* Debounce a specified function.
|
|
4
|
+
*
|
|
5
|
+
* When the debounced function is called, the underlying wrapped function
|
|
6
|
+
* will be called.
|
|
7
|
+
*
|
|
8
|
+
* If the function is called again while the promise returned by the wrapped
|
|
9
|
+
* function is still resolving, the call will be blocked until the promise has
|
|
10
|
+
* resolved.
|
|
11
|
+
*
|
|
12
|
+
* Once the promise has been resolved, the wrapped function will be called again
|
|
13
|
+
* after a specified debounce timeout.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export default makeDebouncedFunc;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
interface InternalWindowOptions extends OpenFin.PlatformWindowCreationOptions {
|
|
3
|
+
workspacePlatform: OpenFin.WindowOptions['workspacePlatform'] & {
|
|
4
|
+
_internalAutoShow: boolean;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Apply options to a window's options that will disallow the Core from auto showing the window.
|
|
9
|
+
* Instead, a script within the window itself must handle showing the window if deferred auto showing is enabled.
|
|
10
|
+
* When it comes time to show the window, the script can auto show if deferred by simply calling the `autoShowIfDeferred` function.
|
|
11
|
+
* @param opts the window options to apply deferred auto show to.
|
|
12
|
+
*/
|
|
13
|
+
export declare function applyDeferAutoShowOptions(opts: OpenFin.PlatformWindowCreationOptions): InternalWindowOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Will show the current window if deferred auto show is enabled.
|
|
16
|
+
*/
|
|
17
|
+
export declare function autoShowIfDeferred(): Promise<void>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare enum Env {
|
|
2
|
+
Local = "local",
|
|
3
|
+
Dev = "dev",
|
|
4
|
+
Staging = "staging",
|
|
5
|
+
Prod = "prod"
|
|
6
|
+
}
|
|
7
|
+
export declare const isFin: boolean;
|
|
8
|
+
export declare const isJest: boolean;
|
|
9
|
+
export declare const isWindowDefined: boolean;
|
|
10
|
+
export declare const isDocumentDefined: boolean;
|
|
11
|
+
export declare const isWindowDefinedWithIndexDB: boolean;
|
|
12
|
+
export declare const finUUID: string;
|
|
13
|
+
export declare const finName: string;
|
|
14
|
+
export declare const finEntityType: "" | import("openfin-adapter/src/shapes/EntityType").EntityType;
|
|
15
|
+
export declare const env: Env;
|
|
16
|
+
export declare const isEnvLocal: boolean;
|
|
17
|
+
export declare const isEnvDev: boolean;
|
|
18
|
+
export declare const isEnvStaging: boolean;
|
|
19
|
+
export declare const isEnvProd: boolean;
|
|
20
|
+
export declare const isLibrary: boolean;
|
|
21
|
+
export declare const workspaceProviderFinsLink: string;
|
|
22
|
+
export declare const workspaceProviderFallbackUrl: string;
|
|
23
|
+
export declare const workspaceAppsUrl: string;
|
|
24
|
+
export declare const workspaceStorefrontFooterUrl: string;
|
|
25
|
+
export declare const workspaceStorefrontLandingPageUrl: string;
|
|
26
|
+
export declare const workspaceStorefrontNavigationUrl: string;
|
|
27
|
+
export declare const workspaceShareUrl: string;
|
|
28
|
+
export declare const workspaceCdnUrl: string;
|
|
29
|
+
export declare const workspaceCdnEnvUrl: string;
|
|
30
|
+
export declare const workspaceRuntimeVersion: string;
|
|
31
|
+
/**
|
|
32
|
+
* A promise that resolves when:
|
|
33
|
+
* - The window 'load' event is fired.
|
|
34
|
+
* - The window first paint occurs.
|
|
35
|
+
*/
|
|
36
|
+
export declare const firstPaint: Promise<void>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
export declare type LayoutComponentStateExtended = OpenFin.LayoutComponent['componentState'] & {
|
|
3
|
+
name: string;
|
|
4
|
+
uuid: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type LayoutComponentExtended = Omit<OpenFin.LayoutComponent, 'componentState'> & {
|
|
7
|
+
componentState: LayoutComponentStateExtended;
|
|
8
|
+
};
|
|
9
|
+
export declare type LayoutStack = {
|
|
10
|
+
type: 'stack';
|
|
11
|
+
content: OpenFin.LayoutContent;
|
|
12
|
+
};
|
|
13
|
+
export declare type LayoutContentItemExtended = OpenFin.LayoutRow | OpenFin.LayoutColumn | LayoutComponentExtended | LayoutStack;
|
|
14
|
+
export declare type LayoutContentExtended = LayoutContentItemExtended[];
|
|
15
|
+
export declare type LayoutSettingsExtended = OpenFin.LayoutOptions['settings'] & {
|
|
16
|
+
reorderEnabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare type LayoutExtended = {
|
|
19
|
+
settings?: LayoutSettingsExtended;
|
|
20
|
+
content: LayoutContentExtended;
|
|
21
|
+
};
|
|
22
|
+
export declare enum LayoutDOMEventType {
|
|
23
|
+
TabCreated = "tab-created",
|
|
24
|
+
ContainerCreated = "container-created",
|
|
25
|
+
ContainerResized = "container-resized"
|
|
26
|
+
}
|
|
27
|
+
export interface LayoutDOMEvent {
|
|
28
|
+
type: LayoutDOMEventType;
|
|
29
|
+
detail: {
|
|
30
|
+
containerSelector: string;
|
|
31
|
+
tabSelector: string;
|
|
32
|
+
};
|
|
33
|
+
isInitialized: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare type LayoutDOMEventListener = (ev: LayoutDOMEvent) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Deep clones a layout and removes view names.
|
|
38
|
+
* @param layout The Layout to be cloned
|
|
39
|
+
* @returns A copy of the layout with names removed
|
|
40
|
+
*/
|
|
41
|
+
export declare const cloneLayoutAndRemoveNames: (layout: any) => any;
|
|
42
|
+
export declare const mapContentComponentState: (content: OpenFin.LayoutContent | LayoutContentExtended) => LayoutComponentStateExtended[];
|
|
43
|
+
export declare const getLayoutWithSingleView: (title: string, url: string) => Promise<any>;
|
|
44
|
+
export declare const isLayoutTabActive: (tabSelector: string) => boolean;
|
|
45
|
+
export declare const containerId = "layout_container";
|
|
46
|
+
export declare const getViewComponents: () => LayoutContentExtended;
|
|
47
|
+
export declare const removeLayoutView: (name: string) => Promise<void>;
|
|
48
|
+
export declare const addLayoutEventListener: (event: LayoutDOMEventType, listener: LayoutDOMEventListener) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Initialize the layout for the current OF window.
|
|
51
|
+
*/
|
|
52
|
+
export declare const initLayout: () => Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare enum LocalStorageKey {
|
|
2
|
+
LastLaunchedWorkspaceId = "activeWorkspaceId",
|
|
3
|
+
LastFocusedBrowserWindow = "lastFocusedBrowserWindow",
|
|
4
|
+
MachineName = "machineName",
|
|
5
|
+
NewTabPageLayout = "NewTabPageLayout",
|
|
6
|
+
NewTabPageSort = "NewTabPageSort"
|
|
7
|
+
}
|
|
8
|
+
export default LocalStorageKey;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LogLocal } from './shapes';
|
|
2
|
+
/**
|
|
3
|
+
* Responsible of capturing log information locally and centrally alongside the logs of other windows/views.
|
|
4
|
+
*
|
|
5
|
+
* **Warning: if you don't specify a name then it will still log out your messages but it becomes harder to distinguish where the log entry came from**
|
|
6
|
+
*
|
|
7
|
+
* Basic usage example:
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import logger from '../utils/logger';
|
|
11
|
+
* const log = logger("My Component");
|
|
12
|
+
*
|
|
13
|
+
* log.info("Initialised.");
|
|
14
|
+
* ```
|
|
15
|
+
* More information can be found [here](https://github.com/openfin/browser/blob/main/docs/Logging.md)
|
|
16
|
+
* @param name Specify a name for this logger that will be the prefix of all log messages.
|
|
17
|
+
* @param logLocal Specify an object to say what loglevel should be logged to the local window console e.g. { info: true }.
|
|
18
|
+
*/
|
|
19
|
+
export default function logger(name?: string, logLocal?: LogLocal): {
|
|
20
|
+
trace: (message: string, ...args: any[]) => void;
|
|
21
|
+
debug: (message: string, ...args: any[]) => void;
|
|
22
|
+
info: (message: string, ...args: any[]) => void;
|
|
23
|
+
warn: (message: string, ...args: any[]) => void;
|
|
24
|
+
error: (message: string, error?: any, ...args: any[]) => void;
|
|
25
|
+
fatal: (message: string, error?: any, ...args: any[]) => void;
|
|
26
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { LogEntry, LogOptions } from './shapes';
|
|
2
|
+
declare class LogInterface {
|
|
3
|
+
private worker;
|
|
4
|
+
private name;
|
|
5
|
+
private requestResponseHandler;
|
|
6
|
+
private errorListeners;
|
|
7
|
+
constructor();
|
|
8
|
+
getLogs(fromId?: number): Promise<LogEntry[]>;
|
|
9
|
+
trace(message: string, sourceName?: string, args?: any[]): void;
|
|
10
|
+
debug(message: string, sourceName?: string, args?: any[]): void;
|
|
11
|
+
info(message: string, sourceName?: string, args?: any[]): void;
|
|
12
|
+
warn(message: string, sourceName?: string, args?: any[]): void;
|
|
13
|
+
error(message: string, error?: any, sourceName?: string, args?: any[]): void;
|
|
14
|
+
fatal(message: string, error?: any, sourceName?: string, args?: any[]): void;
|
|
15
|
+
configure(options: LogOptions): void;
|
|
16
|
+
onLogError(listener: (error: Error) => void): void;
|
|
17
|
+
removeListener(listener: (...args: unknown[]) => void): void;
|
|
18
|
+
private log;
|
|
19
|
+
private listener;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Responsible for managing the way logging behaves and retrieving logs. Additionally exposes logging functions but logger should be used for logging.
|
|
23
|
+
*
|
|
24
|
+
* Basic usage example:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* import logManager from '../utils/log-manager';
|
|
28
|
+
*
|
|
29
|
+
* const logs = await logManager.getLogs();
|
|
30
|
+
*
|
|
31
|
+
* ```
|
|
32
|
+
* More information can be found [here](https://github.com/openfin/browser/blob/main/docs/Logging.md)
|
|
33
|
+
*/
|
|
34
|
+
declare let instance: LogInterface | undefined;
|
|
35
|
+
export default instance;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
2
|
+
export interface LogOptions {
|
|
3
|
+
instanceId?: string;
|
|
4
|
+
auditLimit?: number;
|
|
5
|
+
auditLevel?: LogLevel;
|
|
6
|
+
logLevel?: LogLevel;
|
|
7
|
+
}
|
|
8
|
+
export declare type LogLocal = {
|
|
9
|
+
[key in LogLevel]?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export interface LogEntry {
|
|
12
|
+
id?: number;
|
|
13
|
+
level: LogLevel;
|
|
14
|
+
name: string;
|
|
15
|
+
source?: string;
|
|
16
|
+
message: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
ts?: number;
|
|
19
|
+
data?: any[];
|
|
20
|
+
}
|
|
21
|
+
export interface GetLogOptions {
|
|
22
|
+
from?: number;
|
|
23
|
+
responseId: number;
|
|
24
|
+
}
|
|
25
|
+
export declare const LogColors: {
|
|
26
|
+
[key in LogLevel]: string;
|
|
27
|
+
};
|