/**
 * 字段文档命令组。
 * 单个字段使用极简弹窗辅助填写，字段组使用模板直接插入。
 */
import type { EditorView } from "@codemirror/view";
import { FormDialog } from "../../../editor/dialog/FormDialog.js";
import { Command, type CommandContext } from "../../../editor/commands/Command";
import type { DialogCapableCommand } from "../../../editor/commands/DialogCommand";
import type { DialogType } from "../../../editor/commands/dialogTypes";
export type FieldVariant = "basic" | "group";
export type FieldStatus = "required" | "optional" | "deprecated";
export interface FieldDialogResult {
    name: string;
    fieldType: string;
    status: FieldStatus;
    defaultValue?: string;
    description: string;
}
declare class BasicFieldFormDialog extends FormDialog<FieldDialogResult> {
    /** 返回字段弹窗标题。 */
    get title(): string;
    /** 返回字段语法提示。 */
    get hint(): string;
    readonly fields: ({
        name: string;
        label: string;
        type: "text";
        required: boolean;
        placeholder: string;
        defaultValue: string;
        options?: undefined;
        rows?: undefined;
    } | {
        name: string;
        label: string;
        type: "text";
        placeholder: string;
        defaultValue: string;
        required?: undefined;
        options?: undefined;
        rows?: undefined;
    } | {
        name: string;
        label: string;
        type: "select";
        options: {
            value: string;
            label: string;
        }[];
        defaultValue: string;
        required?: undefined;
        placeholder?: undefined;
        rows?: undefined;
    } | {
        name: string;
        label: string;
        type: "text";
        placeholder: string;
        required?: undefined;
        defaultValue?: undefined;
        options?: undefined;
        rows?: undefined;
    } | {
        name: string;
        label: string;
        type: "textarea";
        rows: number;
        defaultValue: string;
        required?: undefined;
        placeholder?: undefined;
        options?: undefined;
    })[];
    /**
     * 将表单字段转换为字段块数据并补齐默认值。
     * @param raw - 表单提交的字段值
     * @returns 名称为空时返回 null，否则返回字段数据
     */
    toResult(raw: Record<string, string | boolean>): FieldDialogResult | null;
}
export declare const basicFieldFormDialog: BasicFieldFormDialog;
export declare class FieldCommand implements Command, DialogCapableCommand {
    private readonly variant;
    readonly dialogType: DialogType;
    renderDialog: (host: HTMLElement, props: Record<string, unknown>, callbacks: import("../../../editor/commands/DialogCommand").DialogCallbacks<FieldDialogResult>) => () => void;
    /**
     * 创建固定字段或字段组变体的命令。
     * @param variant - 插入单字段表单或字段组模板的变体
     */
    constructor(variant: FieldVariant);
    /**
     * 插入字段组模板，或通过弹窗插入单个字段块。
     * @param view - 要修改的 CodeMirror 编辑器实例
     * @param _payload - 未使用的命令参数
     * @param ctx - 单字段模式打开表单所需的命令上下文
     * @returns 用户取消弹窗或缺少事件总线时返回 false
     */
    execute(view: EditorView, _payload: unknown, ctx: CommandContext): Promise<boolean>;
}
/** `field` — 单个字段块 */
export declare const fieldCommand: FieldCommand;
/** `fieldGroup` — 字段组容器 */
export declare const fieldGroupCommand: FieldCommand;
export {};
//# sourceMappingURL=FieldCommand.d.ts.map