import { createContext } from '../../createContext';
import { VirtualGridRepeaterState } from './VirtualGridRepeaterState';
import { RenderItem } from './RenderItem';

const { Provider, useContext } = createContext<{
  state: VirtualGridRepeaterState;
  renderItem: RenderItem;
  itemKey: (params: {
    columnIndex: number;
    rowIndex: number;
  }) => string | number;
}>('VirtualGridRepeaterContext');

export const VirtualGridRepeaterContextProvider = Provider;
export const useVirtualGridRepeaterContext = useContext;
