Add EdgeTypes type in githubPlugin (#97)

This commit is contained in:
Dandelion Mané 2018-03-20 15:35:22 -07:00 committed by GitHub
parent f02e0610be
commit 5b420c6294
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 1 deletions

View File

@ -147,9 +147,26 @@ export type NodeTypes = {|
payload: BotNodePayload,
},
|};
export type EdgeTypes = {|
AUTHORSHIP: {
id: AuthorshipEdgeID,
payload: AuthorshipEdgePayload,
},
CONTAINMENT: {
id: ContainmentEdgeID,
payload: ContainmentEdgePayload,
},
REFERENCE: {
id: ReferenceEdgeID,
payload: ReferenceEdgePayload,
},
|};
(function staticAssertions() {
// Check that node payload types are exhaustive.
// Check that node & edge payload types are exhaustive.
(x: NodeType): $Keys<NodeTypes> => x;
(x: EdgeType): $Keys<EdgeTypes> => x;
// 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