react-konva-grid
Version:
Canvas grid to render large set of tabular data with virtualization.
40 lines (39 loc) • 2.73 kB
TypeScript
import { ItemSizer, InstanceInterface, AreaProps, CellInterface, CellMetaData } from "./Grid";
declare type ItemType = "row" | "column";
export interface IItemMetaData {
itemType: ItemType;
offset: number;
index: number;
rowCount: number;
columnCount: number;
rowHeight: ItemSizer;
columnWidth: ItemSizer;
instanceProps: InstanceInterface;
}
export declare const getRowStartIndexForOffset: ({ rowHeight, columnWidth, rowCount, columnCount, instanceProps, offset, }: Omit<IItemMetaData, "index" | "itemType">) => number;
interface IRowStopIndex extends Omit<IItemMetaData, "itemType" | "index" | "offset" | "columnCount"> {
startIndex: number;
containerHeight: number;
scrollTop: number;
}
export declare const getRowStopIndexForStartIndex: ({ startIndex, rowCount, rowHeight, columnWidth, scrollTop, containerHeight, instanceProps, }: IRowStopIndex) => number;
export declare const getColumnStartIndexForOffset: ({ rowHeight, columnWidth, rowCount, columnCount, instanceProps, offset, }: Omit<IItemMetaData, "index" | "itemType">) => number;
interface IColumnStopIndex extends Omit<IItemMetaData, "itemType" | "index" | "offset" | "rowCount"> {
startIndex: number;
containerWidth: number;
scrollLeft: number;
}
export declare const getColumnStopIndexForStartIndex: ({ startIndex, rowHeight, columnWidth, instanceProps, containerWidth, scrollLeft, columnCount, }: IColumnStopIndex) => number;
export declare const getBoundedCells: (area: AreaProps | null | undefined) => Set<unknown>;
export declare const itemKey: ({ rowIndex, columnIndex }: CellInterface) => string;
export declare const getRowOffset: ({ index, rowHeight, columnWidth, instanceProps, }: Omit<IGetItemMetadata, "itemType">) => number;
export declare const getColumnOffset: ({ index, rowHeight, columnWidth, instanceProps, }: Omit<IGetItemMetadata, "itemType">) => number;
export declare const getRowHeight: (index: number, instanceProps: InstanceInterface) => number;
export declare const getColumnWidth: (index: number, instanceProps: InstanceInterface) => number;
interface IGetItemMetadata extends Pick<IItemMetaData, "itemType" | "index" | "rowHeight" | "columnWidth" | "instanceProps"> {
}
export declare const getItemMetadata: ({ itemType, index, rowHeight, columnWidth, instanceProps, }: IGetItemMetadata) => CellMetaData;
export declare const getEstimatedTotalHeight: (rowCount: number, estimatedRowHeight: number, instanceProps: InstanceInterface) => number;
export declare const getEstimatedTotalWidth: (columnCount: number, estimatedColumnWidth: number, instanceProps: InstanceInterface) => number;
export declare const cellIndentifier: (rowIndex: number, columnIndex: number) => string;
export {};