@selenite/graph-editor
Version:
A graph editor for visual programming, based on rete and svelte.
24 lines (23 loc) • 1.04 kB
TypeScript
import Dexie, { type EntityTable } from 'dexie';
import type { Database, Graph, MacroBlock } from './types';
/** Database instance to work with IndexedDB. */
export declare const db: Dexie & {
graphs: EntityTable<Graph, "id">;
};
export declare class IndexedDBSource implements Database {
deleteMacro(id: string): Promise<void>;
clearGraphs(): Promise<void>;
clearMacroBlocks(): Promise<void>;
getGraphs(): Promise<Graph[]>;
getMacroBlocks(): Promise<MacroBlock[]>;
getMacroBlock(id: string): Promise<MacroBlock | undefined>;
getGraph(id: string): Promise<Graph | undefined>;
saveMacroBlock(graph: MacroBlock): Promise<string>;
saveGraph(graph: Graph): Promise<string>;
saveMacroBlocks(graphs: MacroBlock[]): Promise<string>;
saveGraphs(graphs: Graph[]): Promise<string>;
numGraphs: import("dexie").Observable<number>;
get numMacroBlocks(): import("dexie").Observable<number>;
graphs: import("dexie").Observable<Graph[]>;
get macroblocks(): import("dexie").Observable<Graph[]>;
}