@openfin/workspace-platform 4.2.0 → 4.6.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/shapes.d.ts +596 -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 +6 -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 +39 -0
- package/client-api-platform/src/shapes.d.ts +278 -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 +16 -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 +63 -0
- package/common/src/api/theming.d.ts +60 -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/env.d.ts +30 -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 +146 -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 +541 -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,63 @@
|
|
|
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
|
+
}
|
|
31
|
+
export interface ChannelClient extends OpenFin.ChannelClient {
|
|
32
|
+
dispatch: (action: ChannelAction, payload: any) => Promise<any>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get a channel client for the centralized Workspace protocol.
|
|
36
|
+
*
|
|
37
|
+
* The channel client is automatically connected to the Workspace Provider,
|
|
38
|
+
* in which acts as a centralized location for executing Workspace API logic.
|
|
39
|
+
*
|
|
40
|
+
* The channel client can execute remote procedures on the provider via its `dispatch` function.
|
|
41
|
+
* A call to the `dispatch` function will block until the channel action has concluded execution
|
|
42
|
+
* in the Workspace Provider's address space.
|
|
43
|
+
* For a list of supported procedures, see the `ChannelAction` enum.
|
|
44
|
+
*
|
|
45
|
+
* @returns the channel client for the centralized workspace protocol.
|
|
46
|
+
*/
|
|
47
|
+
export declare const getChannelClient: () => Promise<ChannelClient>;
|
|
48
|
+
/**
|
|
49
|
+
* Returns true if the current application was launched via a library (such as the Client APIs).
|
|
50
|
+
* Otherwise, returns false.
|
|
51
|
+
*/
|
|
52
|
+
export declare const isLaunchedViaLib: () => Promise<boolean>;
|
|
53
|
+
/**
|
|
54
|
+
* Launches the Workspace Provider.
|
|
55
|
+
* If the Workspace Provider is already running, does nothing.
|
|
56
|
+
*/
|
|
57
|
+
export declare const launchProvider: () => Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Launches the Workspace provider if it is not running.
|
|
60
|
+
* Then gets a Channel Client that is connected to the Workspace Provider.
|
|
61
|
+
* @returns the Channel Client that is connected to the Workspace Provider.
|
|
62
|
+
*/
|
|
63
|
+
export declare const getChannelClientAndLaunchProvider: () => Promise<ChannelClient>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ThemePaletteSet } from '@openfin/ui-library';
|
|
2
|
+
export interface ComputedThemes extends Array<ComputedTheme> {
|
|
3
|
+
}
|
|
4
|
+
export interface ComputedTheme {
|
|
5
|
+
label: string;
|
|
6
|
+
logoUrl?: string;
|
|
7
|
+
theme: ThemePaletteSet;
|
|
8
|
+
}
|
|
9
|
+
export interface CustomThemes extends Array<CustomThemeOptions> {
|
|
10
|
+
}
|
|
11
|
+
export interface CustomThemeOptions {
|
|
12
|
+
label: string;
|
|
13
|
+
logoUrl?: string;
|
|
14
|
+
palette: CustomPaletteSet;
|
|
15
|
+
}
|
|
16
|
+
export interface DefaultPaletteSet {
|
|
17
|
+
brandPrimary: string;
|
|
18
|
+
brandSecondary: string;
|
|
19
|
+
backgroundPrimary: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CustomPaletteSet extends DefaultPaletteSet {
|
|
22
|
+
functional1?: string;
|
|
23
|
+
functional2?: string;
|
|
24
|
+
functional3?: string;
|
|
25
|
+
functional4?: string;
|
|
26
|
+
functional5?: string;
|
|
27
|
+
functional6?: string;
|
|
28
|
+
functional7?: string;
|
|
29
|
+
functional8?: string;
|
|
30
|
+
functional9?: string;
|
|
31
|
+
functional10?: string;
|
|
32
|
+
statusSuccess?: string;
|
|
33
|
+
statusWarning?: string;
|
|
34
|
+
statusCritical?: string;
|
|
35
|
+
statusActive?: string;
|
|
36
|
+
inputBg?: string;
|
|
37
|
+
inputColor?: string;
|
|
38
|
+
inputPlaceholder?: string;
|
|
39
|
+
inputDisabled?: string;
|
|
40
|
+
inputFocused?: string;
|
|
41
|
+
textDefault?: string;
|
|
42
|
+
textHelp?: string;
|
|
43
|
+
textInactive?: string;
|
|
44
|
+
background1?: string;
|
|
45
|
+
background2?: string;
|
|
46
|
+
background3?: string;
|
|
47
|
+
background4?: string;
|
|
48
|
+
background5?: string;
|
|
49
|
+
background6?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* computeThemes()
|
|
53
|
+
* Accepts the array of registered CustomThemes objects
|
|
54
|
+
* Creates a light and dark palette from a tempalte overriding with custom options
|
|
55
|
+
* Uses createTheme to build theme object
|
|
56
|
+
* Creates a ThemePaletteSet
|
|
57
|
+
* @param customPalettes
|
|
58
|
+
* @returns theme object ready to be applied to the UI
|
|
59
|
+
*/
|
|
60
|
+
export declare const computeThemes: (customPalettes: CustomThemes) => ComputedThemes;
|
|
@@ -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,30 @@
|
|
|
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;
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All routes that serve HTML pages for the app.
|
|
3
|
+
* Routes should include the zone the the HTML page is a part of.
|
|
4
|
+
* Make sure to include trailing slash, as it is essential for deployed version to route correctly.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum PageRoute {
|
|
7
|
+
HomeIndex = "/home/",
|
|
8
|
+
HomeSearch = "/home/search/",
|
|
9
|
+
HomePagesRename = "/home/pages/rename/",
|
|
10
|
+
Dock = "/home/dock/",
|
|
11
|
+
BrowserPagesLanding = "/browser/pages/landing/",
|
|
12
|
+
HomeIndicator = "/home/indicator/",
|
|
13
|
+
Browser = "/browser/",
|
|
14
|
+
BrowserPopupMenu = "/browser/popup-menu/",
|
|
15
|
+
Provider = "/provider/",
|
|
16
|
+
BrowserPopupMenuSharePage = "/browser/popup-menu/share-page/",
|
|
17
|
+
BrowserPopupMenuSavePage = "/browser/popup-menu/save-page/",
|
|
18
|
+
BrowserPopupMenuLayouts = "/browser/popup-menu/layouts/layouts/",
|
|
19
|
+
BrowserPopupMenuColorLinking = "/browser/popup-menu/color-linking/color-linking/",
|
|
20
|
+
BrowserIndicator = "/browser/indicator/",
|
|
21
|
+
ResponseModal = "/browser/popup-menu/response-modal/",
|
|
22
|
+
Docs = "/provider/docs/",
|
|
23
|
+
Storefront = "/storefront/",
|
|
24
|
+
DeprecatedAlert = "/provider/deprecated-alert/"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* All routes that serve assets. (icons, json, etc.)
|
|
28
|
+
*/
|
|
29
|
+
export declare enum AssetRoute {
|
|
30
|
+
IconOpenFinLogo = "/icons/openfinlogo.svg",
|
|
31
|
+
IconFilter = "/icons/filter.svg"
|
|
32
|
+
}
|
|
33
|
+
declare const _default: {
|
|
34
|
+
HomeIndex: PageRoute.HomeIndex;
|
|
35
|
+
HomeSearch: PageRoute.HomeSearch;
|
|
36
|
+
HomePagesRename: PageRoute.HomePagesRename;
|
|
37
|
+
Dock: PageRoute.Dock;
|
|
38
|
+
BrowserPagesLanding: PageRoute.BrowserPagesLanding;
|
|
39
|
+
HomeIndicator: PageRoute.HomeIndicator;
|
|
40
|
+
Browser: PageRoute.Browser;
|
|
41
|
+
BrowserPopupMenu: PageRoute.BrowserPopupMenu;
|
|
42
|
+
Provider: PageRoute.Provider;
|
|
43
|
+
BrowserPopupMenuSharePage: PageRoute.BrowserPopupMenuSharePage;
|
|
44
|
+
BrowserPopupMenuSavePage: PageRoute.BrowserPopupMenuSavePage;
|
|
45
|
+
BrowserPopupMenuLayouts: PageRoute.BrowserPopupMenuLayouts;
|
|
46
|
+
BrowserPopupMenuColorLinking: PageRoute.BrowserPopupMenuColorLinking;
|
|
47
|
+
BrowserIndicator: PageRoute.BrowserIndicator;
|
|
48
|
+
ResponseModal: PageRoute.ResponseModal;
|
|
49
|
+
Docs: PageRoute.Docs;
|
|
50
|
+
Storefront: PageRoute.Storefront;
|
|
51
|
+
DeprecatedAlert: PageRoute.DeprecatedAlert;
|
|
52
|
+
IconOpenFinLogo: AssetRoute.IconOpenFinLogo;
|
|
53
|
+
IconFilter: AssetRoute.IconFilter;
|
|
54
|
+
};
|
|
55
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare type Listener = (...args: any[]) => void;
|
|
2
|
+
/**
|
|
3
|
+
* Creates an event emitter that is shared between all windows within the same domain.
|
|
4
|
+
*/
|
|
5
|
+
export default function makeSharedEmitter<E extends string | number, L extends Listener>(id: string): {
|
|
6
|
+
emit: (event: E, ...payload: any[]) => Promise<void>;
|
|
7
|
+
addListener: (event: E, listener: L) => void;
|
|
8
|
+
removeListener: (event: E, listener: L) => void;
|
|
9
|
+
once: (event: E, listener: L) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="openfin-adapter/fin" />
|
|
2
|
+
export declare type SnapshotDetailsExtended = OpenFin.Snapshot['snapshotDetails'] & {
|
|
3
|
+
machineId: string;
|
|
4
|
+
machineName?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type SnapshotExtended = {
|
|
7
|
+
snapshotDetails: SnapshotDetailsExtended;
|
|
8
|
+
windows: OpenFin.WindowOptions[];
|
|
9
|
+
};
|
|
10
|
+
export declare type ApplySnapshotOptionsExtended = OpenFin.ApplySnapshotOptions & {
|
|
11
|
+
attachToExistingWindow: boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Set a friendly name of the current machine.
|
|
15
|
+
* @param name the friendly name.
|
|
16
|
+
*/
|
|
17
|
+
export declare function setMachineName(name: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Get the machine's friendly name.
|
|
20
|
+
* @returns the machine's friendly name.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getMachineName(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Get the current machine ID.
|
|
25
|
+
* @returns the machine ID.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getMachineId(): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Get a snapshot with extra snapshot details.
|
|
30
|
+
* @param snapshot the snapshot to extend.
|
|
31
|
+
* @returns the snapshot with more snapshot details.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getSnapshotExtended(snapshot?: OpenFin.Snapshot): Promise<SnapshotExtended>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const capitalize: (s: string) => string;
|
|
2
|
+
export declare const titleize: (s: string) => string;
|
|
3
|
+
export declare const pascalize: (s: string) => string;
|
|
4
|
+
export declare const slugify: (s: string) => string;
|
|
5
|
+
export declare const isStringMatchesQuery: (title: string, query?: string) => boolean;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { CustomPaletteSet } from '@common/api/theming';
|
|
2
|
+
/**
|
|
3
|
+
* Get hue from a CSS color
|
|
4
|
+
*
|
|
5
|
+
* The getHue function is used manage extracting hue from 3 types of css
|
|
6
|
+
* string input types. An object including hue, hsl, hsla, lightness and
|
|
7
|
+
* saturation are returned.
|
|
8
|
+
*
|
|
9
|
+
* Each function was copied css tricks and modified to fit this platform.
|
|
10
|
+
* Links above each function for technical details.
|
|
11
|
+
*
|
|
12
|
+
* Allowed formats:
|
|
13
|
+
* RGB with or with out the alpha rgb(x,x,x) or rgba(x,x,x,x)
|
|
14
|
+
* HEX 3 or 6 characters, plus hashtag #333 or #333333
|
|
15
|
+
* HSL with or with out the alhpa hsl(x,x%,x%) or hsla(x,x%,x%,x)
|
|
16
|
+
*
|
|
17
|
+
* The hue value is used later to build an array of background colors in the
|
|
18
|
+
* theme that are various shades of the hue returned from this function.
|
|
19
|
+
*
|
|
20
|
+
* An invalid format should error telling the integrator how to fix the error.
|
|
21
|
+
* - Error for missing required options
|
|
22
|
+
* - Error for invalid css strings that are unable to be processed
|
|
23
|
+
*
|
|
24
|
+
* @param colorInput string - Supported formats rgb/RGB/rgba/RGBA, #000/#000000, hsl/HSL/hsla/HSLA
|
|
25
|
+
* @returns hue as string
|
|
26
|
+
*/
|
|
27
|
+
export declare const getHue: (colorInput: string) => string;
|
|
28
|
+
export declare const makeBackgroundLayers: (hue: string) => {
|
|
29
|
+
light: {
|
|
30
|
+
background1: string;
|
|
31
|
+
background2: string;
|
|
32
|
+
background3: string;
|
|
33
|
+
background4: string;
|
|
34
|
+
background5: string;
|
|
35
|
+
background6: string;
|
|
36
|
+
};
|
|
37
|
+
dark: {
|
|
38
|
+
background1: string;
|
|
39
|
+
background2: string;
|
|
40
|
+
background3: string;
|
|
41
|
+
background4: string;
|
|
42
|
+
background5: string;
|
|
43
|
+
background6: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* makePalette() - generic - doesn't care about scheme
|
|
48
|
+
*
|
|
49
|
+
* Accepts a default palette object, and a custom palette object.
|
|
50
|
+
* The default object gets overrides from customPalette and returns a new palette object.
|
|
51
|
+
* @param defaultPalette
|
|
52
|
+
* @param customPalette
|
|
53
|
+
* @returns { light: newPalette, dark: newPalette }
|
|
54
|
+
*
|
|
55
|
+
* TODO: DefaultPaletteSet isn't working, need to redo.
|
|
56
|
+
*/
|
|
57
|
+
export declare const makePalette: (defaultPalette: any, customPalette: CustomPaletteSet) => CustomPaletteSet;
|