export type NodysseusNode = GraphNode | ValueNode | RefNode; type BaseNode = { id: string; name?: string; category?: string; }; export type GraphNode = Graph & { value?: any; category?: string; }; export type ValueNode = BaseNode & { value?: string; }; export type RefNode = BaseNode & { ref: string; value?: string; }; export declare const isNodeValue: (n: NodysseusNode) => n is ValueNode; export declare const isNodeGraph: (n: NodysseusNode) => n is GraphNode; export declare const isNodeRef: (n: NodysseusNode) => n is RefNode; export declare const compareNodes: (a: NodysseusNode, b: NodysseusNode) => boolean; export type SavedGraph = { id: string; out?: string; name?: string; nodes: Record; edges: Record; description?: string; }; export type Graph = SavedGraph & { edges_in?: Record>; }; export type ExportedGraph = { graphs: Array; state: Record; }; export declare const isGraph: (graph: any) => graph is Graph; export declare const isEdgesInGraph: (graph: Graph | SavedGraph) => graph is Graph; export declare const isExportedGraph: (g: ExportedGraph | unknown) => g is ExportedGraph; export type EdgesIn = Record>; export type Edge = EdgeNoAs & { as: string; }; export type EdgeNoAs = { to: string; from: string; }; export type Store = { get: (id: string) => T | undefined | Promise; set: (id: string, data: T) => T | Promise; delete: (id: string) => void; clear: () => void; keys: () => Array | Promise>; }; export type RefStore = Store & { addFromUrl: (url: string) => Array | Promise>; add_node: (graphId: string, node: NodysseusNode) => Graph | Promise; add_nodes_edges: (updates: { graphId: string; addedNodes?: NodysseusNode[]; addedEdges?: Edge[]; removedNodes?: NodysseusNode[]; removedEdges?: Array<{ [k in Exclude]: Edge[k]; }>; }) => Graph | Promise; remove_node: (graphId: string, node: NodysseusNode) => Graph | Promise; add_edge: (graphId: string, edge: Edge) => Graph | Promise; remove_edge: (graphId: string, edge: Edge) => Graph | Promise; undo?: false | ((id: string) => undefined | Graph | Promise); redo?: false | ((id: string) => undefined | Graph | Promise); }; export type StoreType> = Exclude, undefined | Promise>; export type NodysseusStoreTypes = { [k in keyof NodysseusStore]: StoreType; }; export type NodysseusStore = { refs: RefStore; parents: Store<{ parent: string; parentest: string; nodeRef?: string; }>; state: Store; persist: Store; fns: Store<{ script: string; fn: Function; }>; assets: Store; }; export type LokiT = { id: string; data: T; }; export type NonErrorResult = { __kind: "result"; value: any; }; export type Result = NonErrorResult | Error; export declare const isResult: (r: any) => r is NonErrorResult; export type BaseRunnable = { __kind: unknown; fn: string; graph: string | Graph; env: Env; lib: Lib; }; export type InputRunnable = Omit & { env?: Env; lib?: Lib; }; export declare const AP = "ap"; export type ApFunction = { __kind: "apFunction"; fn: Function; args: Array; promiseArgs?: boolean; rawArgs?: boolean; outputs?: { lib?: boolean; display?: boolean; }; }; export declare const isApFunction: (a: any) => a is ApFunction; export type ApFunctorLike = FunctorRunnable | ApRunnable | ApFunction | Function; export declare const isApFunctorLike: (a: any) => boolean; export type ApRunnable = { __kind: "ap"; fn: ApFunctorLike | Array; args: ConstRunnable | Env; lib: Lib; }; export declare const CONST = "const"; export type ConstRunnable = BaseRunnable & { __kind: "const"; }; export declare const FUNCTOR = "functor"; export type FunctorRunnable = BaseRunnable & { __kind: "functor"; parameters: Array; }; export type Runnable = Result | ApRunnable | FunctorRunnable | ConstRunnable; export declare const isRunnable: (r: any) => r is Runnable; export declare const isError: (r: any) => r is Error; export declare const isValue: (r: unknown) => r is NonErrorResult; export declare const isConstRunnable: (r: Runnable) => r is ConstRunnable; export declare const isApRunnable: (r: Runnable) => r is ApRunnable; export declare const isFunctorRunnable: (r: Runnable) => r is FunctorRunnable; export declare const isInputRunnable: (r: Runnable | InputRunnable) => r is InputRunnable; export declare const getRunnableGraph: (r: Runnable | InputRunnable, lib: Lib) => Graph; export declare const getRunnableGraphId: (r: Runnable | InputRunnable, lib: Lib) => string; export type Lib = { __kind: "lib"; data: Record; }; export declare const isLib: (lib: any) => lib is Lib; export type Env = { __kind: "env"; data: Args; _output?: string; env?: Env; node_id?: string; }; export declare const isEnv: (env: any) => env is Env; export type Extern = { args: Array | Record; fn: Function; }; export type NodeArg = { exists: boolean; name: string; } & Partial; export type Args = Map; export type ResolvedArgs = Map; export declare const isArgs: (args: any) => args is Args; export type RunOptions = { profile?: boolean; resolvePromises?: boolean; timings?: Record; }; type _BaseFullyTypedArg = { type: string | Record FullyTypedArg)>; default?: boolean; additionalArg?: boolean; local?: boolean; }; type _RunnableTypedArg = _BaseFullyTypedArg & { type: "@flow.runnable"; runnableParameters: Array; }; export type FullyTypedArg = _BaseFullyTypedArg | _RunnableTypedArg; export declare const isRunnableTypedArg: (a: FullyTypedArg) => a is _RunnableTypedArg; export type TypedArg = string | FullyTypedArg; export declare const isTypedArg: (a: any) => a is TypedArg; export type NodeMetadata = { parameters?: Array; values?: Array; dataLabel?: string; codeEditor?: { language?: "javascript" | "json" | "markdown" | false; onChange?: Function; editorText?: string; }; }; export type MemoryState = { __kind: "state"; id: string; set: ApFunction; state: T; }; export type MemoryReference = { __kind: "reference"; id: string; set: ApFunction; value: T; }; export declare class MemoryCache { private recacheFn; private valueFn; __kind: string; private cachedValue; constructor(recacheFn: (value: T) => boolean, valueFn: () => T); recache(): boolean; value(): T; } export type Memory = MemoryState | MemoryReference | MemoryCache; export declare const isMemory: (v: any) => boolean; export type GenericHTMLElement = { dom_type: string; children: Array; props: { onref: (el: any) => void; } & Record; value: any; }; export type GenericHTMLText = { dom_type: "text_value"; text: string; }; export type GenericHTMLNode = GenericHTMLElement | GenericHTMLText; export {};