From 2eb59cbe982a12775b3bb12128de1e5369d6b538 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Tue, 3 Aug 2021 22:04:10 -0400 Subject: [PATCH] fix: correct typings for voteablecontent * approved and locked are available on both submission and comment * approved will undefined if the account making api calls is not a moderator of the subreddit the content is in --- src/objects/Comment.d.ts | 1 - src/objects/Submission.d.ts | 1 - src/objects/VoteableContent.d.ts | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/objects/Comment.d.ts b/src/objects/Comment.d.ts index 774fbb6d..e62c436b 100644 --- a/src/objects/Comment.d.ts +++ b/src/objects/Comment.d.ts @@ -4,7 +4,6 @@ import Subreddit from './Subreddit'; import VoteableContent from './VoteableContent'; export default class Comment extends VoteableContent { - approved: boolean; body_html: string; body: string; collapsed_reason: any; // ? diff --git a/src/objects/Submission.d.ts b/src/objects/Submission.d.ts index 07f82d8f..2664285c 100644 --- a/src/objects/Submission.d.ts +++ b/src/objects/Submission.d.ts @@ -74,7 +74,6 @@ export default class Submission extends VoteableContent { link_flair_text: string | null; link_flair_text_color: 'dark' | 'light'; link_flair_type: 'text' | 'richtext'; - locked: boolean; media: Media | null; media_embed: MediaEmbed; media_only: boolean; diff --git a/src/objects/VoteableContent.d.ts b/src/objects/VoteableContent.d.ts index 6fdc4c86..887bbe50 100644 --- a/src/objects/VoteableContent.d.ts +++ b/src/objects/VoteableContent.d.ts @@ -33,6 +33,7 @@ export type SubredditType = | 'public'; export default class VoteableContent extends ReplyableContent { + approved?: boolean; approved_at_utc: number | null; approved_by: RedditUser | null; archived: boolean; @@ -55,6 +56,7 @@ export default class VoteableContent extends ReplyableContent { edited: number | boolean; gilded: number; gildings: Gildings; + locked: boolean; /** true = upvoted, false = downvoted, null = hasn't voted */ likes: boolean | null; mod_note: string;