Options
All
  • Public
  • Public/Protected
  • All
Menu

External module Workspaces

Index

Functions

generateLayout

  • generateLayout(): Promise<Layout>
  • 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 layout 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

    Returns Promise<Layout>

onAppRestore

  • onAppRestore(layoutDecorator: function): Promise<boolean>
  • 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 layout. The service will not close any applications that are currently open and not in the layout; though applications may do this if they wish.

    Parameters

    Returns Promise<boolean>

onApplicationSave

  • onApplicationSave(customDataDecorator: function): Promise<boolean>
  • Register a callback that will save the state of the calling application.

    The callback will be invoked on each call to generateLayout, and the return value (if anything is returned) will be saved as the layout's customData property.

    Parameters

    Returns Promise<boolean>

onLayoutRestore

  • onLayoutRestore(listener: function): Promise<boolean>
  • Registers a listener that is called whenever a layout is restored.

    Note: These callbacks should be used for informative purposes only. To register a callback that will perform the actual restoration, use onAppRestore.

    Parameters

    • listener: function

    Returns Promise<boolean>

onLayoutSave

  • onLayoutSave(listener: function): Promise<boolean>
  • Registers a listener that is called whenever a layout is generated.

    Note: These callbacks should be used for informative purposes only. To register a callback that will serialize an applications state, use onApplicationSave.

    Parameters

    • listener: function
        • Parameters

          Returns void

    Returns Promise<boolean>

ready

  • Send this to the service when you have registered all routes after registration.

    When restoring a layout, the service will refrain from passing the saved layout to the application (via the onAppRestore 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.

    Returns Promise<Layout>

restoreLayout

  • Takes a layout created by generateLayout 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 layout 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

    Parameters

    Returns Promise<Layout>