import type { Dispatch, SetStateAction, ReactNode } from 'react'; import type { Action } from './store'; import type { SearchFunction } from './search'; export interface TableContextProps { state: Partial>; setState: Dispatch; search: () => void; refresh: () => void; setApi: (api: SearchFunction) => void; setExtraParams: (params: Record) => void; active: T; setActive: Dispatch>; setPagination: (pagination: Partial) => void; } export interface TableState { loading: boolean; data: T[]; page: number; size: number; total: number; keyword?: string; api: SearchFunction; current: T; extraParams?: Record; } export type Pagination = { page: number; size: number; total: number; }; export type DefaultRecordType = Record; export interface Column { title: ReactNode | (() => ReactNode); dataIndex?: string; key: string; cellRender?: (value: T[keyof T], record: T, index: number, props: { isHover: boolean; }) => ReactNode; width?: number; fixed?: string; }