项目文件夹

文件
2025-11-03 01:26:28 +08:00

17 行
433 B
TypeScript

// node-spec-registry.ts — runtime registry for NodeSpec (shared between UI/runtime)
import type { NodeSpec } from './node-spec';
const REG = new Map<string, NodeSpec>();
export function registerNodeSpec(spec: NodeSpec) {
REG.set(spec.type, spec);
}
export function getNodeSpec(type: string): NodeSpec | undefined {
return REG.get(type);
}
export function listNodeSpecs(): NodeSpec[] {
return Array.from(REG.values());
}