diff --git a/src/connector/connector.ts b/src/connector/connector.ts index dfd2053f..610ccc7d 100644 --- a/src/connector/connector.ts +++ b/src/connector/connector.ts @@ -20,6 +20,14 @@ export type EchoOptionsWithDefaults = { [key: string]: any; }; +declare global { + interface Window { + Laravel?: { + csrfToken?: string; + }; + } +} + export abstract class Connector< TBroadcastDriver extends BroadcastDriver, TPublic extends Channel, diff --git a/src/connector/pusher-connector.ts b/src/connector/pusher-connector.ts index 3a5ca507..3acbe711 100644 --- a/src/connector/pusher-connector.ts +++ b/src/connector/pusher-connector.ts @@ -10,6 +10,12 @@ type AnyPusherChannel = | PusherEncryptedPrivateChannel | PusherPresenceChannel; +declare global { + interface Window { + Pusher?: typeof Pusher; + } +} + /** * This class creates a connector to Pusher. */ diff --git a/src/connector/socketio-connector.ts b/src/connector/socketio-connector.ts index ad4fdc8a..a1abc29f 100644 --- a/src/connector/socketio-connector.ts +++ b/src/connector/socketio-connector.ts @@ -4,6 +4,12 @@ import type { io, ManagerOptions, Socket, SocketOptions } from 'socket.io-client type AnySocketIoChannel = SocketIoChannel | SocketIoPrivateChannel | SocketIoPresenceChannel; +declare global { + interface Window { + io?: typeof io; + } +} + /** * This class creates a connector to a Socket.io server. */ diff --git a/typings/window.d.ts b/typings/window.d.ts deleted file mode 100644 index 2976ba82..00000000 --- a/typings/window.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { io } from 'socket.io-client'; -import type Pusher from 'pusher-js'; - -export {}; - -declare global { - interface Window { - Laravel?: { - csrfToken?: string; - }; - - io?: typeof io; - - Pusher?: typeof Pusher; - } -}