react-konva-grid
Version:
Canvas grid to render large set of tabular data with virtualization.
20 lines (19 loc) • 671 B
TypeScript
import React from "react";
import { ICell, TScrollCoords, TGridRef } from "../Grid";
interface IProps {
getEditor: (cell: ICell | null) => React.ElementType;
gridRef: TGridRef;
getValue: <T>(cell: ICell) => T;
onChange: <T>(value: T, coords: ICell) => void;
}
interface IEditable {
editorComponent: JSX.Element | null;
onDoubleClick: (e: React.MouseEvent<HTMLInputElement>, rowIndex: number, columnIndex: number) => void;
onScroll: (props: TScrollCoords) => void;
}
/**
* Hook to make grid editable
* @param param
*/
declare const useEditable: ({ getEditor, gridRef, getValue, onChange, }: IProps) => IEditable;
export default useEditable;