Skip to main content
Access via:io.layouts

Layouts API.

23 Methods

clearDefaultGlobal()⚓︎

() => Promise<void>

Removes the default Global Layout.

export()⚓︎

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

Returns a collection of all available Layout objects of the provided type.

Parameters (1)

Name Type Required Description
layoutType⚓︎ LayoutType x

get()⚓︎

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

Fetches a saved Layout if a Layout with the provided name and type exists.

Parameters (2)

Name Type Required Description
name⚓︎ string

Name of the Layout to fetch.

type⚓︎ LayoutType

Type of the Layout to fetch.

getAll()⚓︎

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

Returns a lightweight description of all Layouts of the provided type, without the extensive objects describing the Layout components.

Parameters (1)

Name Type Required Description
type⚓︎ LayoutType

Type of the Layouts to fetch.

getCurrentLayout()⚓︎

() => Promise<Layout | undefined>

Retrieves the current Global Layout. This is either the last restored Global Layout, or the last saved Global Layout that has been set as the current Global Layout.

io.Connect Browser 4.0

getDefaultGlobal()⚓︎

() => Promise<Layout | undefined>

Retrieves the default Global Layout, if any.

getGlobalTypeState()⚓︎

() => Promise<{ activated: boolean }>

Checks whether Global Layouts are activated in the io.Connect Browser environment.

getMultiScreenPermissionState()⚓︎

() => Promise<{ state: "prompt" | "granted" | "denied" }>

Retrieves the browser Multi-Screen Window Placement permission state for the io.Connect Browser environment.

import()⚓︎

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

Imports a collection of Layout objects.

Parameters (2)

Name Type Required Description
layouts⚓︎ Layout[]

An array of Layout objects to be imported.

mode⚓︎ ImportMode x

If "replace" (default), all existing Layouts will be removed. If "merge", the Layouts will be added to the existing ones.

onAdded()⚓︎

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

Notifies when a new Layout is added.

Parameters (1)

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

Callback function to handle the event. Receives the Layout object as an argument and returns an unsubscribe function.

onChanged()⚓︎

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

Notifies when a Layout is modified.

Parameters (1)

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

Callback function to handle the event. Receives the Layout object as an argument and returns an unsubscribe function.

onDefaultGlobalChanged()⚓︎

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

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

io.Connect Browser 4.0

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.

onRemoved()⚓︎

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

Notifies when a Layout is removed.

Parameters (1)

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

Callback function to handle the event. Receives the Layout object as an argument and returns an unsubscribe function.

onRenamed()⚓︎

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

Notifies when a Layout is renamed. Returns an unsubscribe function.

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 argument an object with a name property holding the previous Layout name.

onRestored()⚓︎

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

Notifies when a Layout is restored.

io.Connect Browser 4.0

Parameters (1)

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

Callback function for handling the event. Receives as an argument the Layout object that was restored.

onSaveRequested()⚓︎

(callback: (info?: SaveRequestContext) => SaveRequestResponse) => () => void

Notifies when a Layout save operation is requested. Returns an unsubscribe function.

Parameters (1)

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

Callback function for handling the event. The callback must return a SaveRequestResponse object containing context to be saved for the current window when the Layout is saved. When the Layout is saved and the ignoreContexts property of the NewLayoutOptions object is set to true, the returned context will be ignored.

remove()⚓︎

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

Removes a Layout.

Parameters (2)

Name Type Required Description
type⚓︎ LayoutType

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.

requestMultiScreenPermission()⚓︎

() => Promise<{ permissionGranted: boolean }>

Opens the browser permission prompt requesting Multi-Screen Window Placement permission from the user for the io.Connect Browser environment. This can only be requested from the Main app (Web Platform) due to the transient activation restrictions of the browsers.

restore()⚓︎

(options: RestoreOptions) => Promise<void>

Restores a Layout.

Parameters (1)

Name Type Required Description
options⚓︎ RestoreOptions

Options for restoring 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 Global Layout to set as default.

updateMetadata()⚓︎

(layout: Layout) => Promise<void>

Updates the metadata of a Layout.

Parameters (1)

Name Type Required Description
layout⚓︎ Layout

Existing Layout to update.