import type * as OpenFin from '../../../../OpenFin'; import { LayoutEntitiesClient } from '../shapes'; /** * @ignore * @internal * Supplies an ApiClient for {@link LayoutEntitiesController} and helper methods * for the entities {@link TabStack} AND {@link ColumnOrRow} to use. */ export declare abstract class LayoutNode { #private; /** * @internal * @ignore */ protected constructor(client: LayoutEntitiesClient, entityId: string); abstract readonly type: OpenFin.LayoutEntityTypes; /** * @internal * @ignore * This instance's unique id used when calling the layout-entities-controller api client */ protected readonly entityId: string; /** * @ignore * @internal * Encapsulates Api consumption of {@link LayoutEntitiesController} with a relayed dispatch * @param client * @param controllerId * @param identity * @returns a new instance of {@link LayoutEntitiesClient} with bound to the controllerId */ static newLayoutEntitiesClient: (client: OpenFin.ChannelClient, controllerId: string, identity: OpenFin.Identity) => Promise; static getEntity: (definition: OpenFin.LayoutEntityDefinition, client: LayoutEntitiesClient) => ColumnOrRow | TabStack; isRoot: () => Promise; exists: () => Promise; getParent: () => Promise; createAdjacentStack: (views: OpenFin.PlatformViewCreationOptions[], options: { position?: OpenFin.LayoutPosition; }) => Promise; getAdjacentStacks: (edge: OpenFin.LayoutPosition) => Promise; } /** * @typedef {string} LayoutPosition * @summary Represents the position of an item in a layout relative to another. Possible values are 'top', 'bottom', 'left' and 'right'. */ /** * @typedef {object} StackCreationOptions * @summary Stack creation options. * @property {LayoutPosition} [position] - The position to create the new {@link TabStack} in, relative to the given adjacent {@link TabStack}. Defaults to 'right'. */ /** * @typedef {object} TabStack~AddViewOptions * @summary Options to use when adding a view to a {@link TabStack} * @property {number} [index] - Insertion index when adding the view. Defaults to 0. */ /** * A TabStack is used to manage the state of a stack of tabs within an OpenFin Layout. */ export declare class TabStack extends LayoutNode { #private; /** * Determines if this {@link TabStack} is the top level content item in the current layout. * @function isRoot * @memberof TabStack * @instance * @tutorial TabStack.isRoot * @return {Promise} Resolves true if this TabStack is the top level content item, or false if it is not. */ /** * Determines if this {@link TabStack} exists. * @function exists * @instance * @memberof TabStack * @tutorial TabStack.exists * @return {Promise} Resolves true if this is the TabStack exists, or false if it has been destroyed. */ /** * Retrieves the parent {@link ColumnOrRow} of this {@link TabStack}, if one exists. * @function getParent * @instance * @memberof TabStack * @tutorial TabStack.getParent * @return {Promise} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link TabStack} is the root content item or does not exist. */ /** * Returns all the adjacent stacks that share an edge with the given {@link TabStack}. * @function getAdjacentStacks * @instance * @memberof TabStack * @param {LayoutPosition} edge - Edge to check for any adjacent stacks. * @returns {Promise} * @tutorial TabStack.getAdjacentStacks */ /** * Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the current {@link TabStack} * * Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active * during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged. * This means the views you pass to createAdjacentStack() may not render in the order given by the array. * Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack. * * @function createAdjacentStack * @instance * @memberof TabStack * @param {View~options} views - List of identities or view creation options of the views to include in the stack * @param {StackCreationOptions} options - Creation options. * @returns {Promise} The created TabStack. * @tutorial TabStack.createAdjacentStack * @experimental */ /** @internal */ constructor(client: LayoutEntitiesClient, entityId: string); /** * Type of the content item. Always stack, but useful for distinguishing between a {@link TabStack} and {@link ColumnOrRow}. */ readonly type = "stack"; /** * Retrieves a list of all views belonging to this {@link TabStack}. * * Known Issue: If adding a view overflows the tab-container width, the added view will be set as active * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged. * If that happens and then getViews() is called, it will return the identities in a different order than * than the currently rendered tab order. * * @returns {Promise} Resolves with a list containing the {@link OpenFin.Identity identities} of each view belonging to the {@link TabStack}. * @throws If the {@link TabStack} has been destroyed. * @tutorial TabStack.getViews * @experimental */ getViews: () => Promise; /** * Adds or creates a view in this {@link TabStack}. * * Known Issue: If adding a view overflows the tab-container, the added view will be set as active * and rendered at the front of the tab-stack, while the underlying order of tabs will remain unchanged. * * @param {View~options} view The identity of an existing view to add, or options to create a view. * @param {TabStack~AddViewOptions} options Optional view options: index number used to insert the view into the stack at that index. Defaults to 0 (front of the stack) * @returns {Promise} Resolves with the {@link OpenFin.Identity identity} of the added view. * @throws If the view does not exist or fails to create. * @throws If the {@link TabStack} has been destroyed. * @tutorial TabStack.addView * @experimental */ addView: (view: OpenFin.Identity | OpenFin.PlatformViewCreationOptions, options?: OpenFin.AddViewToStackOptions) => Promise; /** * Removes a view from this {@link TabStack}. * @param {Identity} view - Identity of the view to remove. * @throws If the view does not exist or does not belong to the stack. * @throws If the {@link TabStack} has been destroyed. * @return {Promise} * @tutorial TabStack.removeView */ removeView: (view: OpenFin.Identity) => Promise; /** * Sets the active view of the {@link TabStack} without focusing it. * @param {Identity} view - Identity of the view to activate. * @returns {Promise} Promise which resolves with void once the view has been activated. * @throws If the {@link TabStack} has been destroyed. * @throws If the view does not exist. * @tutorial TabStack.setActiveView * @experimental */ setActiveView: (view: OpenFin.Identity) => Promise; } /** * A ColumnOrRow is used to manage the state of Column and Rows within an OpenFin Layout. */ export declare class ColumnOrRow extends LayoutNode { #private; /** * Determines if this {@link ColumnOrRow} is the top level content item in the current layout. * @function isRoot * @memberof ColumnOrRow * @instance * @tutorial ColumnOrRow.isRoot * @return {Promise} Resolves true if this TabStack is the top level content item, or false if it is not. */ /** * Determines if this {@link ColumnOrRow} exists. * @function exists * @instance * @memberof ColumnOrRow * @tutorial ColumnOrRow.exists * @return {Promise} Resolves true if the TabStack exists, or false if it has been destroyed. */ /** * Retrieves the parent {@link ColumnOrRow} of this {@link ColumnOrRow}, if one exists. * @function getParent * @instance * @memberof ColumnOrRow * @tutorial ColumnOrRow.getParent * @return {Promise} Promise resolving with the {@link ColumnOrRow} that contains this item, or undefined if this {@link ColumnOrRow} does not exist or is the root content item. */ /** * Returns all the adjacent stacks that share an edge with the given {@link ColumnOrRow}. * @function getAdjacentStacks * @instance * @memberof ColumnOrRow * @param {LayoutPosition} edge - Edge to check for any adjacent stacks. * @returns {Promise} * @tutorial ColumnOrRow.getAdjacentStacks */ /** * Given a list of view creation options or references and a layout position, creates a {@link TabStack} adjacent to the given {@link ColumnOrRow} * * Known Issue: If the number of views to add overflows the tab-container, the added views will be set as active * during each render, and then placed at the front of the tab-stack, while the underlying order of tabs will remain unchanged. * This means the views you pass to createAdjacentStack() may not render in the order given by the array. * Until fixed, this problem can be avoided only if your window is wide enough to fit creating all the views in the tabstack. * * @function createAdjacentStack * @instance * @memberof ColumnOrRow * @param {View~options} views - List of identities or view creation options of the views to include in the stack * @param {StackCreationOptions} options - Creation options. * @returns {Promise} The created TabStack * @tutorial ColumnOrRow.createAdjacentStack * @experimental */ /** * @internal */ constructor(client: LayoutEntitiesClient, entityId: string, type: 'row' | 'column'); /** * The type of this {@link ColumnOrRow}. Either 'row' or 'column'. */ readonly type: 'column' | 'row'; /** * Retrieves a list of all content items belonging to this {@link ColumnOrRow} in order of appearance. * @returns {Promise>} Resolves with a list containing {@link ColumnOrRow} and {@link TabStack} items belonging to this {@link ColumnOrRow}. * @tutorial ColumnOrRow.getContent */ getContent: () => Promise<(ColumnOrRow | TabStack)[]>; }