mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-17 06:56:36 +00:00
Add CommentableAddress
(#396)
Test plan: Not needed. Paired with @wchargin
This commit is contained in:
parent
b6eebddeb0
commit
a8bf6a36bf
@ -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)}`);
|
||||
|
Loading…
x
Reference in New Issue
Block a user