import { CursorMeta } from '../../command/types';
import { Doc } from '../../view/Doc';
import { ICursorPosition, ISelectionRange } from '../types/cursor';
/** 统一的光标解析输入（Command meta / 现有光标 / layout 重锚定） */
export type CursorResolveInput = {
    nodeId?: string;
    modelId?: string;
    offset: number;
    side: 'before' | 'after';
    phase: ICursorPosition['phase'];
    pathIndex?: number[];
};
export type ResolvedCursorState = {
    cursor: ICursorPosition | null;
    selection: ISelectionRange | null;
};
export declare function cursorPositionToInput(cursor: ICursorPosition): CursorResolveInput;
export declare function cursorMetaToInput(meta: CursorMeta, phase?: ICursorPosition['phase']): CursorResolveInput;
/** 统一入口：将 meta / 光标 / layout 重锚定输入解析为 ICursorPosition */
export declare function resolveCursorPosition(doc: Doc, input: CursorResolveInput): ICursorPosition | null;
export declare function resolveCursorStateFromMeta(doc: Doc, meta: CursorMeta, phase?: ICursorPosition['phase']): ResolvedCursorState | null;
export declare function resolveSelectionStateFromMeta(doc: Doc, start: CursorMeta, end: CursorMeta, phase?: ICursorPosition['phase']): ResolvedCursorState | null;
/** layout 后按当前光标状态重锚定 */
export declare function computeRealignedCursorState(doc: Doc): ResolvedCursorState | null;
