@openfin/workspace-platform 22.3.0 → 22.3.1
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-platform/src/api/app-directory.d.ts +1 -1
- package/client-api-platform/src/api/performance.d.ts +7 -0
- package/client-api-platform/src/api/workspaces/index.d.ts +2 -2
- package/client-api-platform/src/index.d.ts +2 -1
- package/client-api-platform/src/init/index.d.ts +1 -2
- package/client-api-platform/src/init/utils.d.ts +1 -0
- package/client-api-platform/src/shapes.d.ts +48 -3
- package/common/src/api/protocol/workspace-platform.d.ts +1 -0
- package/common/src/utils/defer-show.d.ts +1 -1
- package/common/src/utils/enterpriseBrowser.d.ts +2 -0
- package/common/src/utils/global-context-menu.d.ts +1 -1
- package/common/src/utils/indicators/browser.d.ts +1 -1
- package/common/src/utils/page-tab-context-menu.d.ts +1 -1
- package/common/src/utils/pick.d.ts +7 -0
- package/common/src/utils/promise-with-resolvers.d.ts +9 -0
- package/common/src/utils/types.d.ts +23 -0
- package/{common/src/utils/enterprise-dock.d.ts → dock3/src/api/constants.d.ts} +2 -0
- package/dock3/src/api/idb.d.ts +3 -0
- package/dock3/src/api/index.d.ts +14 -0
- package/dock3/src/api/launch.d.ts +3 -0
- package/dock3/src/api/protocol.d.ts +1 -0
- package/dock3/src/api/provider.d.ts +89 -0
- package/dock3/src/shapes/enterprise.d.ts +1 -0
- package/dock3/src/shapes/index.d.ts +2 -0
- package/dock3/src/shapes/shapes.d.ts +63 -0
- package/dock3/src/utils.d.ts +2 -0
- package/externals.report.json +6 -0
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/workspace_platform.zip +0 -0
- package/client-api-platform/src/api/perfomance.d.ts +0 -3
|
@@ -7,7 +7,7 @@ import type { LaunchAppRequest, SearchSitesRequest, SearchSitesResponse, Site }
|
|
|
7
7
|
* @param app the app directory entry.
|
|
8
8
|
* @param opts launch options.
|
|
9
9
|
*/
|
|
10
|
-
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.
|
|
10
|
+
export declare function launchApp({ app, target }: LaunchAppRequest): Promise<void | OpenFin.Identity | OpenFin.Application | OpenFin.View | OpenFin.Platform>;
|
|
11
11
|
export declare const enterpriseAppDirectoryChannelClient: () => Promise<OpenFin.ChannelClient>;
|
|
12
12
|
export declare function getResults(payload: {
|
|
13
13
|
req: SearchSitesRequest;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const browserWindowPerformanceMarkStart: () => string;
|
|
2
|
+
export declare const browserWindowPerformanceMarkAPIReturn: (performanceMarkTitle: string) => void;
|
|
3
|
+
export declare const setupBrowserWindowShownPerformanceMark: (performanceMarkTitle: string) => void;
|
|
4
|
+
export declare const contextMenuPerformanceMarkStart: () => string;
|
|
5
|
+
export declare const contextMenuPerformanceMarkEnd: (performanceMarkTitle: string) => void;
|
|
6
|
+
export declare const contextMenuPerformanceMarkAPIReturn: (performanceMarkTitle: string) => void;
|
|
7
|
+
export declare const setupContextMenuPerformanceMark: (performanceMarkTitle: string) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApplyWorkspacePayload, CreateSavedWorkspaceRequest, RestoreLastSavedWorkspacePayload, RestoreLastSavedWorkspaceResult, Workspace } from '../../../../client-api-platform/src/shapes';
|
|
1
|
+
import type { ApplyWorkspacePayload, CreateSavedWorkspaceRequest, GetCurrentWorkspaceOptions, RestoreLastSavedWorkspacePayload, RestoreLastSavedWorkspaceResult, Workspace } from '../../../../client-api-platform/src/shapes';
|
|
2
2
|
/**
|
|
3
3
|
* Apply the given workspace and set it as active.
|
|
4
4
|
* @param payload, the workspace to apply and the options to apply it with.
|
|
@@ -20,7 +20,7 @@ export declare function getInitialWorkspace(): Promise<Workspace>;
|
|
|
20
20
|
* Get a workspace data structure that represents the users current desktop.
|
|
21
21
|
* @returns the current active workspace.
|
|
22
22
|
*/
|
|
23
|
-
export declare function getCurrentWorkspace(): Promise<Workspace>;
|
|
23
|
+
export declare function getCurrentWorkspace(options?: GetCurrentWorkspaceOptions): Promise<Workspace>;
|
|
24
24
|
export declare function getLastSavedWorkspace(): Promise<Workspace | undefined>;
|
|
25
25
|
export declare const createWorkspaceInStorage: (req: CreateSavedWorkspaceRequest) => Promise<any>;
|
|
26
26
|
export declare const getWorkspacesInStorage: () => Promise<Workspace[]>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import OpenFin from '@openfin/core';
|
|
2
|
-
import {
|
|
3
|
-
export declare function initDockCompanion(config: CompanionDockConfig, platform: OpenFin.Platform): Promise<void>;
|
|
2
|
+
import { WorkspacePlatformInitConfig } from '../../../client-api-platform/src/shapes';
|
|
4
3
|
/**
|
|
5
4
|
* Initilaize a Workspace Platform.
|
|
6
5
|
*
|
|
@@ -34,4 +34,5 @@ export type WindowType = 'browser' | 'platform' | 'classic' | 'mixed' | 'enterpr
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function checkHasBrowserWindows(snapshot: BrowserSnapshot): boolean;
|
|
36
36
|
export declare const copyObject: <T>(obj: T) => T;
|
|
37
|
+
export declare function validateTabDimensionsIfAny(overrideOptions: OpenFin.PlatformWindowCreationOptions): void;
|
|
37
38
|
export {};
|
|
@@ -6,8 +6,9 @@ import { AddDefaultPagePayload, AttachedPage, BookmarkNode, CopyPagePayload, Han
|
|
|
6
6
|
import { SetActivePageForWindowPayload } from '../../common/src/api/pages/shapes';
|
|
7
7
|
import { NotificationsCustomManifestOptions } from '../../common/src/api/shapes/notifications';
|
|
8
8
|
import type { CustomThemes } from '../../common/src/api/theming';
|
|
9
|
-
import { App, DockProviderConfigWithIdentity, StoreButtonConfig
|
|
9
|
+
import { App, DockProviderConfigWithIdentity, StoreButtonConfig } from '../../client-api/src/shapes';
|
|
10
10
|
import type { WorkflowIntegration } from '../../client-api/src/shapes/integrations';
|
|
11
|
+
export * from '../../dock3/src/shapes';
|
|
11
12
|
export { AppManifestType } from '../../client-api/src/shapes';
|
|
12
13
|
export type { App, AppIntent, Image } from '../../client-api/src/shapes';
|
|
13
14
|
export type { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
@@ -604,6 +605,28 @@ export interface BrowserWorkspacePlatformWindowOptions {
|
|
|
604
605
|
newPageUrl?: string;
|
|
605
606
|
toolbarOptions?: ToolbarOptions;
|
|
606
607
|
windowStateButtonOptions?: WindowStateButtonOptions;
|
|
608
|
+
/** Specifies the min and max sizes for page tabs.
|
|
609
|
+
* Page tabs will expand to take all available space up to the specified maximum size.
|
|
610
|
+
* Similarly, they will collapse down to the specified minimum size.
|
|
611
|
+
* When there is not enough room to fit the tabs, the tabstrip will become scrollable.
|
|
612
|
+
* Sizes can be specified as pixels (e.g. "100px") or as percentage of tab strip width (e.g. "20%").
|
|
613
|
+
* The default value for both min and max is "120px". To maintain usability, minimum values below 28px will be ignored and 28px will be used as the minimum.
|
|
614
|
+
*/
|
|
615
|
+
pageTabDimensions?: {
|
|
616
|
+
minWidth?: string;
|
|
617
|
+
maxWidth?: string;
|
|
618
|
+
};
|
|
619
|
+
/** Specifies the min and max sizes for view tabs in a layout.
|
|
620
|
+
* View tabs will expand to take all available space up to the specified maximum size.
|
|
621
|
+
* Similarly, they will collapse down to the specified minimum size.
|
|
622
|
+
* When there is not enough room to fit the tabs, the tabstrip will become scrollable.
|
|
623
|
+
* Sizes can be specified as pixels (e.g. "100px") or as percentage of tab strip width (e.g. "20%").
|
|
624
|
+
* The default value for both min and max is "120px". To maintain usability, minimum values below 28px will be ignored and 28px will be used as the minimum.
|
|
625
|
+
*/
|
|
626
|
+
viewTabDimensions?: {
|
|
627
|
+
minWidth?: string;
|
|
628
|
+
maxWidth?: string;
|
|
629
|
+
};
|
|
607
630
|
/**
|
|
608
631
|
* Use when you want to display navigation buttons in Browser toolbar. Disabled by default.
|
|
609
632
|
*
|
|
@@ -1315,6 +1338,17 @@ export interface WorkspacePlatformStorage {
|
|
|
1315
1338
|
* ```
|
|
1316
1339
|
*/
|
|
1317
1340
|
getWorkspaces(): Promise<Workspace[]>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Get all workspaces metadata including the workspaceId and title that are saved in persistent storage.
|
|
1343
|
+
*
|
|
1344
|
+
* ```ts
|
|
1345
|
+
* import * as WorkspacePlatform from '@openfin/workspace-platform';
|
|
1346
|
+
*
|
|
1347
|
+
* const workspacePlatform = WorkspacePlatform.getCurrentSync();
|
|
1348
|
+
* const workspacesMetadata = await workspacePlatform.Storage.getWorkspacesMetadata();
|
|
1349
|
+
* ```
|
|
1350
|
+
*/
|
|
1351
|
+
getWorkspacesMetadata(): Promise<Pick<Workspace, 'workspaceId' | 'title'>[]>;
|
|
1318
1352
|
/**
|
|
1319
1353
|
* Get a specific workspace in persistent storage.
|
|
1320
1354
|
*
|
|
@@ -1485,8 +1519,9 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
1485
1519
|
launchApp(req: LaunchAppRequest): Promise<void>;
|
|
1486
1520
|
/**
|
|
1487
1521
|
* Gets a workspace data structure that represents the current state of the user's desktop.
|
|
1522
|
+
* @param options Options for getting the current workspace.
|
|
1488
1523
|
*/
|
|
1489
|
-
getCurrentWorkspace(): Promise<Workspace>;
|
|
1524
|
+
getCurrentWorkspace(options?: GetCurrentWorkspaceOptions): Promise<Workspace>;
|
|
1490
1525
|
/**
|
|
1491
1526
|
* Sets the workspace as the current active workspace. Does not apply the workspace to the user's desktop.
|
|
1492
1527
|
* @param workspace the workspace to set as current active workspace.
|
|
@@ -1608,6 +1643,11 @@ export interface WorkspacePlatformProvider extends OpenFin.PlatformProvider {
|
|
|
1608
1643
|
* @param query an optional query.
|
|
1609
1644
|
*/
|
|
1610
1645
|
getSavedWorkspaces(query?: string): Promise<Workspace[]>;
|
|
1646
|
+
/**
|
|
1647
|
+
* Implementation for getting a list of saved workspaces metadata from persistent storage.
|
|
1648
|
+
* @param query an optional query.
|
|
1649
|
+
*/
|
|
1650
|
+
getSavedWorkspacesMetadata(query?: string): Promise<Pick<Workspace, 'workspaceId' | 'title'>[]>;
|
|
1611
1651
|
/**
|
|
1612
1652
|
* Implementation for getting a single workspace in persistent storage.
|
|
1613
1653
|
* @param id
|
|
@@ -1813,6 +1853,9 @@ export declare enum CustomActionCallerType {
|
|
|
1813
1853
|
export type CustomActionPayload = {
|
|
1814
1854
|
callerType: CustomActionCallerType.API;
|
|
1815
1855
|
} | CustomButtonActionPayload | StoreCustomButtonActionPayload | CustomDropdownItemActionPayload | GlobalContextMenuOptionActionPayload | ViewTabCustomActionPayload | PageTabContextMenuOptionActionPayload | OpenSaveContextMenuOptionActionPayload;
|
|
1856
|
+
export interface GetCurrentWorkspaceOptions {
|
|
1857
|
+
skipSnapshotUpdate?: boolean;
|
|
1858
|
+
}
|
|
1816
1859
|
/**
|
|
1817
1860
|
* Options for the {@link WorkspacePlatformModule.applyWorkspace applyWorkspace} method.
|
|
1818
1861
|
*
|
|
@@ -2183,11 +2226,13 @@ export type WorkspacePlatformOverrideCallback = OpenFin.OverrideCallback<Workspa
|
|
|
2183
2226
|
* @deprecated
|
|
2184
2227
|
*/
|
|
2185
2228
|
export type BrowserOverrideCallback = WorkspacePlatformOverrideCallback;
|
|
2186
|
-
export type DockCompanionButton = Exclude<WorkspaceButton, 'store'> | 'contentMenu' | 'bookmarks' | 'searchShortcut';
|
|
2187
2229
|
export type LaunchDockEntryPayload = {
|
|
2188
2230
|
entry: DockEntry;
|
|
2189
2231
|
sourceEvent?: Pick<MouseEvent, 'ctrlKey' | 'metaKey' | 'shiftKey'>;
|
|
2190
2232
|
};
|
|
2233
|
+
export type BookmarkDockEntryPayload = {
|
|
2234
|
+
entry: DockEntry;
|
|
2235
|
+
};
|
|
2191
2236
|
/**
|
|
2192
2237
|
* Configuration options for Browser window's icons.
|
|
2193
2238
|
*/
|
|
@@ -48,6 +48,7 @@ export declare enum WorkspacePlatformChannelAction {
|
|
|
48
48
|
UpdateSavedWorkspace = "updateSavedWorkspace",
|
|
49
49
|
DeleteSavedWorkspace = "deleteSavedWorkspace",
|
|
50
50
|
GetSavedWorkspaces = "getSavedWorkspaces",
|
|
51
|
+
GetSavedWorkspacesMetadata = "getSavedWorkspacesMetadata",
|
|
51
52
|
SaveWorkspace = "saveWorkspace",
|
|
52
53
|
GetCurrentWorkspace = "getCurrentWorkspace",
|
|
53
54
|
ApplyWorkspace = "applyWorkspace",
|
|
@@ -24,7 +24,7 @@ interface InternalWindowOptions extends OpenFin.PlatformWindowCreationOptions {
|
|
|
24
24
|
* @param setAsForeground the option to focus the window when it is shown
|
|
25
25
|
* @returns the modified options.
|
|
26
26
|
*/
|
|
27
|
-
export declare const applyDeferShowOptions: (opts:
|
|
27
|
+
export declare const applyDeferShowOptions: <T>(opts: T, setAsForeground?: boolean) => InternalWindowOptions & T;
|
|
28
28
|
/**
|
|
29
29
|
* This function is a middleware that can be applied to a platform's `createWindow` function.
|
|
30
30
|
* If the defer show API has been enabled in window options using the `applyDeferShowOptions` function
|
|
@@ -2,6 +2,8 @@ import type OpenFin from '@openfin/core';
|
|
|
2
2
|
import { BrowserInitConfig } from '../../../client-api-platform/src/shapes';
|
|
3
3
|
export declare const DEFAULT_ENTERPRISE_WINDOW_HEIGHT = 600;
|
|
4
4
|
export declare const DEFAULT_ENTERPRISE_WINDOW_WIDTH = 900;
|
|
5
|
+
export declare const ENTERPRISE_MIN_WINDOW_HEIGHT = 488;
|
|
6
|
+
export declare const ENTERPRISE_MIN_WINDOW_WIDTH = 654;
|
|
5
7
|
export declare const isEnterpriseBrowser: (id?: OpenFin.Identity) => Promise<boolean>;
|
|
6
8
|
export declare const isEnterpriseBrowserPlatform: (browserInitOptions: BrowserInitConfig) => boolean;
|
|
7
9
|
export declare function formatUrl(url: string): string;
|
|
@@ -86,7 +86,7 @@ export declare const downloads: () => {
|
|
|
86
86
|
export declare const appearance: () => {
|
|
87
87
|
label: string;
|
|
88
88
|
};
|
|
89
|
-
export declare const getSavedWorkspaceContextMenuOptions: (activeWorkspace: Workspace, savedWorkspaces: Workspace[], contextMenuOptionType: GlobalContextMenuOptionType) => {
|
|
89
|
+
export declare const getSavedWorkspaceContextMenuOptions: (activeWorkspace: Workspace, savedWorkspaces: Pick<Workspace, 'workspaceId' | 'title'>[], contextMenuOptionType: GlobalContextMenuOptionType) => {
|
|
90
90
|
label: string;
|
|
91
91
|
type: MenuItemType;
|
|
92
92
|
enabled: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import { IconType } from '@openfin/ui-library';
|
|
3
3
|
import { IndicatorType } from '../../../../common/src/components/Indicator/Indicator.constants';
|
|
4
|
-
export type BrowserIndicatorIcon = Extract<IconType, 'LockClosedIcon' | 'LockOpen1Icon' | 'PageIcon' | 'BlockedIcon' | 'SupertabIcon'>;
|
|
4
|
+
export type BrowserIndicatorIcon = Extract<IconType, 'LockClosedIcon' | 'LockOpen1Icon' | 'PageIcon' | 'BlockedIcon' | 'SupertabIcon' | 'BookmarkFilled'>;
|
|
5
5
|
export interface ShowBrowserIndicatorPayload {
|
|
6
6
|
type: IndicatorType;
|
|
7
7
|
message: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
2
|
import { PageTabContextMenuItemTemplate } from '../../../client-api-platform/src/shapes';
|
|
3
|
-
export declare const getPageTabMenuTemplate: (pageId: string, winIdentity: OpenFin.Identity) => Promise<PageTabContextMenuItemTemplate[]>;
|
|
3
|
+
export declare const getPageTabMenuTemplate: (pageId: string, winIdentity: OpenFin.Identity, isEnterprise: boolean) => Promise<PageTabContextMenuItemTemplate[]>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pick specific keys from an object.
|
|
3
|
+
* lodash.pick is deprecated and says to use destructuring instead, but that has one key flaw, it adds undefined properties to the result if the key is not present in the object.
|
|
4
|
+
* ie `const { a, b } = obj; return {a,b};` will result in `{ a: undefined, b: undefined }` if `a` or `b` are not present in `obj`.
|
|
5
|
+
* pick({}, ['a', 'b']) will result in `{}` if `a` or `b` are not present in the object.
|
|
6
|
+
*/
|
|
7
|
+
export declare function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Polyfill for `Promise.withResolvers` which is not available in this typescript version.
|
|
3
|
+
*/
|
|
4
|
+
export declare function withResolvers<T>(): PromiseWithResolvers<T>;
|
|
5
|
+
export type PromiseWithResolvers<T> = {
|
|
6
|
+
promise: Promise<T>;
|
|
7
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
8
|
+
reject: (reason?: any) => void;
|
|
9
|
+
};
|
|
@@ -33,3 +33,26 @@ export type Awaitable<T> = Awaited<T> | Promise<Awaited<T>>;
|
|
|
33
33
|
export type RemoveFunctions<T> = Pick<T, {
|
|
34
34
|
[K in keyof T]: T[K] extends Function ? never : K;
|
|
35
35
|
}[keyof T]>;
|
|
36
|
+
type MissingKeys<T, U> = Exclude<keyof T, U>;
|
|
37
|
+
/**
|
|
38
|
+
* A utility function that checks if the provided keys are valid for the given type T.
|
|
39
|
+
* The key thing it does is to ensure that all keys in T are present in the array, typescript can check for extra keys but not missing keys.
|
|
40
|
+
* While it is a function, it is really just a type check. The function is needed to encapsulate the type logic.
|
|
41
|
+
* It will throw a type error if any of the keys are not present in T.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* type Foo = {
|
|
46
|
+
* bar: string;
|
|
47
|
+
* qux?: string;
|
|
48
|
+
* };
|
|
49
|
+
*
|
|
50
|
+
* const fooChecker = makeKeyChecker<Foo>();
|
|
51
|
+
* const allFooKeys = fooChecker(['bar', 'qux']); // Valid
|
|
52
|
+
* fooChecker(['bar']); // Error: Missing keys: qux
|
|
53
|
+
* fooChecker(['qux']); // Error: Missing keys: bar
|
|
54
|
+
* fooChecker(['bar', 'qux', 'baz']); // 'baz' is not assignable to type keyof Foo;
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const makeKeyChecker: <T extends object>() => <const K extends (keyof T)[]>(arr: K & (Exclude<keyof T, K[number]> extends never ? unknown : `Error: Missing keys: ${string & Exclude<keyof T, K[number]>}`)) => K;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Dock3Config, DockAllowedWindowOptions } from '../../../dock3/src/shapes';
|
|
2
|
+
import { Dock3ConstructorOverride, Dock3Provider } from './provider';
|
|
3
|
+
export type DockInitOptions = {
|
|
4
|
+
config: Dock3Config;
|
|
5
|
+
override: Dock3ConstructorOverride;
|
|
6
|
+
windowOptions?: DockAllowedWindowOptions;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param config Dock3 configuration object
|
|
11
|
+
* @param override Constructor override to customize the Dock3Provider
|
|
12
|
+
* @returns instance of Dock3Provider
|
|
13
|
+
*/
|
|
14
|
+
export declare function init(options: DockInitOptions): Promise<Dock3Provider>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CompanionDockConfig } from '../shapes/enterprise';
|
|
2
|
+
import type { Dock3Config, DockAllowedWindowOptions } from '../shapes/shapes';
|
|
3
|
+
export declare function launchDock(dockName: string, baseUrl: string, config: CompanionDockConfig | Dock3Config, additionalOptions?: DockAllowedWindowOptions): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { OpenFin } from '@openfin/core';
|
|
2
|
+
import { BookmarkDockEntryPayload, LaunchDockEntryPayload } from '../../../client-api-platform/src/index';
|
|
3
|
+
import { Dock3Config } from '../../../dock3/src/shapes';
|
|
4
|
+
import { Async, CamelCase } from '../../../dock3/src/utils';
|
|
5
|
+
import { Dock3ChannelProvider, Dock3ChannelProviderChannelActions } from './protocol';
|
|
6
|
+
type InternalDock3ChannelActions = 'ready';
|
|
7
|
+
type Dock3ProviderAPI = {
|
|
8
|
+
[K in keyof Omit<Dock3ChannelProviderChannelActions, InternalDock3ChannelActions> as CamelCase<K>]: Async<Dock3ChannelProviderChannelActions[K]>;
|
|
9
|
+
};
|
|
10
|
+
type ExtendsProtocolProvider<T extends Dock3ProviderAPI> = T extends Dock3ProviderAPI ? T : never;
|
|
11
|
+
export type EnsureProviderMatchesProtocol = ExtendsProtocolProvider<Dock3Provider>;
|
|
12
|
+
export declare class Dock3Provider {
|
|
13
|
+
#private;
|
|
14
|
+
static getOverrideConstructor(...args: ConstructorParameters<typeof Dock3Provider>): new () => Dock3Provider;
|
|
15
|
+
static instance: Dock3Provider | null;
|
|
16
|
+
constructor(config: Dock3Config, channel: Dock3ChannelProvider);
|
|
17
|
+
launchEntry(payload: LaunchDockEntryPayload): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a promise that resolves when the Dock3Provider is ready.
|
|
20
|
+
* This is useful to ensure that the dock is fully initialized before performing any operations.
|
|
21
|
+
* The promise will resolve when the dock sends the 'ready' action.
|
|
22
|
+
*/
|
|
23
|
+
get ready(): Promise<void>;
|
|
24
|
+
bookmarkContentMenuEntry(payload: BookmarkDockEntryPayload): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Read-only access to the current configuration of the Dock3Provider.
|
|
27
|
+
*/
|
|
28
|
+
get config(): Dock3Config;
|
|
29
|
+
/**
|
|
30
|
+
* Protected setter for the configuration of the Dock3Provider.
|
|
31
|
+
* This does not save the configuration in storage nor notify the dock about the change.
|
|
32
|
+
* Use `updateConfig` method to update the configuration and save it.
|
|
33
|
+
* This should only be used internally in a `saveConfig` override if `super.saveConfig` is not called.
|
|
34
|
+
*/
|
|
35
|
+
protected set config(newConfig: Dock3Config);
|
|
36
|
+
/**
|
|
37
|
+
* Updates the configuration of the Dock3Provider.
|
|
38
|
+
* This method updates the configuration, notifies the dock about the change and saves the new configuration to storage (via `saveConfig`).
|
|
39
|
+
* @param newConfig The new configuration to be applied.
|
|
40
|
+
*/
|
|
41
|
+
updateConfig(config: Dock3Config): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Shuts down the Dock3Provider and closes the dock window.
|
|
44
|
+
* This method sends a shutdown message to the dock and then closes the window.
|
|
45
|
+
*/
|
|
46
|
+
shutdown(): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Called whenever the configuration is updated, this method saves the configuration to the storage.
|
|
49
|
+
* This should not be called directly, if you need to update the configuration, use `updateConfig` method instead.
|
|
50
|
+
*/
|
|
51
|
+
saveConfig({ config }: {
|
|
52
|
+
config: Dock3Config;
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
private handleConfigChange;
|
|
55
|
+
/**
|
|
56
|
+
* Called on startup to load the current configuration of the Dock3Provider.
|
|
57
|
+
* If you've overridden the `saveConfig` method, this should load the configuration from your storage.
|
|
58
|
+
* By default it will load the configuration from local storage. This can be overriden to prevent loading from local storage.
|
|
59
|
+
* @example Prevent loading from local storage:
|
|
60
|
+
* ```typescript
|
|
61
|
+
* class MyDock3Provider extends Dock3Provider {
|
|
62
|
+
* async loadConfig(): Promise<Dock3Config> {
|
|
63
|
+
* // Do not load from local storage, return the default config
|
|
64
|
+
* return this.config;
|
|
65
|
+
* }
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
* @example Load from a custom storage:
|
|
69
|
+
* ```typescript
|
|
70
|
+
* class MyDock3Provider extends Dock3Provider {
|
|
71
|
+
* async loadConfig(): Promise<Dock3Config> {
|
|
72
|
+
* // Load from a custom storage
|
|
73
|
+
* const configFromStorage = await myCustomStorage.getDockConfig();
|
|
74
|
+
* // Update local config to ensure it is used.
|
|
75
|
+
* if (configFromStorage) {
|
|
76
|
+
* this.config = configFromStorage;
|
|
77
|
+
* }
|
|
78
|
+
* return this.config;
|
|
79
|
+
* }
|
|
80
|
+
* }
|
|
81
|
+
* ```
|
|
82
|
+
* @returns The current configuration of the Dock3Provider.
|
|
83
|
+
*/
|
|
84
|
+
loadConfig(): Promise<Dock3Config>;
|
|
85
|
+
getWindowSync(): OpenFin.Window;
|
|
86
|
+
private registerChannelActions;
|
|
87
|
+
}
|
|
88
|
+
export type Dock3ConstructorOverride = (Base: new () => Dock3Provider) => new () => Dock3Provider;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { EnterpriseDockChannelClient, EnterpriseDockChannelProvider } from '../api/protocol';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { OpenFin } from '@openfin/core';
|
|
2
|
+
import { WorkspaceButton } from '../../../client-api/src/dock';
|
|
3
|
+
import { ContentMenuEntry, DockEntry, TaskbarIcon } from '../../../client-api-platform/src/shapes';
|
|
4
|
+
export type { Dock3Provider, Dock3ConstructorOverride } from '../api/provider';
|
|
5
|
+
export type Dock3Button = WorkspaceButton | 'contentMenu';
|
|
6
|
+
/**
|
|
7
|
+
* Configuration for the Dock 3.0 provider.
|
|
8
|
+
*/
|
|
9
|
+
export interface Dock3Config {
|
|
10
|
+
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* icon URL for the dock provider.
|
|
13
|
+
*/
|
|
14
|
+
icon?: string | TaskbarIcon;
|
|
15
|
+
/**
|
|
16
|
+
* Favorites to be displayed in the dock
|
|
17
|
+
*/
|
|
18
|
+
favorites?: DockEntry[];
|
|
19
|
+
/**
|
|
20
|
+
* Content menu entries to be displayed in the dock
|
|
21
|
+
*/
|
|
22
|
+
contentMenu?: ContentMenuEntry[];
|
|
23
|
+
/**
|
|
24
|
+
* The config for the default dock buttons
|
|
25
|
+
*/
|
|
26
|
+
defaultDockButtons?: Dock3Button[];
|
|
27
|
+
/**
|
|
28
|
+
* The id of the target element for the content menu.
|
|
29
|
+
*/
|
|
30
|
+
contentMenuTargetId?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The config for the companion dock ui
|
|
33
|
+
*/
|
|
34
|
+
uiConfig?: {
|
|
35
|
+
contentMenu?: {
|
|
36
|
+
enableBookmarking?: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* By default drag handle is visible. Set this to true to hide the drag handle
|
|
40
|
+
*/
|
|
41
|
+
hideDragHandle?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* By default provider icon is just a drag region. Set this to true to convert it to content menu dropdown button.
|
|
44
|
+
*/
|
|
45
|
+
providerIconContentMenu?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Configuration for the dock more menu component.
|
|
48
|
+
*/
|
|
49
|
+
moreMenu?: {
|
|
50
|
+
quitPlatform?: {
|
|
51
|
+
/**
|
|
52
|
+
* By default the quit button will contain platform title in its label. Set this to true to hide the platform title.
|
|
53
|
+
*/
|
|
54
|
+
hidePlatformTitle?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* By default the quit button will show a quit confirmation dialog. Set this to true to skip the quit confirmation dialog.
|
|
57
|
+
*/
|
|
58
|
+
skipDialog?: boolean;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export type DockAllowedWindowOptions = Partial<Pick<OpenFin.PlatformWindowOptions, 'defaultCentered' | 'saveWindowState' | 'taskbarIconGroup' | 'defaultTop' | 'defaultLeft'>>;
|
package/externals.report.json
CHANGED