import type * as OpenFin from '../../../OpenFin'; import { Base } from '../../base'; import { Layout } from './Instance'; type InitLayoutOptions = OpenFin.InitLayoutOptions; /** * @PORTED * InitLayoutOptions interface * @typedef { object } InitLayoutOptions * @property { string } [containerId] The id attribute of the container where the window's Layout should be initialized. If not provided * then an element with id `layout-container` is used. We recommend using a div element. */ /** * @PORTED * PresetLayoutOptions interface * @typedef { object } PresetLayoutOptions * @property { LayoutPresetTypes } presetType Which preset layout arrangement to use. * The preset options are `columns`, `grid`, `rows`, and `tabs`. */ /** * LayoutConfig interface * @typedef { object } LayoutConfig * @property { Array } content Content of the layout. There can only be one top-level LayoutItem in the content array. * We do not recommend trying to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} * or our {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }. * @property { LayoutSettings } settings Configuration for certain Layout behaviors. See the LayoutSettings interface. */ /** * @PORTED * LayoutItem Interface * @typedef { object } LayoutItem Represents the arrangement of Views within a Platform window's Layout. We do not recommend trying * to build Layouts or LayoutItems by hand and instead use calls such as {@link Platform#getSnapshot getSnapshot} or our * {@link https://openfin.github.io/golden-prototype/config-gen Layout Config Generation Tool }. * @property { string } type The type of the item. Possible values are 'row', 'column', 'stack', and 'component'. * @property { Array } [content] An array of configurations for items that will be created as children of this item. * @property { string } [componentName] Only a `component` type will have this property and it should be set to `view`. * @property { View~options } [componentState] Only a `component` type will have this property and it represents the view * options of a given component. */ /** * @PORTED * LayoutSettings Interface * @typedef { object } LayoutSettings Represents a potential ways to customize behavior of your Layout * @property { boolean } [constrainDragToHeaders=false] Limits the area to which tabs can be dragged. * If true, stack headers are the only areas where tabs can be dropped. * @property { boolean } [hasHeaders=true] Turns tab headers on or off. * If false, the layout will be displayed with splitters only. * @property {object} [newTabButton] * Configuration of the Plus button that appears on each tabstrip. Upon pressing, a new tab * will be added to the tabstrip with the specified url. * @property {string} [newTabButton.url] Specifies the url that opens in the tab created upon pressing the button. * @property { boolean } [popoutWholeStack=false] Whether the popout button will only act on the entire stack, * as opposed to only the active tab. * @property { boolean } [preventDragIn=false] If true, tabs can't be dragged into the window. * @property { boolean } [preventDragOut=false] If true, tabs can't be dragged out of the window. * @property { boolean } [preventSplitterResize=false] If true, tab contents can't be resized by the user. * @property { boolean } [reorderEnabled=true] If true, the user can re-arrange the layout by * dragging items by their tabs to the desired location. * @property { boolean } [showCloseIcon=false] Whether to show the close button on stack header * (not to be confused with close button on every tab). * @property { boolean } [showMaximiseIcon=false] Whether to show the maximize button on stack header. * The button will maximize the current tab to fill the entire window. * @property { boolean } [showPopoutIcon=false] Whether to show the popout button on stack header. * The button will create a new window with current tab as its content. * In case `popoutWholeStack` is set to true, all tabs in the stack will be in the new window. */ /** * @lends Platform#Layout */ export declare class LayoutModule extends Base { #private; /** * Asynchronously returns a Layout object that represents a Window's layout. * @param { Identity } identity * @return {Promise.} * @tutorial Layout.wrap * @static */ wrap(identity: OpenFin.Identity): Promise; /** * Synchronously returns a Layout object that represents a Window's layout. * @param { Identity } identity * @return {Layout} * @tutorial Layout.wrapSync * @static */ wrapSync(identity: OpenFin.Identity): OpenFin.Layout; /** * Asynchronously returns a Layout object that represents a Window's layout. * @return {Promise.} * @tutorial Layout.getCurrent * @static */ getCurrent(): Promise; /** * Synchronously returns a Layout object that represents a Window's layout. * @return {Layout} * @tutorial Layout.getCurrentSync * @static */ getCurrentSync(): OpenFin.Layout; /** * Initialize the window's Layout. Must be called from a custom window that has a 'layout' option set upon creation of that window. * If a containerId is not provided, this method attempts to find an element with the id `layout-container`. * A Layout will emit events locally on the DOM element representing the layout-container. * In order to capture the relevant events during Layout initiation, set up the listeners on the DOM element prior to calling `init`. * @param { InitLayoutOptions } [options] - Layout init options. * @return { Promise } * @static * @experimental * @tutorial Layout.init */ init: (options?: InitLayoutOptions) => Promise; } export {};