@justjarethb/table-core
Version:
Fork of @tanstack/table-core with support for event listeners in different windows
20 lines (19 loc) • 815 B
TypeScript
import { RowData, Cell, Column, Row, Table } from '../types';
import { Getter } from '../utils';
export interface CellContext<TData extends RowData, TValue> {
table: Table<TData>;
column: Column<TData, TValue>;
row: Row<TData>;
cell: Cell<TData, TValue>;
getValue: Getter<TValue>;
renderValue: Getter<TValue | null>;
}
export interface CoreCell<TData extends RowData, TValue> {
id: string;
getValue: CellContext<TData, TValue>['getValue'];
renderValue: CellContext<TData, TValue>['renderValue'];
row: Row<TData>;
column: Column<TData, TValue>;
getContext: () => CellContext<TData, TValue>;
}
export declare function createCell<TData extends RowData, TValue>(table: Table<TData>, row: Row<TData>, column: Column<TData, TValue>, columnId: string): Cell<TData, TValue>;