From 27c18cb3ea8f106e242907690f67cbfed3c93fe1 Mon Sep 17 00:00:00 2001 From: Mayank Mandava Date: Thu, 2 Nov 2017 09:03:33 -0700 Subject: [PATCH] Fix snoowrap typedefs to refer to _Comment instead of Comment --- types/snoowrap/index.d.ts | 4 ++-- types/snoowrap/snoowrap-tests.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/snoowrap/index.d.ts b/types/snoowrap/index.d.ts index 05dfc821fd..e80814d6f9 100644 --- a/types/snoowrap/index.d.ts +++ b/types/snoowrap/index.d.ts @@ -62,7 +62,7 @@ declare class Snoowrap { getFriends(): Promise<_RedditUser[]>; getGoldSubreddits(options?: ListingOptions): _Listing<_Subreddit>; getHot(subredditName?: string, options?: ListingOptions): _Listing<_Submission>; - getInbox(options?: { filter?: string }): _Listing<_PrivateMessage | Comment>; + getInbox(options?: { filter?: string }): _Listing<_PrivateMessage | _Comment>; getKarma(): Promise>; getLivethread(threadId: string): _LiveThread; getMe(): _RedditUser; @@ -73,7 +73,7 @@ declare class Snoowrap { getMyTrophies(): Promise; getNew(subredditName?: string, options?: ListingOptions): _Listing<_Submission>; getNewCaptchaIdentifier(): Promise; - getNewComments(subredditName?: string, options?: ListingOptions): _Listing; + getNewComments(subredditName?: string, options?: ListingOptions): _Listing<_Comment>; getNewSubreddits(options?: ListingOptions): _Listing<_Subreddit>; getOauthScopeList(): Promise<{ [key: string]: { description: string; id: string; name: string } }>; getPopularSubreddit(options?: ListingOptions): _Listing<_Subreddit>; diff --git a/types/snoowrap/snoowrap-tests.ts b/types/snoowrap/snoowrap-tests.ts index 7c0588372c..dfea881a8b 100644 --- a/types/snoowrap/snoowrap-tests.ts +++ b/types/snoowrap/snoowrap-tests.ts @@ -1,6 +1,7 @@ import * as Snoowrap from 'snoowrap'; import { Comment, + Listing, LiveThread, MultiReddit, PrivateMessage, @@ -45,3 +46,7 @@ export function subreddit(name: string): Subreddit { export function wiki(subreddit: string, page: string): WikiPage { return r.getSubreddit(subreddit).getWikiPage(page); } + +export function getNewComments(subreddit: string): Listing { + return r.getNewComments(subreddit); +}