@tokens-studio/graph-engine
Version:
An execution engine to handle Token Studios generators and resolvers
40 lines • 1.24 kB
TypeScript
import { GraphSchema } from '../schemas/index.js';
import { Edge } from './edge.js';
import { Node } from './node.js';
export interface IPort<T = any> {
name: string;
visible: boolean;
node: Node;
type: GraphSchema;
value: T;
annotations?: Record<string, any>;
}
export declare class Port<T = any> {
/**
* Name to show in the side panel.Optional
* */
readonly name: string;
visible: boolean;
node: Node;
protected _dynamicType: GraphSchema | null;
protected _type: GraphSchema;
protected _value: T;
annotations: Record<string, any>;
/**
* Unless the port is variadic this will always be a single edge on an input port, however on an output port it can be multiple edges
*/
_edges: Edge[];
constructor(props: IPort<T>);
get isConnected(): boolean;
get dynamicType(): import("../schemas/index.js").SchemaObject | null;
get value(): T;
/**
* Gets the current type . This might be different from the static type if the value is dynamic
* @returns
*/
get type(): GraphSchema;
setVisible(visible: boolean): void;
setNode(node: Node): void;
setType(type: GraphSchema): void;
}
//# sourceMappingURL=port.d.ts.map