import { VegaSlimmer } from '../../../../vega-slimmer/vega-slimmer-core';
import { VegaRichTextEditor } from '../../vega-rich-text-editor';
/** Handles inserting composition text into a VegaRTEContent based on the current selection and input event. User input character will trigger this callback */
export declare class InsertCompositionTextController extends VegaSlimmer {
  protected selectionController: VegaRichTextEditor['selectionController'];
  protected host: VegaRichTextEditor['host'];
  protected value: VegaRichTextEditor['value'];
  protected valueController: VegaRichTextEditor['valueController'];
  protected userInputController: VegaRichTextEditor['userInputController'];
  protected vegaRichTextEditorRenderer: VegaRichTextEditor['vegaRichTextEditorRenderer'];
  private editableElementRef;
  private insertCompositionTextEndFlag;
  private mutationObserver;
  private observerOptions;
  /**
   * The function `initMutationObserver` initializes a MutationObserver on an editable HTML element if it exists.
   */
  initMutationObserver(): void;
  /**
   * Disconnects the mutation observer if it exists.
   */
  removeObserver(): void;
  /**
   * The method is to get the composition text insert end or not.
   *
   * @returns {boolean} The false is main that insert composition text process is end.
   */
  isComposing(): boolean;
  /**
   * The current method is called when the insert text is update by the Pinyin input or the word correction plugin.
   *
   * @param {MutationRecord[]} records - The mutation record object array.
   */
  updateTextFromDom: (records: MutationRecord[]) => void;
  /**
   * Adds event listener to an editable HTML element to handle composition text insert actions.
   */
  protected addCompositionTextEventListener(): void;
  /**
   * Removes event listener to an editable HTML element to handle composition text insert actions.
   */
  protected removeCompositionTextEventListener(): void;
  /**
   * re-connect the observer after the props change and component did render
   */
  protected reConnectObserver(): void;
  /**
   * Processes mutation records related to character data and updates the text content of a rich text node accordingly.
   *
   * @param {MutationRecord[]} records - Each `MutationRecord` object represents a single mutation that occurred in the DOM.
   */
  private handleObserver;
  /**
   * Insert text to a line break node need a special logic if the line break has a next text node.
   *
   * @param {RTETextNode} currentNode The current line break node, the text value is \n
   */
  private appendLineBreakNode;
  /**
   * Updates the text content of a rich text node and handles line breaks.
   *
   * @param {RTETextNode} richTextNode - The current rich text node.
   * @param {string} newValue - The target element textContent
   * @param {Nullable<string>} oldValue - The target element old textContent
   * @returns {Nullable<boolean>} The node text is updated or not
   */
  private updateCurrentNodeText;
  /**
   * An event handler function that is triggered when the composition of text input starts. In this case,
   *  it sets the `insertCompositionTextEndFlag` property of the `UserInputController` class to `false`.
   */
  private handleCompositionStart;
  /**
   * An event handler function that is triggered when the composition of text input ends. In this case,
   *  it sets the `insertCompositionTextEndFlag` property of the `UserInputController` class to `true`.
   *
   * @param {CompositionEvent} event The composition event instance
   */
  private handleCompositionEnd;
  /**
   * The function `getEditableElementRef` returns a reference to the editable HTMLDivElement within a rich text editor.
   *
   * @returns {Nullable<HTMLDivElement>} A reference to an HTMLDivElement element that is editable.
   */
  private getEditableElementRef;
  /**
   * Remove the ZERO_WIDTH_SPACE from the text.
   *
   * @param {string} text The input text that could include ZERO_WIDTH_SPACE.
   * @returns {string} The result text.
   */
  private removeZeroWidthSpace;
  /**
   * Dispatch a insert text event to handle the composition text insert logic.
   *
   * @param {string} text - The text need to insert.
   */
  private dispatchInsertTextEvent;
}
