import { ActionsHandler, ActionType } from "../types/action.bar.type"; import { DataRow } from "./body.type"; import { CellFactory } from "./cell.type"; import { DataColumn } from "./column.type"; import { DataFilterSet, DataFilterType, DataOption, ExternalFilter, FiltersMessage, FiltersStore } from "./filter.type"; import { HeadersMessages } from "./head.type"; import { SummaryContext } from "./summary.types"; export interface DataColumnExtra extends DataColumn { type: DataFilterSet | 'none', cell: CellFactory | undefined, summary: SummaryContext | undefined, set?: (value: [string, string]) => Promise, options?: (text: string) => Promise, toQuery?: (value: DataFilterType | [DataFilterType, DataFilterType]) => DataFilterType | [DataFilterType, DataFilterType] } export interface TableContext { data: { rows: DataRow[], next?: number | string }, paginator: { currentPage: number, pageSize: number }, filters: FiltersStore, externalFilter?: ExternalFilter, editting: { row: string, column: string, }, hasSummary: boolean, selection: { [key: string]: DataRow }, modifications: { [key: string]: { original: DataRow, changed: DataRow } }, columns: DataColumnExtra[], defaultColumns: DataColumnExtra[], actions: { id: string, type: ActionType, icon?: React.ReactNode, disabled?: boolean, tooltip?: string, handler: ActionsHandler, }[], forceUpdateTable: () => void, forceUpdateHead: () => void, forceUpdateBody: () => void, forceUpdateToolbar: () => void, forceUpdatePaginator: () => void, } export interface TableMessages { noData?: string, changesHistory?: string, noChanges: string, filters: FiltersMessage, headers: HeadersMessages, } export type TableReference = { update: (callback?: (row: any) => void) => void }