import * as H from 'history'; import { ColDef, ColGroupDef } from 'ag-grid-community'; import { AgGridReact } from 'ag-grid-react/lib/agGridReact'; export type CancellablePromise = Promise & { cancel: (str?: string) => void; }; export interface Sorter { colId: string; sort: string; } export type Location = H.Location & { query: { [key: string]: any }; }; export type ColumnDefs = (ColDef | ColGroupDef)[]; export type RequestData< T extends { [key: string]: any } = { [key: string]: any } > = { pageSize: number; page: number; sorters?: Sorter[]; queryData?: T; }; export interface ResponseData< T extends { [key: string]: any } = { [key: string]: any } > { isCancel?: boolean; list: T[]; footer?: T[]; total: number; } export type RequestMethod< T extends { [key: string]: any } = { [key: string]: any } > = ( url: string, payload: RequestData, options?: { headers: any; }, ) => CancellablePromise>; export type Fetch = CancellablePromise>; export type DataGridRef = AgGridReact;