root/global.d.ts
:
import {GGMessage} from "./GGMessage";
export {}
declare global {
export interface Window {onWebsocketsMessageReceived: (data: ArrayBuffer) => GGMessage | null}
}
root/src/webSocketProxy.ts
:
window.onWebsocketsMessageReceived
ISSUE - The mentioned line results in:
Error:(30, 36) TS2339: Property 'onWebsocketsMessageReceived' does not exist on type 'Window & typeof globalThis'.
Why is this happening? Although I remember it working perfectly before, pinpointing the exact changes that caused this error seems challenging. Nonetheless, all the provided code snippets appear to be correctly written.
tsconfig.json
:
{
"include": [
"src/**/*"
],
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"sourceMap": true,
"outDir": "./dist",
"strict": true,
"noImplicitAny": false,
"strictNullChecks": false,
}
}