import * as GoldenLayout from "golden-layout"; import * as React from "react"; import { ItemVisitor, IWorkbenchPlace } from "./types"; /** * Capitalizes the all-lowercase variants of events officially supported by * `golden-layout`. */ export declare function capitalizeEventName(eventName: string | symbol): string | symbol; /** * Extracts the component IDs from the given content item if it represents * a component in a layout. */ export declare function extractIdsFromContentItem(item: GoldenLayout.ContentItem): string[]; /** * Extracts the size of the component from the given content item. * * @param {GoldenLayout.ContentItem} item the item to extract the size from * @return the size of the item, given as an array of length 2 (width and height) */ export declare function extractSizeFromContentItem(item: GoldenLayout.ContentItem): [number, number]; /** * Finds the largest visible panel in the given layout. */ export declare function findLargestVisiblePanel(tree: GoldenLayout): GoldenLayout.ContentItem | undefined; export declare function getDisplayName(component: React.ElementType): string | undefined; /** * Returns whether the given content item is a container (and not a panel). */ export declare function isContainer(item: GoldenLayout.ContentItem | GoldenLayout.ItemConfigType): boolean; export declare function isElementClassEqualTo

(cls: React.ComponentClass

, element: React.ReactNode): element is React.ReactElement

; export declare function isReactSFC(obj: any): boolean; /** * Takes an item visitor function and returns another one that will traverse * only the part of the workbench that is currently visible (and not hidden * in unselected panels of a content stack). * * The converted function will also skip any non-initialized parts of the * workbench. * * @param {ItemVisitor} func the visitor function to convert * @return {ItemVisitor} the converted function */ export declare function onlyVisible(func: ItemVisitor): ItemVisitor; /** * Proposes a location for a new item in the layout. * * The function will find the largest visible panel in the layout and then * it will attempt to split the panel in half. */ export declare function proposePlaceForNewItemInLayout(tree: GoldenLayout): IWorkbenchPlace; /** * Given an array of items and a single item, creates a copy of the array * and then adds the item to the copy if it is not in the array yet, * removes the item otherwise. * * @param {T[]} items the item array * @param {T} item the single item to add to or remove from the array * @return {T[]} the modified array */ export declare function toggle(items: T[], item: T): T[]; /** * Calls the given item visitor function for each content item in the * given layout, pruning branches where the visitor function tells the * traversal process to stop. * * @param {GoldenLayout} tree the tree to traverse * @param {ItemVisitor} func the visitor function to call on each visited item */ export declare function traverseWorkbench(tree: GoldenLayout, func: ItemVisitor): void; export interface IWrappedComponent { wrappedComponent: React.ComponentType; } /** * Function that takes a React stateless functional component and wraps it in * an equivalent React stateful component class to ensure that it is handled * correctly by `react-flexible-workbench`. * * @param {React.SFC} func the stateless functional component to wrap * @return {WrappedSFC} the wrapped React component */ export declare function wrapInComponent(func: (props: T) => React.ReactElement): React.ComponentClass & IWrappedComponent;