import { AnnotationAction } from './annotation-action.abstract';
import { ImageAnnotation } from '../annotations/image-annotation';
/**
 * Action to add an image annotation to the editor
 */
export class ImageAnnotationAction extends AnnotationAction {
  constructor(size, alt) {
    super();
    this.isFlushable = true;
    this.size = size;
    this.alt = alt;
  }
  /**
   * Converts the action to an annotation
   *
   * @returns {ImageAnnotation} The annotation
   */
  toAnnotation() {
    return new ImageAnnotation(this.size, this.alt);
  }
}
