Skip to main content
Access via:io.layouts

Layouts API.

29 Methods

clearDefaultGlobal()⚓︎

() => Promise<void>

Removes the default Global Layout.

export()⚓︎

(layoutType?: LayoutType) => Promise<Layout[]>

Retrieves all available Layouts.

Parameters (1)

Name Type Required Description
layoutType⚓︎ LayoutType x

Type of the Layouts to retrieve.

forceRefresh()⚓︎

() => Promise<void>

Forces a refresh of the connection to io.Manager or any other REST Layout stores, updating the list of available Layouts.

get()⚓︎

(name: string, type: LayoutType) => Promise<Layout | undefined>

Retrieves a Layout.

Parameters (2)

Name Type Required Description
name⚓︎ string

Name of the Layout to retrieve.

type⚓︎ LayoutType

Type of the Layout to retrieve.

getAll()⚓︎

(type: LayoutType) => Promise<LayoutSummary[]>

Retrieves a lightweight, summarized version of all Layouts of the provided type.

Parameters (1)

Name Type Required Description
type⚓︎ LayoutType

Type of the Layouts whose summaries to retrieve.

getCurrentLayout()⚓︎

() => Promise<Layout | undefined>

Retrieves the last restored Global Layout.

getDefaultGlobal()⚓︎

() => Promise<Layout | undefined>

Retrieves the default Global Layout, if any.

getRestoredLayoutsInfo()⚓︎

() => Promise<GetRestoredLayoutsInfoResult | undefined>

Retrieves info about the currently active Layout (ID, type, name, participating app instances), as well as about any previously active Layouts that still have running instances of their participating apps.

hibernate()⚓︎

(name: string, options?: HibernationOptions) => Promise<HibernateResult>

Hibernates a Layout.

Parameters (2)

Name Type Required Description
name⚓︎ string

Name of the Layout to hibernate.

options⚓︎ HibernationOptions x

Options for hibernating a Layout.

import()⚓︎

(layouts: Layout[], mode?: ImportMode) => Promise<ImportLayoutResult>

Imports one or more Layouts.

Parameters (2)

Name Type Required Description
layouts⚓︎ Layout[]

Array of Layouts to import.

mode⚓︎ ImportMode x

Mode for importing the Layouts.

list()⚓︎

() => Layout[]

Retrieves a list of all Layouts.

onAdded()⚓︎

(callback: (layout: Layout) => void) => UnsubscribeFunction

Notifies when a new Layout is added.

Parameters (1)

Name Type Required Description
callback⚓︎ (layout: Layout) => void

Callback function for handling the event.

onChanged()⚓︎

(callback: (layout: Layout) => void) => UnsubscribeFunction

Notifies when a Layout is changed.

Parameters (1)

Name Type Required Description
callback⚓︎ (layout: Layout) => void

Callback function for handling the event.

onDefaultGlobalChanged()⚓︎

(callback: (layout?: { name: string }) => void) => UnsubscribeFunction

Notifies when a new default Global Layout has been selected or when the current one has been cleared.

Parameters (1)

Name Type Required Description
callback⚓︎ (layout?: { name: string }) => void

Callback function for handling the event. Receives as an argument an object with a name property holding the name of the newly selected default Global Layout. If the default Global Layout has been cleared, the argument will be undefined.

onLayoutModified()⚓︎

This event will be raised the first time the currently loaded global layout has been modified. Modified means that the layout has been changed:

  • an app has been started or stopped
  • an app has ben moved
  • a workspace that is part of the layout has been modified This event can be used to mark the layout as dirty. This event will be raised only the first time the layout is modified. A second modification won't raise the event again. Saving the layout will reset that and the event will be raised again the next time the layout is modified.

Parameters (1)

Name Type Required Description
callback⚓︎ (info: LayoutModifiedEvent) => SaveRequestResponse

Callback function for handling the event.

onRemoved()⚓︎

(callback: (layout: Layout) => void) => UnsubscribeFunction

Notifies when a Layout is removed.

Parameters (1)

Name Type Required Description
callback⚓︎ (layout: Layout) => void

Callback function for handling the event.

onRenamed()⚓︎

(callback: (layout: Layout, previous: { name: string }) => void) => UnsubscribeFunction

Notifies when a Layout is renamed.

Parameters (1)

Name Type Required Description
callback⚓︎ (layout: Layout, previous: { name: string }) => void

Callback function for handling the event. Receives as a first argument the Layout object describing the renamed Layout. Receives as a second optional argument an object with a name property holding the previous Layout name (if any).

onRestored()⚓︎

(callback: (Layout: Layout) => void) => UnsubscribeFunction

Notifies when a Layout is restored.

Parameters (1)

Name Type Required Description
callback⚓︎ (Layout: Layout) => void

Callback function for handling the event.

onSaveRequested()⚓︎

Notifies when a Layout save is requested.

Parameters (1)

Name Type Required Description
callback⚓︎ (info?: SaveRequestContext) => SaveRequestResponse

Callback function for handling the event.

remove()⚓︎

(type: string, name: string) => Promise<void>

Removes a Layout

Parameters (2)

Name Type Required Description
type⚓︎ string

Type of the Layout to remove.

name⚓︎ string

Name of the Layout to remove.

rename()⚓︎

(layout: Layout, newName: string) => Promise<LayoutResult>

Renames a Layout.

Parameters (2)

Name Type Required Description
layout⚓︎ Layout

Existing Layout to rename.

newName⚓︎ string

New name for the Layout.

reset()⚓︎

(options: ResetLayoutOptions) => Promise<RestoreResumeResult>

Resets a Layout.

Parameters (1)

Name Type Required Description
options⚓︎ ResetLayoutOptions

Options for resetting a Layout.

restore()⚓︎

(options: RestoreOptions) => Promise<RestoreResumeResult>

Restores a Layout.

Parameters (1)

Name Type Required Description
options⚓︎ RestoreOptions

Options for restoring a Layout.

resume()⚓︎

(name: string, context?: any, options?: ResumeOptions) => Promise<RestoreResumeResult>

Resumes a Layout.

Parameters (3)

Name Type Required Description
name⚓︎ string

Name of the Layout to resume.

context⚓︎ any x

Context for the Layout.

options⚓︎ ResumeOptions x

Options for resuming a Layout.

save()⚓︎

(layout: NewLayoutOptions) => Promise<Layout>

Saves a new Layout.

Parameters (1)

Name Type Required Description
layout⚓︎ NewLayoutOptions

Options for saving a Layout.

setDefaultGlobal()⚓︎

(name: string) => Promise<void>

Sets a new default Global Layout.

Parameters (1)

Name Type Required Description
name⚓︎ string

Name of the Layout to set as the new default Global Layout.

updateAppContextInCurrent()⚓︎

(context: object) => Promise<void>

Updates the context saved for your app in the currently loaded Layout.

Parameters (1)

Name Type Required Description
context⚓︎ object

New context for the app.

updateDefaultContext()⚓︎

(context: object) => Promise<LayoutResult>

Updates the context that will be saved as a default context for the current window.

Parameters (1)

Name Type Required Description
context⚓︎ object

New context that will be saved as a default window context.

updateMetadata()⚓︎

(layout: Layout) => Promise<void>

Updates the metadata of a Layout.

Parameters (1)

Name Type Required Description
layout⚓︎ Layout

Existing Layout to update.