@nodescript/core
Version:
Visual programming language for Browser and Node
46 lines (45 loc) • 1.66 kB
TypeScript
import { GraphSpec } from '../types/model.js';
import { NodeEvalMode } from '../types/module.js';
import { MultiMap } from '../util/multimap.js';
import { ModuleLoader } from './ModuleLoader.js';
import { NodeLink, NodeView } from './NodeView.js';
export declare class GraphView {
readonly loader: ModuleLoader;
protected graphSpec: GraphSpec;
readonly parentNode: NodeView | null;
constructor(loader: ModuleLoader, graphSpec: GraphSpec, parentNode?: NodeView | null);
toJSON(): GraphSpec;
get scopeId(): string;
get moduleSpec(): import("../types/module.js").ModuleSpec;
get metadata(): Record<string, any>;
get rootNodeId(): string;
get rootGraph(): GraphView;
isSubgraph(): boolean;
ancestors(): Iterable<GraphView>;
isNodeExists(id: string): boolean;
getNodeById(id: string): NodeView | null;
getNodes(): NodeView[];
getRootNode(): NodeView | null;
getNodesByRef(ref: string): NodeView[];
/**
* Returns an array of the nodes that have no outbound links.
*/
rightmostNodes(): NodeView[];
getEmittedNodes(): NodeView[];
/**
* Returns `manual` if any of the emitted nodes are manually evaluated,
* otherwise returns `auto`.
*
* @see NodeView.getEvalMode for more info on node evaluation semantics.
*/
getEvalMode(): NodeEvalMode;
allLinks(): Iterable<NodeLink>;
/**
* Returns a map of all outbound links for each node.
*/
computeLinkMap(): MultiMap<string, NodeLink>;
collectRefs(): Iterable<string>;
uniqueRefs(): string[];
collectSubgraphs(): Iterable<GraphView>;
loadRefs(): Promise<void>;
}