Add initial graph data types (#34)
This commit is contained in:
parent
d48e8e7f26
commit
2c083425fb
|
@ -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>},
|
||||||
|
};
|
Loading…
Reference in New Issue