export interface IAnnotationData {
  content: string;
  labelCategories: any[];
  labels: any[];
  connectionCategories: any[];
  connections: any[];
}

export interface IOnTextSelectedFn {
  (startIndex?: number, endIndex?: number): void;
}

export interface IOnLabelDoubleClickedFn {
  (id?: number, e?: Event): void;
}

export interface IOnLabelRightClickedFn {
  (id?: number, e?: Event): void;
}

export interface IOnAnnotatorUpdate {
  (store: IAnnotationData): void;
}

export interface IOnTwoLabelsClickedFn {
  (first: number, second: number): void;
}

export interface IOnConnectionDoubleClickedFn {
  (id?: number, e?: Event): void;
}

export interface IOnConnectionRightClickedFn {
  (id?: number, e?: Event): void;
}

export interface IActionData {
  labelId?: number | string;
  categoryId?: number;
  startIndex?: number;
  endIndex?: number;
  connectionId?: number | string;
  fromId?: number | string;
  toId?: number | string;
}

export interface IAction {
  type:
    | 'LABELCREATE'
    | 'LABELUPDATE'
    | 'LABELDELETE'
    | 'CONNECTIONCREATE'
    | 'CONNECTIONUPDATE'
    | 'CONNECTIONDELETE';
  data: IActionData;
}

export interface AnnotationProps {
  annotationData: IAnnotationData;
  action?: IAction;
  onTextSelected?: IOnTextSelectedFn;
  onLabelDoubleClicked?: IOnLabelDoubleClickedFn;
  onLabelRightClicked?: IOnLabelRightClickedFn;
  onTwoLabelsClicked?: IOnTwoLabelsClickedFn;
  onConnectionDoubleClicked?: IOnConnectionDoubleClickedFn;
  onConnectionRightClicked?: IOnConnectionRightClickedFn;
  onAnnotatorUpdate?: IOnAnnotatorUpdate;
}
