@ndbx/runtime
Version:
The `@ndbx/runtime` package provides a runtime environment to embed NodeBox visualizations directly into React applications. NodeBox is a powerful tool for creating interactive and generative visualizations, and this runtime allows you to integrate those
18 lines (17 loc) • 1.44 kB
TypeScript
import { Item, Network, ParameterValue, LiteralValue } from "./types";
import Context from "./context";
import RuntimeNode from "./runtime-node";
export declare function renderItem(cx: Context, item: Item, values?: Record<string, LiteralValue>): Promise<any>;
export declare function evaluateItem(cx: Context, fqName: string, item: Item, values?: Record<string, LiteralValue>): Promise<RuntimeNode | undefined | null>;
export declare function evaluateNetwork(cx: Context, network: Network, values?: Record<string, LiteralValue>): Promise<RuntimeNode | null>;
/**
* Given a fully qualified item name (`userId/projectId/itemName`), create a runtime node for that item.
* @param {Context cx The context object.
* @param {string} nodeId The id of the node. Used for looking up port values in the context.
* @param {string} fqName The fully qualified item name.
* @returns {RuntimeNode} The runtime node for the given item.
*/
export declare function createRuntimeNodeForItem(cx: Context, nodeId: string, fqName: string): Promise<RuntimeNode | undefined>;
export declare function evaluateFunction(cx: Context, fqName: string, values?: Record<string, LiteralValue>): Promise<RuntimeNode | undefined>;
export declare function evaluateRuntimeNode(runtimeNode: RuntimeNode, values?: Record<string, ParameterValue>): Promise<void>;
export declare function sendChangeEvent(cx: Context, nodeId: string, parameterName: string): Promise<void>;