@nodescript/core
Version:
Visual programming language for Browser and Node
28 lines (27 loc) • 724 B
TypeScript
import { GraphView } from '../runtime/index.js';
import { ModuleSpec } from '../types/index.js';
export interface CompilerOptions {
graphId?: string;
comments: boolean;
introspect: boolean;
emitNodeMap: boolean;
emitAll: boolean;
}
export interface CompilerResult {
code: string;
moduleSpec: ModuleSpec;
}
/**
* Compiles a graph into a ESM module containing `compute` function.
*
* A compiled graph can be computed as follows:
*
* ```
* const { compute } = await import(code);
* const ctx = new GraphEvalContext(...);
* await compute(params, ctx);
* ```
*/
export declare class GraphCompiler {
compileEsm(graphView: GraphView, options?: Partial<CompilerOptions>): CompilerResult;
}