mirror of
https://github.com/status-im/sourcecred.git
synced 2025-01-30 14:26:00 +00:00
Add EdgeTypes type in githubPlugin (#97)
This commit is contained in:
parent
f02e0610be
commit
5b420c6294
@ -147,9 +147,26 @@ export type NodeTypes = {|
|
|||||||
payload: BotNodePayload,
|
payload: BotNodePayload,
|
||||||
},
|
},
|
||||||
|};
|
|};
|
||||||
|
|
||||||
|
export type EdgeTypes = {|
|
||||||
|
AUTHORSHIP: {
|
||||||
|
id: AuthorshipEdgeID,
|
||||||
|
payload: AuthorshipEdgePayload,
|
||||||
|
},
|
||||||
|
CONTAINMENT: {
|
||||||
|
id: ContainmentEdgeID,
|
||||||
|
payload: ContainmentEdgePayload,
|
||||||
|
},
|
||||||
|
REFERENCE: {
|
||||||
|
id: ReferenceEdgeID,
|
||||||
|
payload: ReferenceEdgePayload,
|
||||||
|
},
|
||||||
|
|};
|
||||||
|
|
||||||
(function staticAssertions() {
|
(function staticAssertions() {
|
||||||
// Check that node payload types are exhaustive.
|
// Check that node & edge payload types are exhaustive.
|
||||||
(x: NodeType): $Keys<NodeTypes> => x;
|
(x: NodeType): $Keys<NodeTypes> => x;
|
||||||
|
(x: EdgeType): $Keys<EdgeTypes> => x;
|
||||||
|
|
||||||
// Check that each type is associated with the correct ID type.
|
// Check that each type is associated with the correct ID type.
|
||||||
// Doesn't work because of a Flow bug; should work if that bug is
|
// Doesn't work because of a Flow bug; should work if that bug is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user