diff --git a/src/core/pusher.ts b/src/core/pusher.ts index 634c15c6c..24d447e6e 100644 --- a/src/core/pusher.ts +++ b/src/core/pusher.ts @@ -59,7 +59,7 @@ export default class Pusher { connection: ConnectionManager; timelineSenderTimer: PeriodicTimer; - constructor(app_key: string, options: Options) { + constructor(app_key: string, options?: Options) { checkAppKey(app_key); options = options || {}; if (!options.cluster && !(options.wsHost || options.httpHost)) { diff --git a/types/src/core/options.d.ts b/types/src/core/options.d.ts index ed79af525..509d2bac1 100644 --- a/types/src/core/options.d.ts +++ b/types/src/core/options.d.ts @@ -2,6 +2,7 @@ import { AuthOptions, AuthorizerGenerator } from './auth/options'; export interface PusherOptions { cluster: string; disableStats: boolean; + enableStats: boolean; statsHost: string; activity_timeout: number; pong_timeout: number; @@ -17,6 +18,7 @@ declare type Transport = 'ws' | 'wss' | 'xhr_streaming' | 'xhr_polling' | 'sockj declare type AuthTransport = 'ajax' | 'jsonp'; export interface Options { activityTimeout?: number; + enableStats?: boolean; disableStats?: boolean; authEndpoint?: string; auth?: AuthOptions; diff --git a/types/src/core/pusher.d.ts b/types/src/core/pusher.d.ts index 2e03c4475..95ae1da97 100644 --- a/types/src/core/pusher.d.ts +++ b/types/src/core/pusher.d.ts @@ -27,7 +27,7 @@ export default class Pusher { timelineSender: TimelineSender; connection: ConnectionManager; timelineSenderTimer: PeriodicTimer; - constructor(app_key: string, options: Options); + constructor(app_key: string, options?: Options); channel(name: string): Channel; allChannels(): Channel[]; connect(): void;