import { TextSplittableAction } from './splittable-action.abstract';
import { StrikethroughAnnotation } from '../annotations/strikethrough-annotation';
/**
 * Action to toggle the strikethrough annotation
 */
export class StrikethroughAnnotationAction extends TextSplittableAction {
  constructor(underline) {
    super();
    this.isFlushable = true;
    this.strikethrough = underline;
  }
  /**
   * Converts the action to an annotation
   *
   * @returns {Annotation} the annotation
   */
  toAnnotation() {
    return new StrikethroughAnnotation(this.strikethrough);
  }
}
