Skip to content

Commit 2cdc569

Browse files
committed
window and global type fixing
1 parent 485c58e commit 2cdc569

File tree

4 files changed

+121
-3
lines changed

4 files changed

+121
-3
lines changed

packages/laravel-echo/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@
3737
"@babel/plugin-transform-numeric-separator": "^7.25.9",
3838
"@babel/plugin-transform-object-assign": "^7.25.9",
3939
"@babel/preset-env": "^7.26.7",
40+
"@types/jquery": "^3.5.32",
4041
"@types/node": "^20.0.0",
4142
"@typescript-eslint/eslint-plugin": "^8.21.0",
4243
"@typescript-eslint/parser": "^8.21.0",
44+
"axios": "^1.9.0",
4345
"eslint": "^9.0.0",
4446
"prettier": "^3.5.3",
4547
"pusher-js": "^8.0",
@@ -48,7 +50,8 @@
4850
"typescript": "^5.7.0",
4951
"vite": "^5.0.0",
5052
"vite-plugin-dts": "^3.0.0",
51-
"vitest": "^3.1.2"
53+
"vitest": "^3.1.2",
54+
"vue": "^3.5.13"
5255
},
5356
"peerDependencies": {
5457
"pusher-js": "*",

packages/laravel-echo/src/connector/pusher-connector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class PusherConnector<
4242
*/
4343
channels: Record<string, AnyPusherChannel> = {};
4444

45-
options: PusherOptions<TBroadcastDriver>;
45+
declare options: PusherOptions<TBroadcastDriver>;
4646

4747
/**
4848
* Create a fresh Pusher connection.
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
import type { JQueryStatic } from "@types/jquery";
2+
import type { AxiosStatic } from "axios";
13
import type Pusher from "pusher-js";
24
import type { io } from "socket.io-client";
5+
import type { VueElementConstructor } from "vue";
36

47
declare global {
58
interface Window {
@@ -8,7 +11,16 @@ declare global {
811
};
912

1013
io?: typeof io;
11-
1214
Pusher?: typeof Pusher;
15+
16+
Vue?: VueElementConstructor;
17+
axios?: AxiosStatic;
18+
jQuery?: JQueryStatic;
19+
Turbo?: object;
1320
}
21+
22+
const Vue: VueElementConstructor | undefined;
23+
const axios: AxiosStatic | undefined;
24+
const jQuery: JQueryStatic | undefined;
25+
const Turbo: object | undefined;
1426
}

pnpm-lock.yaml

Lines changed: 103 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)