import { generateUUID } from '../../../../../../utils/misc';
import { ElementToDTOStrategy } from './element-to-dto-strategy.abstract';
/**
 * Class to handle text node elements and convert them to text node DTOs
 */
export class ElementToTextNodeStrategy extends ElementToDTOStrategy {
  /**
   * @inheritDoc
   */
  shouldProceedToElementChildren() {
    return false;
  }
  /**
   * @inheritDoc
   */
  // eslint-disable-next-line @typescript-eslint/no-empty-function
  appendChildBlocks() { }
  /**
   * Generate text node DTO object
   *
   * @param {string} text - text content.
   * @param {VegaRTETextAnnotations} annotations - Current annotations.
   * @returns {VegaRTETextNode} - Text node DTO.
   */
  generateTextNode(text, annotations) {
    return {
      id: generateUUID(),
      type: 'text',
      text: text,
      annotations: annotations,
    };
  }
}
