Add initial graph data types (#34)

This commit is contained in:
Dandelion Mané 2018-02-26 16:52:24 -08:00 committed by GitHub
parent d48e8e7f26
commit 2c083425fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

26
backend/graph.js Normal file
View File

@ -0,0 +1,26 @@
// @flow
export type ID = {
pluginName: string,
repositoryName: string,
name: string,
};
export type GraphNode<T> = {
id: ID,
edges: ID[],
payload: T,
};
export type GraphEdge<T> = {
id: ID,
sourceId: ID,
destId: ID,
weight: number,
payload: T,
};
export type Graph = {
nodes: {[stringID: string]: GraphNode<mixed>},
edges: {[stringID: string]: GraphEdge<mixed>},
};