Event fired whenever a workspace is generated.
The event will contain the full detail of the Workspace.
import {workspaces} from 'openfin-layouts';
workspaces.addEventListener('workspace-generated', async (event: WorkspaceGeneratedEvent) => {
console.log(`Properties for the generated workspace: ${event.detail}`);
});
Generates a JSON object that contains the state of the current desktop.
The returned JSON will contain the main application window of every application that is currently open and hasn't explicitly de-registered itself using the layouts service API. Child windows will not be included by default - the returned workspace object will only contain child window data for applications that integrate with the layouts service by registering save and restore callbacks.
TODO: Document workspace generation process
Send this to the service when you have registered all routes after registration.
When restoring a workspace, the service will refrain from passing the saved workspace to the application (via the setRestoreHandler callback) until after the application has used this function to signal that it is ready.
Note that by not calling this function, and workspace restore operation will hang indefinitely.
Takes a workspace created by generate and restores the applications within it.
The returned JSON will contain the main application window of every application that is currently open and hasn't explicitly de-registered itself using the layouts service API. Child windows will not be included by default - the returned workspace object will only contain child window data for applications that integrate with the layouts service by registering save and restore callbacks.
TODO: Document workspace restoration process
Register a callback that will save the state of the calling application.
The callback will be invoked on each call to generate, and the return value (if anything is returned)
will be saved as the workspace's customData property for this app within the generated Workspace.
Registers a callback that will restore the application to a previous state.
It is up to applications whether this action should "append" or "replace" the current workspace. The service will not close any applications that are currently open and not in the workspace; though applications may do this if they wish.
Event fired when a workspace is restored.
The event will contain the full detail of the Workspace.
import {workspaces} from 'openfin-layouts'; workspaces.addEventListener('workspace-restored', async (event: WorkspaceRestoredEvent) => { console.log(`Properties for the restored workspace: ${event.detail}`); });workspace-restored