import { AnnotationAction } from './annotation-action.abstract';
import { HorizontalAlignmentAnnotation } from '../annotations/horizontal-alignment-annotation';
/**
 * Action to toggle block horizontal alignment annotation
 */
export class HorizontalAlignmentAnnotationAction extends AnnotationAction {
  constructor(textAlign) {
    super();
    this.isFlushable = true;
    this.textAlign = textAlign;
  }
  /**
   * Converts the action to an annotation
   *
   * @returns {HorizontalAlignmentAnnotation} The annotation
   */
  toAnnotation() {
    return new HorizontalAlignmentAnnotation(this.textAlign);
  }
}
