import { TextStyleAnnotationHandler } from './annotation-handler/text-style-annotation-handler';
/**
 * Predicate class provides static methods to check specific conditions on HTML elements.
 */
export class Predicate {
  /**
   * Checks if the given element is a title or subtitle.
   *
   * @param {HTMLElement} element The element to check.
   * @returns {boolean} True if the element is a title or subtitle, false otherwise.
   */
  static isTitleOrSubtitle(element) {
    if (element.nodeName === 'DIV') {
      const textBlockType = Predicate.textStyleHandler['getTextStyle'](element);
      return textBlockType === 'title' || textBlockType === 'subtitle';
    }
    return false;
  }
  /**
   * Check if the given element is a link element (anchor tag).
   *
   * @param {HTMLElement} element The element to check.
   * @returns {boolean} True if the element is a link element, false otherwise.
   */
  static isLinkElement(element) {
    return element.nodeName === 'A';
  }
}
Predicate.textStyleHandler = new TextStyleAnnotationHandler();
