From 1ebb102404ccff620076c358d5cda61affe11ef6 Mon Sep 17 00:00:00 2001 From: Zak Holt Date: Wed, 27 Mar 2019 11:45:47 -0400 Subject: [PATCH 1/2] update static type def Types are found here https://github.com/pusher/pusher-js/blob/7837cf20fab8797bba7dbc5ceb7b088a87244832/src/core/pusher.ts#L25 --- types/pusher-js/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/pusher-js/index.d.ts b/types/pusher-js/index.d.ts index f73a84ee52..a09c352386 100644 --- a/types/pusher-js/index.d.ts +++ b/types/pusher-js/index.d.ts @@ -8,6 +8,8 @@ declare namespace pusher { interface PusherStatic { logToConsole: boolean; log: (msg: string) => void; + instances: Pusher[]; + isReady: boolean; new (apiKey: string, config?: Config): Pusher; } From 4d63aba7f1ba8dc3953a64a1d77b09cc3a452872 Mon Sep 17 00:00:00 2001 From: Zak Holt Date: Sun, 31 Mar 2019 09:18:01 -0400 Subject: [PATCH 2/2] update test --- types/pusher-js/pusher-js-tests.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/pusher-js/pusher-js-tests.ts b/types/pusher-js/pusher-js-tests.ts index 7381c48e73..29a3f693e8 100644 --- a/types/pusher-js/pusher-js-tests.ts +++ b/types/pusher-js/pusher-js-tests.ts @@ -13,6 +13,7 @@ var pusher: Pusher.Pusher; // Pusher.logToConsole = true; +Pusher.instances = []; Pusher.log = (msg) => { console.log(msg); @@ -26,6 +27,8 @@ pusher = new Pusher(APP_KEY, { authEndpoint: "http://example.com/pusher/auth" }); +console.assert(!!Pusher.instances.length, "Pusher.instances not filling with new instances"); + pusher = new Pusher(APP_KEY, { auth: { params: { foo: "bar" },