import type * as OpenFin from '../../../../OpenFin'; import type { LayoutContentCache } from './layout-content-cache'; type ViewCreationOrReference = OpenFin.Identity | OpenFin.PlatformViewCreationOptions; /** * @internal * Controller for the layout entities apis, allowing alterations to be applied * to an instance of layout manager in a structured manner. */ export declare class LayoutEntitiesController { private layoutManager; private layoutContentCache; private wire; constructor(layoutManager: any, layoutContentCache: LayoutContentCache); private analytics; /** * @internal * @returns the root contentItem of the layout. */ getRoot: () => OpenFin.LayoutEntityDefinition; /** * @internal * Retrieves the containing stack of a given view identity. * @param view Identity of the view to retrieve the stack of. * @returns Stack containing the given view. * @throws If the view does not belong to a stack within the layout manager. */ getStackByView: (view: OpenFin.Identity) => Promise; /** * @internal * Returns all views belonging to a given stack * * NOTE: Due to (TODO: ticket) Golden Layouts has an issue which changes the order of tabs * when the amount of new views to add overflows the width of the container. This results * in tabs being re-ordered in the UI, while the underlying content item array remains in the * original order specified. So calling getStackViews() will return this underlying array order, * with indexes that will not match up to the render-order of the tabs. * * @param id - Entity id of the stack. * @returns A list of view identities in order of appearance. * @throws if the content item associated with the entity id does not exist or is not a stack. */ getStackViews: (id: string) => OpenFin.Identity[]; /** * @internal * Retrieves the content of a column or row and adds each to the * entity cache to allow them to be addressed externally. * @param id Entity id of the Column Or Row to retrieve the content of. * @returns Array of layout entity definitions * @throws if the entity associated with {@link id} is not in the entity cache, does not belogn to a layout, or is not a column/row. */ getContent(id: string): OpenFin.LayoutEntityDefinition[]; /** * @internal * Retrieves the parent content item of the given entity, and adds it to the entity cache * so it can be addressed externally. * @param id Entity id associated with a layout content item. * @returns An entity definition for the given entity's parent, or undefined if the entity is the top level * content item or has been removed from the layout entirely. */ getParent(id: string): OpenFin.LayoutEntityDefinition | undefined; /** * @internal * @param id Entity id associated with a layout content item. * @returns true if the given entity is the root content item, false otherwise. */ isRoot: (id: string) => boolean; /** * @internal * Checks whether the given entity exists. * @param entityId Id of a content item within the layout * @returns True if the content item exists and belongs to the layout. */ exists: (entityId: string) => boolean; /** * @internal * Adds an existing view to the stack, or creates and adds a view to the given stack. * * NOTE: Due to (TODO: ticket) Golden Layouts has an issue which changes the order of tabs * when the amount of new views to add overflows the width of the container. This results * in tabs being re-ordered in the UI, while the underlying content item array remains in the * original order specified. So calling getStackViews() will return this underlying array order, * with indexes that will not match up to the render-order of the tabs. * * @param stackEntityId Entity id of the stack content item within the layout. * @param viewCreationOrReference View identity or creation options * @param 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 resolving with the identity of the newly added view. * @throws If the view does not exist, fails to create, or the stack does not exist. */ addViewToStack: (stackEntityId: string, viewCreationOrReference: ViewCreationOrReference, { index }?: OpenFin.AddViewToStackOptions) => Promise; private findViewInStack; /** * @internal * Removes a view from the given stack. If it's the only view, the stack will be destroyed, unless window creation * option closeOnLastViewRemoved is set to false. * * @param stackEntityId Entity id of a stack content item to remove the view from. * @param view Identity of the view to remove. * @throws If the stack does not exist or the view does not exist or belong to the stack. */ removeViewFromStack: (stackEntityId: string, view: OpenFin.Identity) => Promise; /** * @internal * Creates a new adjacent 'stack' and adds the views to it at the specified position * @param targetId Entity id of the content item to add a stack adjacent to it * @param views List of identities or view creation options of the views to include in the stack * @param options Creation options, defaults to { position: 'right' } * @returns the Entity Id of the new stack */ createAdjacentStack: (targetId: string, views: ViewCreationOrReference[], { position }?: { position?: OpenFin.LayoutPosition; }) => Promise; getAdjacentStacks: ({ targetId, edge }: { targetId: string; edge: OpenFin.LayoutPosition; }) => Promise[]>; setStackActiveView: (stackEntityId: string, viewIdentity: OpenFin.Identity) => Promise; } export {};