@devexpress/dx-react-grid-export
Version:
Export component for DevExtreme Reactive Grid
73 lines (63 loc) • 3.6 kB
TypeScript
import { Cell } from 'exceljs';
import { Column as Column_2 } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { FilteringStateProps } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { GridProps } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { GroupingStateProps } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { GroupSummaryItem } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import * as React_2 from 'react';
import { Row } from 'exceljs';
import { SelectionStateProps } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { SortingStateProps } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { SummaryItem } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { TableColumnVisibilityProps } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { TableGroupRow } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { TableGroupRowProps } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { TableProps } from '@devexpress/dx-react-grid/dist/dx-react-grid';
import { Workbook } from 'exceljs';
import { Worksheet } from 'exceljs';
/** Defines the column configuration object. Used to display data stored in a row. */
export declare 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 declare type CustomizeSummaryCellFn = (cell: Cell, column: Column, summary: ExportSummary) => void;
export declare type ExporterProps = Omit<GridProps, 'rootComponent'> & Pick<FilteringStateProps, 'filters'> & Pick<SortingStateProps, 'sorting'> & Pick<GroupingStateProps, 'grouping'> & Pick<TableGroupRowProps, 'showColumnsWhenGrouped'> & Pick<SelectionStateProps, 'selection'> & Pick<TableProps, 'columnExtensions'> & Pick<TableColumnVisibilityProps, 'hiddenColumnNames'> & {
/** The column order. */
columnOrder?: string[];
/** Specifies additional properties for the columns used in grouping. */
groupColumnExtensions?: TableGroupRow.ColumnExtension[];
/** Total summary items. */
totalSummaryItems?: SummaryItem[];
/** Group summary items. */
groupSummaryItems?: GroupSummaryItem[];
/** A function that should save the Excel document. */
onSave: (workbook: Workbook) => void;
/** Customizes Excel cells. */
customizeCell?: (cell: Cell, row: Row, column: Column_2) => void;
/** Customizes Excel cells that display summaries. */
customizeSummaryCell?: CustomizeSummaryCellFn;
/** Customizes the document's header. */
customizeHeader?: (worksheet: Worksheet) => void;
/** Customizes the document's footer. */
customizeFooter?: (worksheet: Worksheet) => void;
/** A reference to the GridExporter instance */
ref?: React_2.RefObject<any>;
};
export declare type ExportRanges = readonly number[][];
export declare type ExportSummary = {
type: SummaryType;
ranges: ExportRanges;
};
export declare type GetCellValueFn = (row: any, columnName: string) => any;
export declare const GridExporter: React_2.ComponentType<ExporterProps> & {
/** A method that exports data. */
exportGrid: (options?: object) => void;
};
export declare type SummaryType = string;
export { }