import { HTMLAttributes } from 'react';
import { ReactWindowGridRef } from './VirtualGridRepeaterState';

export interface GridState {
  gridRef?: ReactWindowGridRef | null;
  readonly setVariableRowHeight?: (props: {
    size: number;
    key: number | string;
  }) => void;
  readonly itemsToRenderCount: number;
  readonly isInteracting?: boolean;
  readonly forceRenderIndexes: number[] | undefined;
  readonly gap: number;
  itemKeyRecyclerOverride?: (
    index: number,
  ) => string | number | null | undefined;
  readonly listAttributes?: HTMLAttributes<HTMLElement>;
  readonly toolbar: {
    readonly minimizedHeaderHeight: number;
    readonly itemsContentHeight: number;
    readonly containerTop: number | undefined;
    readonly isScrolling?: boolean;
    readonly fedopsReporter: {
      onFullRenderStart?: () => () => unknown;
    };
  };
  readonly container: {
    readonly lodash: Pick<typeof import('lodash'), 'debounce' | 'throttle'>;
  };
  readonly itemsContentWidth: number;
  readonly calcGridProps: {
    columnCount: number;
    columnWidth: (index: number) => number;
    columnWidthIncludingGap: (index: number) => number;
    rowHeight?: (index: number) => number;
    rowHeightIncludingGap: (props: {
      index: number;
      key: number | string;
    }) => number;
    estimatedRowHeight?: number;
    overscanCount: number;
  };
}
