From 7e4bfb8a0285f77a1011444d364083d1546e8437 Mon Sep 17 00:00:00 2001 From: TheAppleFreak Date: Thu, 24 May 2018 14:29:20 -0400 Subject: [PATCH] @types/snoowrap - Make config parameter optional --- types/snoowrap/index.d.ts | 4 ++-- types/snoowrap/snoowrap-tests.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/types/snoowrap/index.d.ts b/types/snoowrap/index.d.ts index a2a36ff58e..cd2e3171d6 100644 --- a/types/snoowrap/index.d.ts +++ b/types/snoowrap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for snoowrap 1.15 +// Type definitions for snoowrap 1.16 // Project: https://github.com/not-an-aardvark/snoowrap // Definitions by: Vito Samson // TheAppleFreak @@ -49,7 +49,7 @@ declare class Snoowrap { checkCaptchaRequirement(): Promise; checkUsernameAvailability(name: string): Promise; composeMessage(options: Snoowrap.ComposeMessageParams): Promise; - config(opts: Snoowrap.ConfigOptions): Snoowrap.ConfigOptions; + config(opts?: Snoowrap.ConfigOptions): Snoowrap.ConfigOptions; createLivethread(options: LiveThreadSettings): Promise<_LiveThread>; createMultireddit(options: MultiRedditProperties & { name: string; subreddits: _Subreddit[] | string[]}): Promise<_MultiReddit>; createSubreddit(options: SubredditSettings): Promise<_Subreddit>; diff --git a/types/snoowrap/snoowrap-tests.ts b/types/snoowrap/snoowrap-tests.ts index dac5233653..5f83d5dfa2 100644 --- a/types/snoowrap/snoowrap-tests.ts +++ b/types/snoowrap/snoowrap-tests.ts @@ -54,3 +54,11 @@ export function getNewComments(subreddit: string): Listing { export function thenable(): Promise { return r.getMe().then(me => me.name); } + +export function getConfig(): Snoowrap.ConfigOptions { + return r.config(); +} + +export function setConfig(options: Snoowrap.ConfigOptions): Snoowrap.ConfigOptions { + return r.config(options); +}