Adds proper comment type

This commit is contained in:
Oleg Silkin 2020-01-07 00:21:13 -05:00
parent eb8fff0e5a
commit d45c160b10

31
flow-typed/Comment.js vendored
View file

@ -1,19 +1,22 @@
declare type Comment = { declare type Comment = {
author?: string, comment: string, // comment body
author_url?: string, comment_id: string, // sha256 digest
claim_index?: number, timestamp: number, // integer representing unix-time
comment_id?: number, is_hidden: boolean, // claim owner may enable/disable this
downvotes?: number, channel_id?: string, // claimId of channel signing this comment
message: string, channel_name?: string, // name of channel claim
omitted?: number, channel_url?: string, // full lbry url to signing channel
reply_count?: number, signature?: string, // signature of comment by originating channel
time_posted?: number, signing_ts?: string, // timestamp used when signing this comment
upvotes?: number, is_channel_signature_valid?: boolean, // whether or not the signature could be validated
parent_id?: number, parent_id?: number, // comment_id of comment this is in reply to
claim_id?: string, // id linking to the claim this comment
}; };
// todo: relate individual comments to their commentId
declare type CommentsState = { declare type CommentsState = {
byId: {},
isLoading: boolean,
commentsByUri: { [string]: string }, commentsByUri: { [string]: string },
} byId: { [string]: Array<Comment> },
isLoading: boolean,
myComments: ?Set<Comment>,
};