import { Nullable } from '../../../../types/general';
import { CodeNodeType } from '../../types';
/**
 * The code block component range class.
 */
export declare class CodeBlockRange {
  contentOffset: number;
  selectedText: string;
  private codeContainerRef;
  /**
   * Initial the code block range.
   *
   * @param {HTMLElement} codeContainerRef - The code content container ref.
   */
  constructor(codeContainerRef: HTMLElement);
  /**
   * Update the code block range when the focus node changed or focus node content changed.
   *
   * @param {Node} startContainer - The focus node instance.
   * @param {number} startOffset - The focus offset.
   * @param {CodeNodeType[]} currentNodes - The current code node array.
   * @param {string} [selectedText] - The range selected text.
   * @returns {CodeBlockRange} - The new code block range instance.
   */
  updateRange(startContainer: Node, startOffset: number, currentNodes: CodeNodeType[], selectedText?: string): CodeBlockRange;
  /**
   * Update the cursor position when insert text or delete text...
   *
   * @param {number} newContentOffset - New value for content offset.
   * @returns {number} - The new content offset.
   */
  updateContentOffset(newContentOffset: number): number;
  /**
   * Create a native range from the current code block range.
   *
   * @param {CodeNodeType[]} nextCodeNodes - The code block node array.
   * @returns {Nullable<Range>} - The range instance.
   */
  createNativeRange(nextCodeNodes: CodeNodeType[]): Nullable<Range>;
  /**
   * Calculate the cursor position.
   *
   * @param {Node} startContainer - The cursor node.
   * @param {number} startOffset - The cursor offset.
   * @param {CodeNodeType[]} currentNodes - The code block node array.
   * @returns {number} - A number value.
   */
  private getContentOffset;
  /**
   * Get the next focus node of the code block node array.
   *
   * @param {CodeNodeType[]} codeNodes - The current code block array.
   * @param {number} contentOffset - The cursor position.
   * @returns {FocusNodeStateType} - The object contains next focus node index and offset.
   */
  private getFocusNodeState;
  /**
   * Get all code content from the code block node array.
   *
   * @param {CodeNodeType[]} codeNodes - The code block node array.
   * @returns {string} - The code content.
   */
  private getCodeContent;
}
