/**
* DevExtreme (excel_exporter.d.ts)
* Version: 20.1.10
* Build date: Fri Jan 15 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import dxDataGrid, { dxDataGridColumn } from './ui/data_grid';

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface ExcelDataGridCell {
    /**
     * The configuration of the cell's column.
     */
    column?: dxDataGridColumn;
    /**
     * The data object of the cell's row.
     */
    data?: any;
    /**
     * The group index of the cell's row. Available when the rowType is 'group'.
     */
    groupIndex?: number;
    /**
     * Information about group summary items the cell represents.
     */
    groupSummaryItems?: Array<{ name?: string, value?: any }>;
    /**
     * The type of the cell's row.
     */
    rowType?: string;
    /**
     * The identifier of the total summary item that the cell represents.
     */
    totalSummaryItemName?: string;
    /**
     * The cell's raw value.
     */
    value?: any;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface CellAddress {
    /**
     * The index of a row that contains the cell.
     */
    row?: number;
    /**
     * The index of a column that contains the cell.
     */
    column?: number;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface CellRange {
    /**
     * Coordinates of the top left cell.
     */
    from?: CellAddress;
    /**
     * Coordinates of the bottom right cell.
     */
    to?: CellAddress;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface ExportLoadPanel {
    /**
     * Specifies whether the load panel is enabled.
     * Warning! This type is used for internal purposes. Do not import it directly.
     */
    enabled?: boolean;
    /**
     * Specifies text displayed on the load panel.
     * Warning! This type is used for internal purposes. Do not import it directly.
     */
    text?: string;
    /**
     * Specifies the width of the load panel in pixels.
     * Warning! This type is used for internal purposes. Do not import it directly.
     */
    width?: number;
    /**
     * Specifies the height of the load panel in pixels.
     * Warning! This type is used for internal purposes. Do not import it directly.
     */
    height?: number;
    /**
     * Specifies whether to show the loading indicator.
     * Warning! This type is used for internal purposes. Do not import it directly.
     */
    showIndicator?: boolean;
    /**
     * Specifies a URL pointing to an image to be used as a loading indicator.
     * Warning! This type is used for internal purposes. Do not import it directly.
     */
    indicatorSrc?: string;
    /**
     * Specifies whether to show the pane of the load panel.
     * Warning! This type is used for internal purposes. Do not import it directly.
     */
    showPane?: boolean;
    /**
     * Specifies whether to shade the UI component when the load panel is shown.
     * Warning! This type is used for internal purposes. Do not import it directly.
     */
    shading?: boolean;
    /**
     * Specifies the shading color. Applies only if shading is true.
     * Warning! This type is used for internal purposes. Do not import it directly.
     */
    shadingColor?: string;
}

/**
 * Warning! This type is used for internal purposes. Do not import it directly.
 */
export interface ExportDataGridProps {
    /**
     * A DataGrid instance. This setting is required.
     */
    component?: dxDataGrid;
    /**
     * An Excel worksheet to which the DataGrid should be exported.
     */
    worksheet?: object;
    /**
     * A cell used as a start position for export.
     */
    topLeftCell?: CellAddress | string;
    /**
     * Specifies whether to export only selected rows.
     */
    selectedRowsOnly?: boolean;
    /**
     * Specifies whether to enable Excel filtering in the document.
     */
    autoFilterEnabled?: boolean;
    /**
     * Specifies whether Excel columns should have the same width as their source UI component's columns.
     */
    keepColumnWidths?: boolean;
    /**
     * Customizes an Excel cell after creation.
     */
    customizeCell?: ((options: { gridCell?: ExcelDataGridCell, excelCell?: any}) => any);
    /**
     * Configures the load panel.
     */
    loadPanel?: ExportLoadPanel;
}

/**
 * Exports grid data to Excel.
 */
export function exportDataGrid(options: ExportDataGridProps): Promise<CellRange> & JQueryPromise<CellRange>;

