import type { Ref } from 'vue'; export interface UseInlineEditOptions { /** 是否处于编辑器模式 */ editorMode: () => boolean; /** 当 Section setting 编辑完成时调用 */ onSettingUpdate?: (key: string, value: string) => void; /** 当 Block setting 编辑完成时调用 */ onBlockSettingUpdate?: (blockId: string, key: string, value: string) => void; /** 内联编辑开始时调用 */ onEditStart?: (key: string) => void; /** 内联编辑结束时调用 */ onEditEnd?: () => void; /** 编辑中按 Ctrl+Z/Y 时调用(先提交编辑再触发,让 admin 执行 undo/redo) */ onUndoRedo?: (action: 'redo' | 'undo') => void; } export interface UseInlineEditReturn { /** 绑定到可编辑的 Section setting 元素 */ editableAttrs: (settingKey: string) => Record; /** 绑定到可编辑的 Block setting 元素 */ blockEditableAttrs: (blockId: string, settingKey: string) => Record; /** 当前正在编辑的 key(null = 未编辑) */ editingKey: Ref; } /** * 内联编辑 composable * 封装 contentEditable 逻辑,让 Section 组件在 editorMode 下支持双击编辑文本 * * 设计思路:通过返回 attrs 对象配合 v-bind 使用,组件无需关心编辑状态管理 */ export declare function useInlineEdit(options: UseInlineEditOptions): UseInlineEditReturn;