import { VegaCodeBlock } from '../../vega-code-block';
import { Nullable } from '../../../../types/general';
import { AutoRunWhenReRenderTaskQueueSlimmer } from '../../../../helpers/slimmers/auto-run-when-re-render-task-queue-slimmer.abstract';
import { CodeBlockRange } from './code-block-range';
/**
 * The class used to control the code block input cursor.
 */
export declare class VegaCodeBlockSelectionController extends AutoRunWhenReRenderTaskQueueSlimmer {
  static readonly SELECTION_CHANGE_DEBOUNCE_TIME: number;
  protected host: VegaCodeBlock['host'];
  protected contentRenderer: VegaCodeBlock['contentRenderer'];
  protected contentParseController: VegaCodeBlock['contentParseController'];
  protected insertCompositionTextController: VegaCodeBlock['insertCompositionTextController'];
  private codeBlockRange;
  private handleSelectionWithDebounce;
  constructor();
  /**
   * Get current range instance.
   *
   * @returns {Nullable<CodeBlockRange>} - The range instance or null.
   */
  getCurrentRange(): Nullable<CodeBlockRange>;
  /**
   * Update the text content offset, push the update native range task to a queue.
   *
   * @param {number} contentOffset - The next content offset.
   * @param {boolean} [immediatelyRun] - Run the task immediately or not.
   */
  setNextCodeBlockRange(contentOffset: number, immediatelyRun?: boolean): void;
  /**
   * Component lifecycle
   */
  protected addSelectionChangeEventListener(): void;
  /**
   * Component lifecycle
   */
  protected removeSelectionChangeEventListener(): void;
  /**
   * Get the code block selected range
   *
   * @returns {Selection} A [Selection](https://developer.mozilla.org/en-US/docs/Web/API/Selection) object
   */
  protected getSelection(): Selection;
  /**
   * The method invoke after the component re-render.
   */
  protected doTask: () => Promise<void>;
  /**
   * Notify the code content selection change event.
   */
  private handleSelectionChange;
  /**
   * Sync the code block range to make sure the code block range content offset is up to date after user click or selected text.
   */
  private syncCodeRangeByNativeRange;
  /**
   * This method is used to determine if the code block is currently focused or active.
   * In firefox and safari, the selection change event will trigger when the code block is not active, because the shadow selection polyfill will always return the selection of the code block.
   *
   * @returns {boolean} - Returns true if the code block is active, otherwise false.
   */
  private isCodeBlockActive;
}
