import { GridCellParams as GridCellParams$1, GridColDef as GridColDef$1, GridRowId as GridRowId$1 } from '@material-ui/x-grid'; import * as React from 'react'; import { GridCellParams as GridCellParams$2 } from '@material-ui/data-grid'; declare function renderAvatar(params: GridCellParams$1): JSX.Element; declare function renderCountry(params: GridCellParams$1): JSX.Element; declare function renderEmail(params: GridCellParams$1): JSX.Element; declare function renderIncoterm(params: GridCellParams$1): JSX.Element; interface DemoLinkProps { href: string; children: string; } declare const DemoLink: React.NamedExoticComponent; declare function renderLink(params: GridCellParams$1): JSX.Element; /** * The mode of the cell. */ declare type GridCellMode = 'edit' | 'view'; /** * The cell value type. */ declare type GridCellValue = string | number | boolean | Date | null | undefined | object; declare type GridRowData = { [key: string]: any; }; /** * The key value object representing the data of a row. */ declare type GridRowModel = GridRowData; /** * The type of Id supported by the grid. */ declare type GridRowId = string | number; /** * Object passed as parameter in the column [[GridColDef]] cell renderer. */ interface GridCellParams { /** * The grid row id. */ id: GridRowId; /** * The column field of the cell that triggered the event */ field: string; /** * The cell value, but if the column has valueGetter, use getValue. */ value: GridCellValue; /** * The cell value formatted with the column valueFormatter. */ formattedValue: GridCellValue; /** * The row model of the row that the current cell belongs to. */ row: GridRowModel; /** * The column of the row that the current cell belongs to. */ colDef: GridStateColDef; /** * GridApi that let you manipulate the grid. */ api: any; /** * If true, the cell is editable. */ isEditable?: boolean; /** * The mode of the cell. */ cellMode: GridCellMode; /** * If true, the cell is the active element. */ hasFocus: boolean; /** * the tabIndex value. */ tabIndex: 0 | -1; /** * Get the cell value of a row and field. * @param id * @param field */ getValue: (id: GridRowId, field: string) => GridCellValue; } /** * Alias of GridCellParams. */ declare type GridValueGetterParams = Omit; /** * Alias of GridCellParams. */ declare type GridValueFormatterParams = Omit; /** * A function used to process cellClassName params. */ declare type GridCellClassFn = (params: GridCellParams) => string; /** * The union type representing the [[GridColDef]] cell class type. */ declare type GridCellClassNamePropType = string | GridCellClassFn; /** * Object passed as parameter in the column [[GridColDef]] header renderer. */ interface GridColumnHeaderParams { /** * The column field of the column that triggered the event */ field: string; /** * The column of the current header component. */ colDef: GridStateColDef; /** * API ref that let you manipulate the grid. */ api: any; } /** * A function used to process headerClassName params. */ declare type GridColumnHeaderClassFn = (params: GridColumnHeaderParams) => string; /** * The union type representing the [[GridColDef]] column header class type. */ declare type GridColumnHeaderClassNamePropType = string | GridColumnHeaderClassFn; interface GridFilterItem { id?: number | string; columnField?: string; value?: any; operatorValue?: string; } interface GridFilterInputValueProps { item: GridFilterItem; applyValue: (value: GridFilterItem) => void; apiRef: any; } interface GridFilterOperator { label?: string; value: string; getApplyFilterFn: (filterItem: GridFilterItem, column: GridStateColDef) => null | ((params: GridCellParams) => boolean); InputComponent?: React.JSXElementConstructor; InputComponentProps?: Record; } interface GridSortCellParams { id: GridRowId; field: string; value: GridCellValue; api: any; } /** * The type of the sort comparison function. */ declare type GridComparatorFn = (v1: GridCellValue, v2: GridCellValue, cellParams1: GridSortCellParams, cellParams2: GridSortCellParams) => number; declare type GridNativeColTypes = 'string' | 'number' | 'date' | 'dateTime' | 'boolean' | 'singleSelect'; declare type GridColType = GridNativeColTypes | string; /** * Alignment used in position elements in Cells. */ declare type GridAlignment = 'left' | 'right' | 'center'; /** * Column Definition interface. */ interface GridColDef { /** * The column identifier. It's used to map with [[GridRowData]] values. */ field: string; /** * The title of the column rendered in the column header cell. */ headerName?: string; /** * The description of the column rendered as tooltip if the column header name is not fully displayed. */ description?: string; /** * Set the width of the column. * @default 100 */ width?: number; /** * If set, it indicates that a column has fluid width. Range [0, ∞). */ flex?: number; /** * Sets the minimum width of a column. * @default 50 */ minWidth?: number; /** * If `true`, hide the column. * @default false */ hide?: boolean; /** * If `true`, the column is sortable. * @default true */ sortable?: boolean; /** * If `true`, the column is resizable. * @default true */ resizable?: boolean; /** * If `true`, the cells of the column are editable. * @default false */ editable?: boolean; /** * A comparator function used to sort rows. */ sortComparator?: GridComparatorFn; /** * Type allows to merge this object with a default definition [[GridColDef]]. * @default 'string' */ type?: GridColType; /** * To be used in combination with `type: 'singleSelect'`. This is an array of the possible cell values and labels. */ valueOptions?: Array; /** * Allows to align the column values in cells. */ align?: GridAlignment; /** * Function that allows to get a specific data instead of field to render in the cell. * @param params */ valueGetter?: (params: GridValueGetterParams) => GridCellValue; /** * Function that allows to apply a formatter before rendering its value. * @param {GridValueFormatterParams} params Object containing parameters for the formatter. * @returns {GridCellValue} The formatted value. */ valueFormatter?: (params: GridValueFormatterParams) => GridCellValue; /** * Function that takes the user-entered value and converts it to a value used internally. * @param {GridCellValue} value The user-entered value. * @param {GridCellParams} params The params when called before saving the value. * @returns {GridCellValue} The converted value to use internally. */ valueParser?: (value: GridCellValue, params?: GridCellParams) => GridCellValue; /** * Class name that will be added in cells for that column. */ cellClassName?: GridCellClassNamePropType; /** * Allows to override the component rendered as cell for this column. * @param params */ renderCell?: (params: GridCellParams) => React.ReactNode; /** * Allows to override the component rendered in edit cell mode for this column. * @param params */ renderEditCell?: (params: GridCellParams) => React.ReactNode; /** * Class name that will be added in the column header cell. */ headerClassName?: GridColumnHeaderClassNamePropType; /** * Allows to render a component in the column header cell. * @param params */ renderHeader?: (params: GridColumnHeaderParams) => React.ReactNode; /** * Header cell element alignment. */ headerAlign?: GridAlignment; /** * Toggle the visibility of the sort icons. * @default false */ hideSortIcons?: boolean; /** * If `true`, the column menu is disabled for this column. * @default false */ disableColumnMenu?: boolean; /** * If `true`, the column is filterable. * @default true */ filterable?: boolean; /** * Allows setting the filter operators for this column. */ filterOperators?: GridFilterOperator[]; /** * If `true`, this column cannot be reordered. * @default false */ disableReorder?: boolean; /** * If `true`, this column will not be included in exports. * @default false */ disableExport?: boolean; } interface GridStateColDef extends GridColDef { computedWidth: number; } declare function renderPnl(params: GridCellParams): JSX.Element; declare function renderProgress(params: GridCellParams$1): JSX.Element; declare function renderRating(params: GridCellParams$1): JSX.Element; declare function renderStatus(params: GridCellParams$1): JSX.Element; declare function renderTotalPrice(params: GridCellParams): JSX.Element; declare function renderEditCurrency(params: GridCellParams$2): JSX.Element; declare function renderEditProgress(params: GridCellParams$2): JSX.Element; declare function renderEditStatus(params: GridCellParams$2): JSX.Element; declare function renderEditIncoterm(params: GridCellParams$2): JSX.Element; declare function renderEditRating(params: any): JSX.Element; declare function renderEditCountry(params: GridCellParams$2): JSX.Element; interface GeneratableColDef extends GridColDef$1 { generateData: (data: any) => any; } declare const random: (min: number, max: number) => number; declare const randomInt: (min: number, max: number) => number; declare const randomPrice: (min?: number, max?: number) => number; declare const randomRate: () => number; declare const randomDate: (start: any, end: any) => Date; declare const getDate: () => Date; declare const randomArrayItem: (arr: any[]) => any; declare const randomBoolean: () => boolean; declare const randomColor: () => any; declare const randomId: () => string; declare const randomDesk: () => string; declare const randomCommodity: () => any; declare const randomTraderName: () => any; declare const randomUserName: () => any; declare const randomEmail: () => any; declare const randomUrl: () => any; declare const randomPhoneNumber: () => any; declare const randomUnitPrice: () => number; declare const randomUnitPriceCurrency: () => any; declare const randomQuantity: () => number; declare const randomFeeRate: () => number; declare const randomIncoterm: () => any; declare const randomStatusOptions: () => any; declare const randomPnL: () => number; declare const randomMaturityDate: () => Date; declare const randomTradeDate: () => Date; declare const randomBrokerId: () => any; declare const randomCompanyName: () => any; declare const randomCountry: () => any; declare const randomCurrency: () => any; declare const randomAddress: () => any; declare const randomCity: () => any; declare const randomTaxCode: () => any; declare const randomContractType: () => any; declare const randomRateType: () => any; declare const randomCreatedDate: () => Date; declare const randomUpdatedDate: () => Date; declare const randomJobTitle: () => any; declare const randomRating: () => number; declare const randomName: () => any; declare const generateFilledQuantity: (data: any) => number; declare const generateIsFilled: (data: any) => boolean; interface DataRowModel { id: GridRowId$1; [field: string]: any; } interface GridData { columns: GridColDef$1[]; rows: DataRowModel[]; } declare function getRealData(rowLength: number, columns: any[]): Promise; declare const getCommodityColumns: (editable?: boolean) => any[]; declare const getEmployeeColumns: () => any[]; declare type DemoDataReturnType = { data: GridData; loading: boolean; setRowLength: (count: number) => void; loadNewData: () => void; }; declare type DataSet = 'Commodity' | 'Employee'; interface DemoDataOptions { dataSet: DataSet; rowLength: number; maxColumns?: number; editable?: boolean; } declare const useDemoData: (options: DemoDataOptions) => DemoDataReturnType; export { DataRowModel, DemoDataOptions, DemoDataReturnType, DemoLink, GeneratableColDef, GridData, generateFilledQuantity, generateIsFilled, getCommodityColumns, getDate, getEmployeeColumns, getRealData, random, randomAddress, randomArrayItem, randomBoolean, randomBrokerId, randomCity, randomColor, randomCommodity, randomCompanyName, randomContractType, randomCountry, randomCreatedDate, randomCurrency, randomDate, randomDesk, randomEmail, randomFeeRate, randomId, randomIncoterm, randomInt, randomJobTitle, randomMaturityDate, randomName, randomPhoneNumber, randomPnL, randomPrice, randomQuantity, randomRate, randomRateType, randomRating, randomStatusOptions, randomTaxCode, randomTradeDate, randomTraderName, randomUnitPrice, randomUnitPriceCurrency, randomUpdatedDate, randomUrl, randomUserName, renderAvatar, renderCountry, renderEditCountry, renderEditCurrency, renderEditIncoterm, renderEditProgress, renderEditRating, renderEditStatus, renderEmail, renderIncoterm, renderLink, renderPnl, renderProgress, renderRating, renderStatus, renderTotalPrice, useDemoData };