@getanthill/datastore
Version:
Event-Sourced Datastore
35 lines (34 loc) • 893 B
TypeScript
import type { Models } from '.';
import type { Services } from '../typings';
interface Node {
[key: string]: string | number;
}
export type NodeI = Node & {
id?: string;
group?: number;
};
interface Edge {
[key: string]: string | number;
}
export type EdgeI = Edge & {
source?: string;
target?: string;
value?: number;
key?: string;
correlation_field?: string;
};
interface Graph {
[key: string]: NodeI[] | EdgeI[];
}
export type GraphI = Graph & {
nodes?: NodeI[];
edges?: EdgeI[];
};
export default function getGraph(models: Models, options?: any): GraphI;
export declare function getEntitiesFromGraph(services: Services, modelName: string, query: any, options?: {
graph?: GraphI;
models?: string[];
withCorrelationFieldOnly?: boolean;
handler?: Function;
}, entities?: Map<string, any>): Promise<Map<string, any>>;
export {};