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