import { JsonPath, POSITION_TYPE_BEFORE, POSITION_TYPE_AFTER } from '@p-lc/shared'; import { AnyEditorPlugin, EditorDefaultPropertiesExtHkt, EditorDefaultPropertiesExtHktPlugin, EditorRawPlugin } from '../../types'; import { editorPluginI18nStore } from '../i18n-store-plugins'; import { editorPluginPdStore } from '../pd-store-plugins'; import { UidlStoreUidlElement, editorPluginUidlStore, editorPluginUidlStoreComponents, editorPluginUidlStoreEdit } from '../uidl-store-plugins'; import { editorPluginUidlUtilsConfig } from '../uidl-utils-config-plugins'; import { editorPluginElementStoreFind } from './editor-plugin-element-store-find'; import { editorPluginElementStoreIs } from './editor-plugin-element-store-is'; import { editorPluginElementStoreSelect } from './editor-plugin-element-store-select'; /** * 编辑器元素仓库编辑插件属性扩展高等类型 */ export interface EditorPluginElementStoreEditPropertiesExtHkt { editor: { /** * 元素仓库 */ elementStore: { /** * 创建元素 * @param pkgName 包名 * @param componentType 组件类型 */ createElement(pkgName: string, componentType: string): UidlStoreUidlElement; /** * 添加元素到尾部 * @param elementId 元素 ID * @param slotLogicPath 插槽逻辑路径 * @param dynamicRender 动态渲染 * @param childElement (将被插入的)子元素 */ appendElement(elementId: string, slotLogicPath: JsonPath, dynamicRender: boolean, childElement: UidlStoreUidlElement): void; /** * 插入元素 * @param elementId 元素 ID * @param siblingElement (将被插入的)兄弟元素 * @param order 兄弟元素处在该元素的前面还是后面,默认:`'after'` */ insertElement(elementId: string, siblingElement: UidlStoreUidlElement, order?: typeof POSITION_TYPE_BEFORE | typeof POSITION_TYPE_AFTER): void; /** * 可以通过目标元素(定位)添加元素 * @param targetElement 目标元素 */ canAddElementByElement(targetElement?: UidlStoreUidlElement | null): boolean; /** * 通过目标元素(定位)添加元素: * * 目标元素为容器组件:添加到目标元素子元素末尾 * * 目标元素为非容器组件:添加到目标元素之后 * * 目标元素不存在:添加到根元素末尾 * @param element 元素 * @param targetElement 目标元素 */ addElementByElement(element: UidlStoreUidlElement, targetElement?: UidlStoreUidlElement | null): void; /** * 删除元素 * @param elementId 元素 ID * @param clearUidlComponents 清理 UIDL 组件,默认:true */ deleteElement(elementId: string, clearUidlComponents?: boolean): UidlStoreUidlElement | null; /** * 编辑元素,根据元素 ID 编辑 * @param element 元素 * @param recipeId 配方 ID */ editElement(element: UidlStoreUidlElement, recipeId?: string | number | null): void; }; }; } /** * EditorPluginElementStoreEditPropertiesExtHkt 辅助类型 */ export interface $EditorPluginElementStoreEditPropertiesExtHkt extends EditorDefaultPropertiesExtHkt { type: EditorPluginElementStoreEditPropertiesExtHkt>; } /** * 编辑器元素仓库编辑插件 */ export declare const editorPluginElementStoreEdit: EditorRawPlugin<$EditorPluginElementStoreEditPropertiesExtHkt, typeof editorPluginUidlStore | typeof editorPluginUidlStoreEdit | typeof editorPluginUidlStoreComponents | typeof editorPluginElementStoreIs | typeof editorPluginElementStoreFind | typeof editorPluginElementStoreSelect | typeof editorPluginUidlUtilsConfig | typeof editorPluginPdStore | typeof editorPluginI18nStore>; //# sourceMappingURL=editor-plugin-element-store-edit.d.ts.map