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