enum SortDirection {
Up = 1,
Down = 2
}
interface IColumnFilter {
column: string,
filter?: string | RegExp //if the value is undefined, we need to clear the filter.
}
interface IColumnSort {
column: string,
sortDirection?: SortDirection //if the value is undefined, we need to remove the sorting.
}
interface ITablePagination {
currentPage: number,
totalPages: number,
rowsPerPage: number
}
interface ITableData {
columns?: string[]
data?: any[][] // an array (the rows), of array values (the columns per row)
}
interface ITable {
//GUI invoked methods
applyColumnFilter(columnFilter: IColumnFilter): void;
applyColumnSort(columnSort: IColumnSort): void;
applyTablePagination(tablePagination: ITablePagination): void;
//data methods
fetchData(columnFilters?: IColumnFilter[], columnSorts?: IColumnSort[], tablePagination?: ITablePagination[]): Promise<ITableData>; //async function !!!!!!!
//render methods
renderTable(tableData: ITableData): void;
}