import { AnnotationAction } from './annotation-action.abstract';
import { LinkGroupAnnotation } from '../annotations/link-group-annotation';
/**
 * Action to link a group of nodes
 */
export class LinkGroupAnnotationAction extends AnnotationAction {
  constructor(groupKey, nodes, type) {
    super();
    this.isFlushable = false;
    this.groupKey = groupKey;
    this.nodes = nodes;
    this.type = type;
  }
  /**
   * Converts the action to an annotation
   *
   * @returns {Annotation} The annotation
   */
  toAnnotation() {
    return new LinkGroupAnnotation(this.groupKey);
  }
}
