export class NodeMaterial {
    nodes = [];
    addNode(node) {
        if (!node.id.trim() || !node.type.trim())
            throw new Error("NodeMaterial nodes require id and type.");
        if (this.nodes.some((entry) => entry.id === node.id))
            throw new Error(`Duplicate NodeMaterial node: ${node.id}`);
        this.nodes.push(node);
        return this;
    }
    toShaderKey() {
        return `node:${this.nodes.map((node) => node.type).join("+") || "empty"}`;
    }
}
//# sourceMappingURL=NodeMaterial.js.map