import { TabObject } from "../../components/FlowMaterialPanel/constants"; import { WidgetValue } from "../../examples/BaseFlow/common/Output"; import { CSSProperties, ComponentType, ReactNode } from "react"; export type BaseNodeType = string | number; export type LoopStartConfig = { height: number; [key: string]: any; }; export type NodeSchema = { label: string; icon: ReactNode | null; color: string; id: BaseNodeType; desc: string; groupName?: string; style?: CSSProperties; handle?: { withSourceHandle: boolean; withTargetHandle: boolean; }; changeable?: { operation: boolean; nodeType: boolean; }; params?: Record; output?: WidgetValue["value"] | null; input?: WidgetValue["value"] | null; headerRight?: React.ReactElement; addable?: boolean; avatarPath?: string[]; [key: string]: any; }; export type NodeVersion = string; export type NodeWidget = { schema: NodeSchema; component: ComponentType; }; export type NodeVersionWidget = Record; interface RegisterNodeProps { nodeType: BaseNodeType; nodeVersionWidget: NodeVersionWidget; } export type NodeGroup = { groupName: string; nodeTypes: BaseNodeType[]; desc?: string; children?: NodeGroup[]; icon?: ReactNode; color?: string; avatar?: string; }; declare class NodeManager { nodesMap: Record; branchNodeIds: BaseNodeType[]; canReferenceNodeTypes: BaseNodeType[]; notMaterialNodeTypes: BaseNodeType[]; nodeType2ReferenceKey: Record; variableNodeTypes: BaseNodeType[]; nodeGroups: NodeGroup[]; startNodeType: BaseNodeType; loopNodeType: BaseNodeType; loopBodyType: BaseNodeType; loopStartType: BaseNodeType; materialNodeTypeMap: Partial>; avatarPath: string[]; loopStartConfig: LoopStartConfig; constructor(); registerNode({ nodeType, nodeVersionWidget }: RegisterNodeProps): void; registerBranchNodes(branchNodeTypes: BaseNodeType[]): void; registerCanReferenceNodeTypes(canReferenceNodeTypes: BaseNodeType[]): void; registerNotMaterialNodeTypes(notMaterialNodeTypes: BaseNodeType[]): void; registerNodeType2ReferenceKey(nodeType2ReferenceKey: Record): void; registerVariableNodeTypes(nodeTypes: BaseNodeType[]): void; registerStartNodeType(nodeType: BaseNodeType): void; registerLoopNodeType(nodeType: BaseNodeType): void; registerLoopBodyType(nodeType: BaseNodeType): void; registerLoopStartType(nodeType: BaseNodeType): void; registerLoopStartConfig(config: LoopStartConfig): void; registerNodeGroups(groups: NodeGroup[]): void; registerMaterialNodeTypeMap(tab2NodeType: Partial>): void; registerAvatarPath(avatarPath: string[]): void; } export declare const nodeManager: NodeManager; /** * 向外暴露注册节点方法 */ export declare const installNodes: (nodesMap: Record) => NodeManager; /** * 向外暴露注册「分支类」节点的方法 */ export declare const registerBranchNodes: (nodeTypes: BaseNodeType[]) => void; /** * 向外暴露注册「可引用类」节点的方法 */ export declare const registerCanReferenceNodeTypes: (nodeTypes: BaseNodeType[]) => void; /** * 向外暴露注册「不需要展示到物料列表」节点的方法 */ export declare const registerNotMaterialNodeTypes: (nodeTypes: BaseNodeType[]) => void; /** * 向外暴露注册需要「指定引用上文节点时,固定的前缀」 */ export declare const registerNodeType2ReferenceKey: (nodeTypes: Record) => void; /** * 向外暴露注册「变量节点类型列表」 */ export declare const registerVariableNodeTypes: (nodeTypes: BaseNodeType[]) => void; /** * 向外暴露注册「触发节点类型」 */ export declare const registerStartNodeType: (nodeType: BaseNodeType) => void; /** * 向外暴露注册「循环节点类型」 */ export declare const registerLoopNodeType: (nodeType: BaseNodeType) => void; /** * 向外暴露注册「循环体节点类型」 */ export declare const registerLoopBodyType: (nodeType: BaseNodeType) => void; /** * 向外暴露注册「循环体起始类型」 */ export declare const registerLoopStartType: (nodeType: BaseNodeType) => void; export declare const registerLoopStartConfig: (config: LoopStartConfig) => void; /** * 向外暴露注册「节点分组信息」 */ export declare const registerNodeGroups: (nodeGroups: NodeGroup[]) => void; /** * 向外暴露注册左侧「特殊物料面板节点类型」方法 */ export declare const registerMaterialNodeTypeMap: (tab2NodeType: Partial>) => void; /** * 向外暴露注册节点头像读取路径 */ export declare const registerAvatarPath: (avatarPath: string[]) => void; export {};