From dc0e571d0afb47a4dba48ec05b8712dbd152884a Mon Sep 17 00:00:00 2001 From: James Swift Date: Sun, 23 Jan 2022 15:25:34 +0000 Subject: [PATCH] correct typings for voteablecontent Copied from unmerged pull request #339, all credit to FoxxMD --- 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;