From f4667b3ed1fc43c3078ec47635f866b5ade4303b Mon Sep 17 00:00:00 2001 From: Goscha Graf Date: Mon, 4 Feb 2019 20:03:57 +0100 Subject: [PATCH 1/4] Adds string[] type to Params.follow According to the docs and my previous experience working with the API you can provide arrays, here the official documentation: https://developer.twitter.com/en/docs/tweets/filter-realtime/api-reference/post-statuses-filter.html --- types/twit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index a66e75bab7..6bcf7482bf 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -263,7 +263,7 @@ declare module 'twit' { user_id?: number | string, lat?: number, long?: number, - follow?: boolean | string, + follow?: boolean | string | string[], include_email?: boolean, cursor?: number | string, tweet_mode?: string, From 44f8c119454610080a3fb9c71d9678799c3fdec5 Mon Sep 17 00:00:00 2001 From: Goscha Graf Date: Mon, 4 Feb 2019 20:07:49 +0100 Subject: [PATCH 2/4] Add to definitions by --- types/twit/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index 6bcf7482bf..07931e6132 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -5,6 +5,8 @@ // abraham // siwalik // plhery +// justGoscha +// // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From 981c89910dd7a39d5c76bce08ca4230b9d75658c Mon Sep 17 00:00:00 2001 From: justgoscha Date: Mon, 4 Feb 2019 20:39:29 +0100 Subject: [PATCH 3/4] Add test for Params type --- types/twit/twit-tests.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/twit/twit-tests.ts b/types/twit/twit-tests.ts index 1029bda13c..bfdc870f13 100644 --- a/types/twit/twit-tests.ts +++ b/types/twit/twit-tests.ts @@ -11,3 +11,8 @@ t.post('statuses/update', { status: 'hello!' }).then(res => { console.log(status.id_str) console.log(res.resp.statusCode) }) + +t.stream('statuses/filter', { + track: ['#love','#goscha'], + follow: ['40436619', '606663038', '14466815'] + }) From 0d345db80d2f84ce2090033ee4c7058e7b2ab31a Mon Sep 17 00:00:00 2001 From: justgoscha Date: Mon, 4 Feb 2019 21:01:46 +0100 Subject: [PATCH 4/4] Remove empty comment line --- types/twit/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/twit/index.d.ts b/types/twit/index.d.ts index 07931e6132..778a112ee3 100644 --- a/types/twit/index.d.ts +++ b/types/twit/index.d.ts @@ -6,7 +6,6 @@ // siwalik // plhery // justGoscha -// // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3