mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-17 06:56:36 +00:00
Add initial graph data types (#34)
This commit is contained in:
parent
d48e8e7f26
commit
2c083425fb
26
backend/graph.js
Normal file
26
backend/graph.js
Normal 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>},
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user