sourcecred/backend/graph.js
2018-02-26 16:52:24 -08:00

27 lines
397 B
JavaScript

// @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>},
};