import { AnnotationAction } from './annotation-action.abstract';
import { TextStyleAnnotation } from '../annotations/text-style-annotation';
/**
 * Action to change the text style of a block
 */
export class TextStyleAnnotationAction extends AnnotationAction {
  constructor(textStyle, bold) {
    super();
    this.isFlushable = true;
    this.textStyle = textStyle;
    this.bold = bold;
  }
  /**
   * Converts the action to a block annotation
   *
   * @returns {BlockAnnotation} the block annotation
   */
  toAnnotation() {
    return new TextStyleAnnotation(this.textStyle);
  }
}
