@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
32 lines (31 loc) • 1.41 kB
TypeScript
import { Project, Item, Parameter, Port, FunctionItem, Choice, Section } from "./types";
import Context from "./context";
interface LoadResult {
status: "ok" | "error";
message?: string;
assetsUrlTemplate?: string;
project?: Project;
}
export declare function loadProjectThroughApi(url: string): Promise<LoadResult>;
export declare function loadProjectDirectly(url: string): Promise<LoadResult>;
export declare const CURRENT_FORMAT_VERSION = 1;
export declare const config: {
apiRoot: string;
publishedUrlTemplate: string;
assetsUrlTemplate: string;
libUrlTemplate: string;
bareImportReplacer: (name: string) => string;
};
export declare function loadMainProject(userId: string, projectId: string, version: string): Promise<Context>;
export declare function parseNodeStatements(statements: string[]): {
parameters: Parameter[];
sections: Section[];
inputPorts: Port[];
outputPorts: Port[];
};
export declare function parseChoices(choices: string[] | string[][]): Choice[];
export declare function loadAsset(cx: Context, userId: string, projectId: string, filename: string): Promise<any>;
export declare function fileExtension(filename: string): string;
export declare function loadItem(cx: Context, item: Item, itemKey: string): Promise<void>;
export declare function loadFunction(cx: Context, item: FunctionItem, itemKey: string): Promise<void>;
export {};