import { Doc } from '../view/Doc';
import { MoveOpts } from '../event/types';
import { PointerHitResult } from './hit/types';
import { Pos } from './session/CursorDragSession';
export declare class CursorController {
    doc: Doc;
    private dragRaf;
    private caretRaf;
    private dragSession;
    constructor(doc: Doc);
    private applyHitIntent;
    /** 拖入字段插入的位置的光标定位 */
    onCaretLocate(canvasX: number, canvasY: number, extra: {
        hitId?: string;
        isPreview: boolean;
    }): void;
    onClickAt(canvasX: number, canvasY: number, _pid: number | null, _pos?: Pos, extra?: {
        hitId?: string;
    }): string | undefined;
    onDragStartAt(canvasX: number, canvasY: number, pid: number | null, pos?: Pos, extra?: {
        hitId?: string;
    }): void;
    onDragMoveAt(canvasX: number, canvasY: number, pid: number | null, pos?: Pos, extra?: {
        hitId?: string;
    }): void;
    private flushDragMove;
    onDragEndAt(_canvasX: number, _canvasY: number, pid: number | null, pos?: Pos): void;
    /** 将当前光标重新对齐到指定节点 */
    resolveCursorAtNode(data: any): void;
    /** 将光标设置为选区对齐到指定节点 */
    resolveCursorRange(start: any, end: any): void;
    /** 处理方向键移动 */
    keydownArrowKey(opts: MoveOpts): void;
    clearCursor(): void;
    /** 把 cursorModel 的 cursor 坐标转成 DOM 坐标并定位 hiddenInput */
    private positionHiddenInputAtCursor;
    private intentToRange;
    private hitIntentToRange;
    /** 把两个 range 合并成一个 覆盖范围 */
    private mergeRanges;
    /**
     * 判断选区方向
     * @returns true 选区是从前往后 false 选区是从后往前
     */
    private getForward;
    /** 更新光标状态阶段 */
    applyCursorPhase(opts?: {
        phase?: 'preview' | 'commit';
        syncCaret?: boolean;
    }): void;
    /**
     * 根据鼠标位置，计算命中的页面及坐标信息
     */
    getPageHitInfo(canvasX: number, canvasY: number): {
        page: import('..').Page;
        canvasX: number;
        canvasY: number;
        relX: number;
        relY: number;
    } | null;
    /**
     * 解析指针命中结果
     */
    resolvePointerHit(canvasX: number, canvasY: number, pos?: Pos): PointerHitResult | null;
    destroy(): void;
}
