import { CommandBase, PostCommandContext } from '../base/CommandBase';
import { Doc } from '../../view/Doc';
import { CommandPayloadMap } from '../types';
import { Wp, Wtc } from '../../model/document';
import { ModelNode } from '../../model/base';
type InsertFieldCommandOptions = CommandPayloadMap['insertField'];
export declare class InsertField extends CommandBase<'insertField'> {
    constructor(doc: Doc, payload: InsertFieldCommandOptions);
    protected execute(): Promise<PostCommandContext>;
    /**
     * 处理折叠状态下的文本（字段）插入
     */
    private handleCollapseText;
    /**
     * 处理选区下的文本（字段）插入
     */
    private handleSelectionText;
    protected isRootField(valuePath?: string): boolean;
    protected isNestedTableField(valuePath?: string): boolean;
    /**
     * 判断两个 valuePath 是否连续（父子关系）
     * @param parentPath 父路径，如 "$.a[n]"
     * @param childPath 子路径，如 "$.a[n].b" 或 "$.a[n].b[n].c"
     * @returns 是否为连续的父子关系
     *
     * @example
     * isConsecutivePath("$.a", "$.a.b")           // true
     * isConsecutivePath("$.a[n]", "$.a[n].b")     // true
     * isConsecutivePath("$.a[n].b[n]", "$.a[n].b[n].c") // true
     * isConsecutivePath("$.a", "$.b")             // false
     * isConsecutivePath("$.a[n].b", "$.a[n]")     // false (反向)
     */
    protected isConsecutivePath(parentPath: string, childPath: string): boolean;
    /**
     * 判断 childPath 是否可以在 parentPath 的循环区域中使用
     * @param parentPath 循环区域的路径，不以 [n] 结尾，如 "$.a" 或 "$.a[n].b"
     * @param childPath 要插入字段的路径，不以 [n] 结尾，如 "$.a.b" 或 "$.a[n].b.c"
     * @returns 是否兼容
     *
     * @example
     * isFieldPathCompatible("$.a", "$.a.b")              // true
     * isFieldPathCompatible("$.a", "$.a[n].b")           // true - 去掉开头 [n] 后 .b 没有 [n]
     * isFieldPathCompatible("$.a", "$.a[n].b[n].c")      // false - 去掉开头 [n] 后 .b[n].c 还有 [n]
     * isFieldPathCompatible("$.a[n].b", "$.a[n].b.c")    // true
     * isFieldPathCompatible("$.a[n].b", "$.a[n].b[n].c") // false - 去掉开头 [n] 后 .c 实际上应该检查原逻辑
     */
    protected isFieldPathCompatible(parentPath: string, childPath: string): boolean;
    protected getAncestorCell(node: ModelNode): Wtc | null;
    protected validateFieldPath(valuePath: string | undefined, node: Wp): boolean;
}
export {};
