AboutSupportDeveloper GuideVersion 14.0.19

Interface WorkspacePlatformModule

Controller for a Workspace Platform.

Hierarchy

  • Platform
    • WorkspacePlatformModule

Properties

The browser window factory for the Workspace Platform.

The storage API for the Workspace Platform.

Theme: ThemeApi

Theme API for the Workspace Platform.

Methods

  • Parameters

    • events: AnalyticsEventInternal[]

    Returns Promise<void>

  • Launch a browser snapshot that contains windows with pages.

    Parameters

    • snapshot: string | BrowserSnapshot

      the browser snapshot to launch or a url or filepath to retrieve a JSON snapshot.

    • Optional options: ApplySnapshotOptions

    Returns Promise<Platform>

  • Applies the given workspace to the user's desktop. Makes that workspace the active workspace.

    Parameters

    Returns Promise<boolean>

    true if the workspace was applied, false if the workspace was not applied.

    Example

    Brief example of how to apply a workspace, currently stored in storage, to the desktop.

    const workspacePlatform = getCurrentSync();

    // This assumes that there is at least one workspace in storage.
    const allWorkspaces = await workspacePlatform.Storage.getWorkspaces();

    // Apply the first workspace in storage to the desktop.
    await workspacePlatform.applyWorkspace(allWorkspaces[0], {
    // Customize the behavior of the applyWorkspace call.
    skipPrompt: false,
    applySnapshotOptions: {
    closeExistingWindows: false,
    closeSnapshotWindows: false,
    skipOutOfBoundsCheck: false,
    },
    });
  • Gets a workspace data structure that represents the current state of the user's desktop.

    Returns Promise<Workspace>

  • Get a snapshot that contains browser windows with pages.

    Returns Promise<BrowserSnapshot>

  • Launch an application.

    Parameters

    Returns Promise<void>

    Deprecated

    This method is deprecated. It is recommended to use createView or createWindow instead.

    import * as WorkspacePlatform from '@openfin/workspace-platform';

    const workspacePlatform = WorkspacePlatform.getCurrentSync();
    const req = {
    app: {
    appId: 'myAppId',
    title: 'appTitle',
    manifest: 'http://localhost/app.json',
    manifestType: AppManifestType.Manifest,
    icons:[
    {
    icon: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
    src: "https://cdn.openfin.co/demos/notifications/generator/images/icon-blue.png",
    type: "ico",
    },
    ]
    }
    }
    workspacePlatform.launchApp(req);
  • Sets the workspace as the current active workspace. Does not apply the workspace to the user's desktop.

    Parameters

    • workspace: Workspace

      the workspace to set as current active workspace.

    Returns Promise<void>