/**
 * Defines how a Column is sorted
 */
export interface ColumnSortModel {
    /**
     * Id of Column being sorted
     */
    ColumnId: string;
    /**
     * How Column is sorted - either 'Asc' or 'Desc'
     */
    SortOrder: 'Asc' | 'Desc';
}
export interface BaseLayoutModel {
    /**
     * Those are not actually used by the LayoutManager,
     * but we need to keep them here so we can give the layout
     * fully specified back to Adaptable, with this prop
     * set as it was when we received it from Adaptable
     */
    ColumnFilters?: any;
    /**
     * Same as ColumnFilters, but for Grid Filter
     */
    GridFilter?: any;
    ColumnVisibility?: {
        [columnId: string]: false;
    };
    /**
     * Set of widths for some (or all columns)
     */
    ColumnWidths?: {
        [columnId: string]: number;
    };
    /**
     * Behaviour for Expanding / Collapsing Row Groups
     */
    RowGroupValues?: {
        RowGroupDisplay: 'always-expanded';
    } | {
        RowGroupDisplay: 'expanded';
        Values: any[][];
    } | {
        RowGroupDisplay: 'always-collapsed';
    } | {
        RowGroupDisplay: 'collapsed';
        Values: any[][];
    };
    /**
     * Hides aggFunc name in the column header: e.g. 'sum(Bank Balance)' will just be 'Bank Balance'
     */
    SuppressAggFuncInHeader?: boolean;
    /**
     * Sorting to apply in the Layout
     */
    ColumnSorts?: ColumnSortModel[];
    ColumnPinning?: {
        [columnId: string]: 'left' | 'right';
    };
    /**
     * Display Grand Total Row at the top or bottom of the Pivot Table
     */
    GrandTotalRow?: 'top' | 'bottom' | boolean;
}
export type ColumnAggregationModel = {
    aggFunc: string | true;
    weightedColumnId?: string;
};
export type AggregationColumnsModelItem = {
    ColumnId: string;
    AggFunc: ColumnAggregationModel;
};
export type AggregationColumnsModel = AggregationColumnsModelItem[];
export type PivotAggregationColumnsModel = (AggregationColumnsModelItem & {
    TotalColumn?: boolean | 'before' | 'after' | {
        PivotColumnId: string;
        ShowTotal?: boolean | 'before' | 'after';
    }[];
})[];
export interface TableLayoutModel extends BaseLayoutModel {
    TableColumns: string[];
    /**
     * Columns showing aggregated values in Group Rows; 1st value in record is Column name, 2nd is either aggfunc (e.g. sum, avg etc.) or 'true' (to use default aggfunc)
     */
    TableAggregationColumns?: AggregationColumnsModel;
    /**
     * Columns which are row-grouped when the Layout is applied
     */
    RowGroupedColumns?: string[];
    /**
     * @defaultValue 'single'
     */
    RowGroupDisplayType?: 'single' | 'multi';
    PivotAggregationColumns?: never;
    PivotColumns?: never;
    PivotGroupedColumns?: never;
    PivotExpandLevel?: never;
}
export interface PivotLayoutModel extends BaseLayoutModel {
    TableColumns?: never;
    /**
     * List of Columns which should be pivoted when grid is in pivot mode
     */
    PivotColumns: string[];
    PivotExpandLevel?: number;
    /**
     * Columns showing aggregated values in Group Rows; 1st value in record is Column name, 2nd is either aggfunc (e.g. sum, avg etc.) or 'true' (to use default aggfunc)
     */
    PivotAggregationColumns?: PivotAggregationColumnsModel;
    TableAggregationColumns?: never;
    /**
     * Columns which are row-grouped when the Layout is applied
     */
    PivotGroupedColumns?: string[];
    RowGroupedColumns?: never;
    /**
     * Display Total of all Pivot Columns before or after the Pivot Columns
     */
    GrandTotalColumn?: 'before' | 'after' | boolean;
    /**
     * Display automatically calculated Totals within EACH Pivot Column Group, in the position specified
     */
    PivotGroupTotalColumn?: 'before' | 'after' | boolean;
}
export type LayoutModel = TableLayoutModel | PivotLayoutModel;
