// Dependencies for this module:
//   ../../../../@devexpress/dx-core

import { PureComputed } from '@devexpress/dx-core';

/** Defines the column configuration object. Used to display data stored in a row. */
export interface Column {
    /*** Specifies the column name or the name of a row field whose value the column displays.
      * If the column name does not match any field name, specify the `getCellValue` function.
      **/
    name: string;
    /** Specifies the column title. */
    title?: string;
    /** Specifies the function used to get the column value for a given row. */
    getCellValue?: GetCellValueFn;
}
export type Row = any;
export type RowId = number | string;
export type GetCellValueFn = (row: any, columnName: string) => any;

export interface EditingColumnExtension {
    /** The name of a column to extend. */
    columnName: string;
    /** Specifies whether editing is enabled for a column. */
    editingEnabled?: boolean;
    /**
      * A function that returns a value specifying row changes depending on the columns' editor
      * values for the current row. This function is called each time the editor's value changes.
      */
    createRowChange?: (row: any, value: any, columnName: string) => any;
}
export interface EditingCell {
    rowId: number | string;
    columnName: string;
}

/** Describes a filter. */
export interface Filter {
    /** Specifies the name of a column whose value is used for filtering. */
    columnName: string;
    /** Specifies the operation name. The value is 'contains' if the operation name is not set. */
    operation?: FilterOperation;
    /** Specifies the filter value. */
    value?: any;
}
/** Describes data filtering expressions */
export interface FilterExpression {
    /** Specifies the Boolean operator */
    operator: 'and' | 'or';
    /** Specifies filters or filter expressions */
    filters: Array<FilterExpression | Filter>;
}
/*** Describes a filter operation. Accepts one of the built-in operations or a custom string.
  * Built-in operations: `contains`, `notContains`, `startsWith`, `endsWith`, `equal`, `notEqual`,
  * `greaterThan`, `greaterThanOrEqual`, `lessThan`, `lessThanOrEqual` */
export declare type FilterOperation = string;
export declare namespace IntegratedFiltering {
    /** Describes additional column properties that the plugin can handle. */
    interface ColumnExtension {
        /** The name of a column to extend. */
        columnName: string;
        /** A filter predicate. The `filter` parameter accepts an object containing the 'value' field. Note that you can use the onFilter event to extend this object to the fields your filtering algorithm requires. */
        predicate?: (value: any, filter: Filter, row: any) => boolean;
    }
}



/** Describes grouping options. */
export interface Grouping {
  /** Specifies the name of the column by which the data is grouped. */
  columnName: string;
}
/** Describes a group that can be nested in another one. */
export type GroupKey = string;
/** Describes the grouping panel item properties. */
export interface GroupingPanelItem {
  /** A column associated with the item. */
  column: Column;
  /** Specifies if the item is in preview mode */
  draft?: boolean;
}





export type SortingDirection = 'asc' | 'desc';
/** Describes the sorting applied to a column */
export interface Sorting {
  /** Specifies a column's name to which the sorting is applied. */
  columnName: string;
  /** Specifies a column's sorting order. */
  direction: SortingDirection;
}

/** Describes properties of a table row that the Table plugin renders. */
export interface TableRow {
    /** A unique table row identifier. */
    key: string;
    /*** Specifies the table row type. The specified value defines which cell template
      * is used to render the row. */
    type: symbol;
    /** Specifies the associated row's ID. */
    rowId?: number | string;
    /** Specifies the associated row. */
    row?: any;
    /** Specifies the table row height. */
    height?: number;
}
/** Describes properties of a table column that the Table plugin renders. */
export interface TableColumn {
    /** A unique table column identifier. */
    key: string;
    /*** Specifies the table column type. The specified value defines which cell template
      * is used to render the column. */
    type: symbol;
    /** Specifies the associated user column. */
    column?: Column;
    /** Specifies the table column width. */
    width?: number | string;
    /** Specifies the table's column alignment. */
    align?: 'left' | 'right' | 'center';
    /** Specifies the fixed table's column alignment. */
    fixed?: 'left' | 'right';
}
export type GridColumnExtension = {
    /** The name of the column to extend. */
    columnName: string;
    /** The table column width. */
    width?: number | string;
    /** The table column alignment. */
    align?: 'left' | 'right' | 'center';
    /** Specifies whether word wrap is enabled in a column's cells. */
    wordWrapEnabled?: boolean;
} & IntegratedFiltering.ColumnExtension;







/** Describes an object that specifies a column width. */
export interface TableColumnWidthInfo {
  /** A column name. */
  columnName: string;
  /** A column width. */
  width: number | string;
}
export interface ResizingSizes {
  /** A new column size. */
  size: number;
  /** A new next column size */
  nextSize?: number;
}
export interface ColumnSizes {
  /** A new column size. */
  width: number;
  /** A new next column size */
  size: number;
}
export namespace TableColumnResizing {
  /** Describes additional column properties that the plugin can handle. */
  interface ColumnExtension {
    /** A column name. */
    columnName: string;
    /** A column minimum width. */
    minWidth?: number;
    /** A column maximum width. */
    maxWidth?: number;
  }
}

/** Describes properties of column bands that the TableBandHeader plugin renders. */
export interface ColumnBands {
  /** A column name that is used to identify a column in the bands tree. */
  columnName?: string;
  /** The band's title. Used only for bands and ignored for columns. */
  title?: string;
  /** Nested bands and columns. */
  children?: ColumnBands[];
}



/** Describes the summary item associated with a column. */
export interface SummaryItem {
  /** The name of a column associated with the current summary item. */
  columnName: string;
  /** A summary type. */
  type: SummaryType;
}
export interface GroupSummaryItem extends SummaryItem {
  showInGroupFooter?: boolean;
  alignByColumn?: boolean;
}
export type SummaryType = string;
export type ColumnSummary = {
  type: SummaryType;
  value: SummaryValue;
};
export type SummaryValue = number | null;





export interface ColumnChooserItem {
  /** The grid column associated with the item. */
  column: Column;
  /** Specifies whether the associated column is hidden. */
  hidden: boolean;
}



export interface FocusedElement {
  rowKey: string;
  columnKey: string;
  index?: number;
  part: string;
}
export type FocusedElementWScrolling = {
  element?: FocusedElement;
  scrolling?: 'left' | 'right';
};
export type Elements = {
  [key: string]: any[];
};
export type ScrollToColumnFn = (value: symbol) => void;
export type InlineEditing = {
  stopEditCells?: (arg: any) => void;
  commitChangedRows?: (arg: any) => void;
  cancelChangedRows?: (arg: any) => void;
  startEditCells?: (arg: any) => void;
};
export type GetNextFocusedElementFn = PureComputed<[
  TableColumn[],
  TableRow[],
  TableRow[],
  RowId[],
  Elements,
  any,
  InlineEditing,
  FocusedElement?,
  ScrollToColumnFn?
], FocusedElementWScrolling>;
export type GetFocusedElementFn = PureComputed<[
  string,
  boolean,
  FocusedElement,
  TableColumn[],
  TableRow[],
  Elements
], FocusedElement | void>;
export type GetElementFn = PureComputed<[
  FocusedElement,
  TableRow[],
  TableColumn[],
  TableRow[],
  Elements,
  ScrollToColumnFn?
], FocusedElementWScrolling>;
export type GetElementPrevNextPartFn = PureComputed<[
  FocusedElement,
  Elements,
  TableRow[],
  TableColumn[],
  ScrollToColumnFn?
], FocusedElementWScrolling>;
export type GetInnerElementsFn = PureComputed<[
  Elements,
  string,
  string,
  string?
], any[]>;
export type GetNextPrevPartFn = PureComputed<[FocusedElement, Elements, TableRow[]], string | void>;
export type GetNextPrevCellFromBodyFn = PureComputed<[
  number,
  number,
  TableColumn[],
  TableRow[],
  FocusedElement,
  Elements,
  ScrollToColumnFn?
], FocusedElementWScrolling>;
export type GetPrevCellFromHeadingFn = PureComputed<[
  TableRow[],
  TableColumn[],
  number,
  FocusedElement,
  Elements
], FocusedElementWScrolling>;
export type GetNextCellFromHeadingFn = PureComputed<[
  TableRow[],
  TableRow[],
  TableColumn[],
  number,
  FocusedElement,
  Elements,
  ScrollToColumnFn?
], FocusedElementWScrolling>;
export type GetCellNextPrevPartFn = PureComputed<[
  FocusedElement,
  Elements,
  TableRow[],
  TableColumn[],
  number,
  ScrollToColumnFn?
], FocusedElementWScrolling>;
export interface FocusedCell {
  columnKey: string;
  rowKey: string;
}
export type OnFocusedCellChangeFn = (cell: FocusedCell) => void;

