import React from 'react';

export interface CommonProps {
    columns: any[];
    dataSource: any[];
    tableId: number;
    checked?: any[];
    columnWidth?: number;
}

export interface CommonState {
    prevProps: CommonProps;
    columns: any[];
    dataSource: any[];
    tableId: number;
    checked?: any[];
    columnWidth?: number;
}

export interface TableProps extends CommonProps {
    onScroll: Function;
    operateConfig: any;
    changeChecked?: Function;
    hasGroup?: boolean;
    updateData?: Function;
    showForm?: Function;
    showHistory?: Function;
    delData?: Function;
    getData?: Function;
    flush?: Function;
    extraMenu?: any;
    noAdd?: boolean;
    noEdit?: boolean;
    noDel?: boolean;
}

export interface TableState extends CommonState {
    prevProps: TableProps;
    height: number;
}
export interface ColumnProps {
    type: string;
    title: string;
    width?: number;
    columnAttrObj?: any;
}

export interface BaseComponentProps {
    value: any[] | undefined;
    columnConfig: any;
    formatter?: Function;
    onChange?: Function;
    changeParams?: Function;
}
export interface BaseComponentState {
    prevProps: BaseComponentProps;
    value: any[] | undefined;
    columnConfig: any;
}
export interface CellProps {
    columns: any[];
    columnConfig: any;
    rowData: any;
    cellData: any;
    tableId: number;
    changeChecked?: Function;
    hasGroup?: boolean;
    updateData?: Function;
    showForm?: any;
    showHistory?: Function;
    delData?: Function;
    getData?: Function;
    flush?: Function;
    extraMenu?: any;
    noAdd?: boolean;
    noEdit?: boolean;
    noDel?: boolean;
    overlayClassName?: string;
}
export interface CellState {
    prevProps: CellProps;
    editValue: any[];
    originValue: any[];
    isEditVisible: boolean;
    isMenuVisible: boolean;
}
export interface EditCellProps {
    columns: any[];
    columnConfig: any;
    rowData: any;
    value: any[];
    tableId: number;
    cellData: any;
    rowId: number;
    component: any;
    onChange: Function;
    componentAttr?: any;
    columnObj?: any;
    record: any;
}
export interface EditCellState {
    prevProps: EditCellProps;
    columnConfig: any;
}
