import { AnnotationStyle, RTENodeAnnotationMapKey, RTENodeAnnotationMapValue, RTERenderContext, VegaRTETransformOptions, VegaRTEImageAnnotations, VegaRTETextAnnotations } from '../../interface';
import { AnnotationAction } from '../actions/annotation-action.abstract';
import { RTEBlock } from '../blocks/block.abstract';
import { Nullable } from '../../../../types/general';
import { ModifyContentAction } from '../actions/modify-content-action.abstract';
import { CustomAttributeAnnotation } from '../annotations/custom-attribute-annotation';
import { ClassType } from '../../../../types/class.type';
import type { RTETextNode } from './text-node';
export declare enum NodeTypeEnum {
  TEXT = "TEXT",
  IMAGE = "IMAGE",
  CODE_BLOCK_NODE = "CODE_BLOCK_NODE"
}
export declare type NodeAnnotations = Map<RTENodeAnnotationMapKey, RTENodeAnnotationMapValue>;
/**
 * Abstract class for all nodes
 */
export declare abstract class RTENode<P extends RTEBlock = RTEBlock> {
  id: string;
  annotationMap: NodeAnnotations;
  abstract readonly type: string;
  abstract parent: P;
  protected constructor(id: string, annotationMap?: Map<RTENodeAnnotationMapKey, RTENodeAnnotationMapValue>);
  /**
   * Creates a new instance of the RTENode from the given JSON data.
   *
   * @param {unknown} json - The JSON data to create the node from.
   * @param {RTEBlock} parentBlock - The parent block of the node.
   * @param {VegaRTETransformOptions} options - Options for transforming the node.
   */
  static from(json: unknown, parentBlock: RTEBlock, options?: VegaRTETransformOptions): InstanceType<ClassType<RTENode>>;
  /**
   * Creates different types of text annotations based on the provided type and value.
   *
   * @param {keyof VegaRTETextAnnotations} type - The key of the type.
   * @param {unknown} value - The value that will be used to create the specific type of annotation entity based on the `type` provided.
   * @returns {Nullable<[RTENodeAnnotationMapKey, RTENodeAnnotationMapValue]>} Returning a nullable tuple containing a key and a
   * value from the `RTENodeAnnotationMapKey` and `RTENodeAnnotationMapValue` types.
   */
  protected static createAnnotationEntity(type: keyof VegaRTETextAnnotations | keyof VegaRTEImageAnnotations, value: unknown): Nullable<[RTENodeAnnotationMapKey, RTENodeAnnotationMapValue]>;
  /**
   * Get annotation by type
   *
   * @typedef T generic type
   * @param {RTENodeAnnotationMapKey} type - Annotation type
   * @returns {Nullable<T>} - Annotation
   */
  getAnnotationByType<T extends RTENodeAnnotationMapValue>(type: RTENodeAnnotationMapKey): Nullable<T>;
  /**
   * Delete annotation by type
   *
   * @param {RTENodeAnnotationMapKey} type - Annotation type
   */
  deleteAnnotationByType(type: RTENodeAnnotationMapKey): void;
  /**
   * Apply action to node
   *
   * @param {AnnotationAction} action - Annotation action
   * @returns {this} - Node
   */
  apply(action: AnnotationAction | ModifyContentAction): this;
  /**
   * Get styles from annotations
   *
   * @param {RTERenderContext} [options={ standalone: false }] - Options to control style mode
   * @returns {AnnotationStyle} - Annotation styles
   */
  getStyles(options?: RTERenderContext): AnnotationStyle;
  /**
   * Get classes from annotations
   *
   * @param {RTERenderContext} [options={ standalone: false }] - Options to control style mode
   * @returns {string} - Annotation style
   */
  getClasses(options?: RTERenderContext): string;
  /**
   * Get custom attribute annotation, excluding "class" and "style"
   *
   * @returns {CustomAttributeAnnotation} - custom attribute annotation
   */
  getCustomAttributesAnnotation(): CustomAttributeAnnotation;
  /**
   * Check if the node is a text node.
   *
   * @returns {boolean} - True if the node is a text node, false otherwise.
   */
  isTextNode(): this is RTETextNode;
  /**
   * Get the HTMLElement reference associated with this node.
   *
   * @returns {Nullable<HTMLElement>} The HTMLElement reference or null if not found.
   */
  protected getElementRef(): Nullable<HTMLElement>;
  /**
   * Generate attributes as string
   *
   * @param {VegaRTETransformOptions} [options] - Options for converting the node to HTML.
   * @param {...string} attrs - Additional attributes to include
   * @returns {string} - Attributes as string
   */
  protected generateAttributeString(options?: VegaRTETransformOptions, ...attrs: string[]): string;
  /**
   * apply annotation action or modify content action
   *
   * @param {AnnotationAction | ModifyContentAction} action annotation type action or modify content type action
   */
  protected doApply(action: AnnotationAction | ModifyContentAction): void;
  /**
   * Flush the value change
   */
  protected flushChange(): void;
  /**
   * Clones the annotations of the current RTETextNode.
   *
   * @returns {NodeAnnotations} A new Map containing cloned annotations.
   */
  protected cloneAnnotations(): NodeAnnotations;
  /**
   * Placeholder for the method to be implemented in sub classes.
   *
   * @param {AnnotationAction} action Annotation action
   */
  protected doAnnotationActionApply(action: AnnotationAction): void;
  /**
   * Placeholder for the method to be implemented in sub classes.
   *
   * @param {ModifyContentAction} action ModifyContentAction
   */
  protected doModifyActionApply(action: ModifyContentAction): void;
  /**
   * Clone the node.
   *
   * @param {RTEBlock} parent - The parent block of the cloned node.
   * @returns {InstanceType<ClassType<RTENode>>} A new instance of the node with cloned properties.
   */
  abstract clone(parent: P): RTENode<P>;
  /**
   * Convert the node to HTML.
   *
   * @param {VegaRTETransformOptions} [options] - Options for converting the node to HTML.
   * @returns {string} The HTML string representing the node.
   */
  abstract toHtml(options?: VegaRTETransformOptions): string;
  /**
   * Convert the node to a JSON object.
   *
   * @returns {unknown} The JSON representation of the node.
   */
  abstract toJSON(): unknown;
  /**
   * The range offset value when the cursor position at the end of the node content.
   *
   * @example For text node, it is the length of the text content.
   * @example For none-editable text node, it is the (index + 1) of the token in the parent children.
   * @example For image node, it is always 1.
   * @returns {number} - The end offset of the node.
   */
  abstract getRangeEndOffset(): number;
  /**
   * The container element when the cursor position at the start of the node content.
   *
   * @returns {Nullable<Node>} - The start container Node of the node.
   */
  abstract getRangeContainer(): Nullable<Node>;
  /**
   * Check if the node is a content editable node.
   *
   * @returns {boolean} - True if the node is content editable, false otherwise.
   */
  abstract isContentEditable(): boolean;
}
