fix: gravity node
All checks were successful
Deploy to GitHub Pages / build_site (push) Successful in 2m35s

This commit is contained in:
2024-05-02 18:49:08 +02:00
parent dca4469f55
commit 26d3f6a2f1
31 changed files with 1557 additions and 536 deletions

View File

@ -1,6 +1,8 @@
import { Graph, NodeDefinition, NodeId } from "./types";
export interface NodeRegistry {
/**
* The status of the node registry
* @remarks The status should be "loading" when the registry is loading, "ready" when the registry is ready, and "error" if an error occurred while loading the registry
@ -25,6 +27,16 @@ export interface NodeRegistry {
* @returns An array of all nodes
*/
getAllNodes: () => NodeDefinition[];
/**
* Register a new node
* @param wasmBuffer - The WebAssembly buffer for the node
* @returns The node definition
*/
register: (wasmBuffer: ArrayBuffer) => Promise<NodeDefinition>;
cache?: RuntimeCache<ArrayBuffer>;
}
export interface RuntimeExecutor {
@ -49,13 +61,13 @@ export interface RuntimeCache<T = unknown> {
* @param key - The key to get the value for
* @returns The value for the given key, or undefined if no such value exists
*/
get: (key: string) => T | undefined;
get: (key: string) => T | Promise<T> | undefined;
/**
* Set the value for the given key
* @param key - The key to set the value for
* @param value - The value to set
*/
set: (key: string, value: T) => void;
set: (key: string, value: T) => void | Promise<void>;
/**
* Clear the cache
*/