import { Cd, Pd, Slot, StaticPathSlot } from '@p-lc/pd'; import { JsonPath } from '@p-lc/shared'; import { AnyEditorPlugin, EditorDefaultPropertiesExtHkt, EditorDefaultPropertiesExtHktPlugin, EditorRawPlugin } from '../../types'; import { editorPluginElementStoreFind } from '../element-store-plugins'; import { editorPluginI18nStore } from '../i18n-store-plugins'; import { UidlStoreUidlElement, editorPluginUidlStore, editorPluginUidlStoreComponents } from '../uidl-store-plugins'; /** * 编辑器 PD 仓库插件属性扩展高等类型 */ export interface EditorPluginPdStorePropertiesExtHkt { editor: { /** * PD 仓库 */ pdStore: PdStore; }; } /** * PD 仓库 */ export interface PdStore { /** * PD(对照表),pkgName -> PD */ pds: Record; /** * 添加 PD * @param pd PD */ addPd(pd: Pd): void; /** * 删除 PD * @param pkgName 包名 */ deletePd(pkgName: string): void; /** * 获取 PD * @param pkgName 包名 */ getPd(pkgName: string): Pd; /** * 获取包版本 * @param pkgName 报名 */ getPkgVersion(pkgName: string): string; /** * CD(对照表),pkgName -> componentType -> CD */ cds: Record | undefined>; /** * 获取 CD * @param pkgName 包名 * @param componentType 组件类型 */ getCd(pkgName: string, componentType: string): Cd; /** * 通过元素类型获取 CD * @param elementType 元素类型 */ getCdByEt(elementType: string): Cd; /** * 获取组件名称 * @param pkgName 包名 * @param componentType 组件类型 */ getComponentName(pkgName: string, componentType: string): string; /** * 通过元素类型获取组件名称 * @param elementType 元素类型 */ getComponentNameByEt(elementType: string): string; /** * 获取组件图标 * @param pkgName 包名 * @param componentType 组件类型 */ getComponentIcon(pkgName: string, componentType: string): string | null; /** * 通过元素类型获取组件图标 * @param elementType 元素类型 */ getComponentIconByEt(elementType: string): string | null; /** * 获取插槽 * @param pkgName 包名 * @param componentType 组件类型 */ getSlots(pkgName: string, componentType: string): Slot[]; /** * 通过元素类型获取插槽 * @param elementType 元素类型 */ getSlotsByEt(elementType: string): Slot[]; /** * 获取插槽 * @param pkgName 包名 * @param componentType 组件类型 * @param logicPath 逻辑路径 */ getSlot(pkgName: string, componentType: string, logicPath: JsonPath): Slot | null; /** * 通过元素类型获取插槽 * @param elementType 元素类型 * @param logicPath 逻辑路径 */ getSlotByEt(elementType: string, logicPath: JsonPath): Slot | null; /** * 是容器组件,有默认子元素插槽 * @param pkgName 包名 * @param componentType 组件类型 */ isContainerComponent(pkgName: string, componentType: string): boolean; /** * 通过元素类型判断为容器组件,有默认子元素插槽 * @param elementType 元素类型 */ isContainerComponentByEt(elementType: string): boolean; /** * 获取默认子元素插槽,会自动创建未知插槽 * @param element 元素或元素 ID */ getChildrenSlotWithUnknown(element: UidlStoreUidlElement | string): StaticPathSlot | null; } /** * EditorPluginPdStorePropertiesExtHkt 辅助类型 */ export interface $EditorPluginPdStorePropertiesExtHkt extends EditorDefaultPropertiesExtHkt { type: EditorPluginPdStorePropertiesExtHkt>; } /** * 编辑器 PD 仓库插件 */ export declare const editorPluginPdStore: EditorRawPlugin<$EditorPluginPdStorePropertiesExtHkt, typeof editorPluginI18nStore | typeof editorPluginUidlStore | typeof editorPluginUidlStoreComponents | typeof editorPluginElementStoreFind>; //# sourceMappingURL=editor-plugin-pd-store.d.ts.map