import React from "react"; import { DesignerContext } from "../context"; import { ComponentData } from "../parsers"; import { SizeType } from "antd/es/config-provider/SizeContext"; interface Props { storageId: string; /** * 当前正在编辑的数组,生成 id 时作为「已存在 id」的判重来源之一。 * 缺少页面上下文(DesignerContext)时,可保证新增项与本数组已有项不冲突。 */ items?: any[]; size?: SizeType; style?: React.CSSProperties; onAdd?: (typeName: string, item: any) => void; } interface State { selectedTypeName?: string; typeNames: string[]; } /** * 组件数据追加器,用于在数组组件在面板中追加新的组件数据项 */ export declare class ComponentAppender extends React.Component { private typeListModal; private componentEditors; static contextType: React.Context; context: React.ContextType; static defaultProps: { size: string; }; constructor(props: Props); private getComponentEditors; /** * 组件类型下拉选项:按模块分组,与齿轮弹窗(ComponentTypeListModal)的分组一致。 * 分组来源为 moduleTypes(设计器内取 DesignerContext,独立使用时回退到全局注册表)。 */ private getTypeNameOptions; /** * 生成友好的 id:类型名 + 序号(Button1、Button2 …)。 * @param pageData 页面(或所属组件)数据,保证 id 在页面内唯一;不可用时可为空。 * @param items 当前正在编辑的数组,避免新增项与数组已有项 id 冲突。 */ static newId(pageData: ComponentData | undefined, typeName: string, items?: any[]): string; static existId(pageData: ComponentData, key: string): boolean; static assignChildIds(pageData: ComponentData): void; private addItem; private setPropertyValue; componentDidMount(): void; render(): React.JSX.Element; } export {};