import * as React from 'react';

type IRenderData = {
  isPlaceholder: boolean;
  depth: number;
  isPreview: boolean;
  connectDragSource: any;
  item: NestableItemProps;
  siblings?: NestableItemProps[];
};

interface NestableItemProps {
  children?: React.ReactNode;
  id?: number | string;
  preventItemChangeDepth?: boolean;
  draggable?: boolean;
  lockDropArea?: boolean;
  isCollapsed?: boolean;
  [key: string]: any;
}

export interface NestableListBaseProps {
  dataHook?: string;
  items?: NestableItemProps[];
  readOnly?: boolean;
  isRenderDraggingChildren?: boolean;
  childrenProperty?: string;
  childrenStyle?: React.CSSProperties;
  onUpdate?: (data: { items: object[]; item: object }) => void;
  useDragHandle?: boolean;
  maxDepth?: number;
  threshold?: number;
  onDragStart?: (itemProps: any) => void;
  onDragEnd?: (itemProps: any) => void;
  renderItem?: (data: IRenderData) => React.ReactNode;
  renderAction?: (data: IRenderData) => React.ReactNode;
  renderPrefix?: (data: IRenderData) => React.ReactNode;
  zIndex?: number;
}

export default class NestableListBase extends React.PureComponent<NestableListBaseProps> {}
