import { AdaptableColumn, ColumnSort, PivotLayout, TableLayout } from '../../types';
import { ExtendedLayout } from '../AdaptableState/Common/ExtendedLayout';
import { LayoutState, Layout } from '../AdaptableState/LayoutState';
/**
 * Provides run-time access to the Layout Module and associated state
 */
export interface LayoutApi {
    /**
     * Retrieves Layout section from Adaptable State
     */
    getLayoutState(): LayoutState;
    /**
     * Sets (i.e. selects) the Layout
     * @param layoutName Layout to set (has to be name of existing Layout)
     */
    setLayout(layoutName: string): void;
    /**
     * Retrieves Current Layout from Layout State
     * @returns layout
     */
    getCurrentLayout(): Layout;
    /**
     * Returns true if current Layout is a Pivot Layout
     */
    isCurrentLayoutPivot(): boolean;
    /**
     * Retrieves the sort order of a column from the current layout
     * @param columnId Column id
     */
    getCurrentLayoutColumnSort(columnId: string): ColumnSort['SortOrder'] | null;
    /**
     * Retrieves map with visible columns in current Table Layout
     */
    getCurrentVisibleColumnIdsMapForTableLayout(): {
        [key: string]: boolean;
    };
    /**
     * Retrieves array of visible ColumnIds in current Table Layout
     */
    getCurrentVisibleColumnIdsForTableLayout(): string[];
    /**
     * Retrieves array of visible ColumnIds in current Pivot Layout
     */
    getCurrentVisibleColumnIdsForPivotLayout(): string[];
    /**
     * Retrieves array of visible ColumnIds in current Layout
     */
    getCurrentRowGroupsColumnIds(): string[];
    /**
     * Retrieves name of current Layout
     */
    getCurrentLayoutName(): string;
    /**
     * Retrieves Layout with the given name
     * @param layoutName Layout to retrieve
     * @returns layout
     */
    getLayoutByName(layoutName: string): Layout | null;
    /**
     * Sets (i.e. selects) the Extended Layout
     * @param extendedLayout Extended Layout to set
     */
    setExtendedLayout(extendedLayout: ExtendedLayout): void;
    /**
     *
     * Retrieves Layout with the given name
     * @param layoutName Layout to retrieve
     * @returns layout
     */
    getExtendedLayoutByName(layoutName: string): ExtendedLayout | undefined;
    /**
     * Creates (or Updates) an Extended Layout
     * @param extendedLayout ExtendedLayout to Create
     */
    createOrUpdateExtendedLayout(extendedLayout: ExtendedLayout): void;
    /**
     * Clones an Extended Layout
     * @param extendedLayoutToClone ExtendedLayout to Clone
     * @param layoutName New name for Layout being cloned
     */
    cloneExtendedLayout(extendedLayoutToClone: ExtendedLayout, layoutName: string): ExtendedLayout | false;
    /**
     * Retrieves all Layouts in Adaptable State
     * @returns layouts
     */
    getLayouts(): Layout[];
    /**
     * Retrieves Layout by by the technical ID (from `LayoutState`)
     * @param id Layout id
     * @returns layout
     */
    getLayoutById(id: Layout['Uuid']): Layout;
    /**
     * Saves current Layout - using column order, visibility, sorting etc. currently in use in the grid
     */
    saveCurrentLayout(): void;
    /**
     * Creates new Layout into Adaptable State or updates an existing Layout (with same name or id)
     * @param layout the Layout to create or update
     */
    createOrUpdateLayout(layout: Layout): void;
    /**
     * Updates current Layout using the partial Layout props provided in a function
     * @param updateFn a function which returns a full Layout
     */
    updateCurrentLayout(updateFn: (layout: TableLayout | PivotLayout) => TableLayout | PivotLayout): void;
    /**
     * Creates a new Layout
     * @param layoutToCreate Layout to create
     * @returns created Layout object or `false` if Layout with the same name/Uuid already exists
     */
    createLayout(layoutToCreate: Layout): Layout | false;
    /**
     * Creates new Layout and loads it into Grid
     * @param layoutToCreate Layout to create
     * @returns created Layout object or `false` if creation failed
     */
    createAndSetLayout(layoutToCreate: Layout): Layout | false;
    /**
     * Creates new Layout by cloning a given Layout
     * @param layoutToClone Layout to clone
     * @param layoutName name of new Layout
     * @returns created Layout object or `false` if creation failed
     */
    cloneLayout(layoutToClone: Layout, layoutName: string): Layout | false;
    /**
     * Creates new Layout by cloning a given Layout and then loads it into Grid
     * @param layoutToClone Layout to clone
     * @param layoutName name to use for new Layout
     * @returns created Layout object or `false` if creation failed
     */
    cloneAndSetLayout(layoutToClone: Layout, layoutName: string): Layout | false;
    /**
     * Checks whether this Layout exists in the Adaptable State (by comparing Uuid property)
     * @param layout Layout to check
     */
    doesLayoutExist(layout: Layout): boolean;
    /**
     * Opens Settings Panel with Layout section selected
     */
    openLayoutSettingsPanel(): void;
    /**
     * Opens Layout Editor - for Current or a named Layout
     * @param layoutName Name of Layout to be edited or cloned; if not specified, uses Current Layout
     * @param action Whether to edit, clone, or create a new Layout
     */
    showLayoutEditor(layoutName?: string, layoutType?: 'table' | 'pivot', 
    /**
     * @defaultValue 'Edit'
     */
    action?: 'New' | 'Clone' | 'Edit'): void;
    /**
     * Sets a new Caption / Header for a Column (only for current Layout)
     * @param columnId Column to Update
     * @param caption New Caption to display
     */
    setColumnCaption(columnId: string, caption: string): void;
    /**
     * Deletes an existing Layout (if not Default or only existing Layout)
     * @param layout The Layout to delete
     */
    deleteLayout(layout: Layout): void;
    /**
     * Deletes an existing Layout provided by Name (if not Default or only existing Layout)
     * @param layout Name of the Layout to delete
     */
    deleteLayoutByName(layoutName: string): void;
    /**
     * Opens Change Column Caption popup
     * @param column Column to open Popup for
     */
    showChangeColumnCaption(column: AdaptableColumn): void;
    /**
     * Removes a Column from Current Table or Pivot Layout
     * @param columnId Column to remove
     */
    removeColumnFromCurrentLayout(columnId: string): void;
    /**
     * Adds a Column to Current Table or Pivot Layout
     * @param columnId Column to add
     */
    addColumnToCurrentLayout(columnId: string): void;
}
