From 5b420c6294490043af5ec847c9f67b8ea6ba3541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dandelion=20Man=C3=A9?= Date: Tue, 20 Mar 2018 15:35:22 -0700 Subject: [PATCH] Add EdgeTypes type in githubPlugin (#97) --- src/plugins/github/githubPlugin.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/plugins/github/githubPlugin.js b/src/plugins/github/githubPlugin.js index 442996e..b70ecda 100644 --- a/src/plugins/github/githubPlugin.js +++ b/src/plugins/github/githubPlugin.js @@ -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 => x; + (x: EdgeType): $Keys => 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