Add CommentableAddress (#396)

Test plan: Not needed.

Paired with @wchargin
This commit is contained in:
Dandelion Mané 2018-06-14 14:52:29 -07:00 committed by GitHub
parent b6eebddeb0
commit a8bf6a36bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ export type ReviewAddress = {|
|};
export type CommentAddress = {|
+type: "COMMENT",
+parent: IssueAddress | PullAddress | ReviewAddress,
+parent: CommentableAddress,
+id: string,
|};
export type UserlikeAddress = {|
@ -90,6 +90,12 @@ export type ParentAddress =
| PullAddress
| ReviewAddress;
// Each of these types may have Comments as children
export type CommentableAddress = IssueAddress | PullAddress | ReviewAddress;
// Verify that Commentable is a subtype of Parent
const _unused_static = (_: CommentableAddress): ParentAddress => _;
export function fromRaw(x: RawAddress): StructuredAddress {
function fail() {
return new Error(`Bad address: ${NodeAddress.toString(x)}`);