Merge pull request #34270 from Zakjholt/patch-1

[Pusher-JS] update static type def to include static properties
This commit is contained in:
Benjamin Lichtman
2019-04-01 13:34:00 -07:00
committed by GitHub
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -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;
}
+3
View File
@@ -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" },