/** * Shader Graph * * Node-based visual shader programming system for HoloScript */ import type { IShaderGraph, IShaderNode, IShaderConnection, INodeTemplate, NodeCategory } from './ShaderGraphTypes'; /** * Serialized shader graph representation */ export interface ISerializedShaderGraph { id: string; name: string; description?: string; version?: string; metadata?: Record; nodes: IShaderNode[]; connections?: IShaderConnection[]; } /** * Shader graph builder for creating and editing shader graphs */ export declare class ShaderGraph implements IShaderGraph { id: string; name: string; description?: string; nodes: Map; connections: IShaderConnection[]; version: string; metadata?: Record; private nodeCounter; private connectionCounter; constructor(name?: string, id?: string); /** * Generate unique ID */ private generateId; /** * Create a node from a template */ createNode(type: string, position?: { x: number; y: number; }): IShaderNode | null; /** * Add a custom node */ addCustomNode(node: Omit): IShaderNode; /** * Get a node by ID */ getNode(nodeId: string): IShaderNode | undefined; /** * Remove a node by ID */ removeNode(nodeId: string): boolean; /** * Update node position */ setNodePosition(nodeId: string, x: number, y: number): boolean; /** * Update node property */ setNodeProperty(nodeId: string, key: string, value: unknown): boolean; /** * Get node property */ getNodeProperty(nodeId: string, key: string): unknown; /** * Connect two ports */ connect(fromNodeId: string, fromPortId: string, toNodeId: string, toPortId: string): IShaderConnection | null; /** * Disconnect a port */ disconnectPort(nodeId: string, portId: string): boolean; /** * Get all connections for a node */ getNodeConnections(nodeId: string): IShaderConnection[]; /** * Get input connections for a node */ getInputConnections(nodeId: string): IShaderConnection[]; /** * Get output connections for a node */ getOutputConnections(nodeId: string): IShaderConnection[]; /** * Check if connection would create a cycle */ private wouldCreateCycle; /** * Get nodes by category */ getNodesByCategory(category: NodeCategory): IShaderNode[]; /** * Get all output nodes */ getOutputNodes(): IShaderNode[]; /** * Get topologically sorted nodes (dependency order) */ getTopologicalOrder(): IShaderNode[]; /** * Validate the graph */ validate(): { valid: boolean; errors: string[]; warnings: string[]; }; /** * Clear the graph */ clear(): void; /** * Duplicate a node */ duplicateNode(nodeId: string, offset?: { x: number; y: number; }): IShaderNode | null; /** * Get available node templates */ static getAvailableNodeTemplates(): INodeTemplate[]; /** * Get node templates by category */ static getNodeTemplatesByCategory(category: NodeCategory): INodeTemplate[]; /** * Serialize to JSON */ toJSON(): ISerializedShaderGraph; /** * Deserialize from JSON */ static fromJSON(json: ISerializedShaderGraph): ShaderGraph; /** * Serialize to JSON string */ serialize(): string; /** * Deserialize from JSON string */ static deserialize(json: string): ShaderGraph; } //# sourceMappingURL=ShaderGraph.d.ts.map