Update TypeScript 4.3.5 -> 4.6.3, replace typings to native socket.io

This commit is contained in:
Gregor Biswanger
2022-04-06 22:33:54 +02:00
parent b4b355eeac
commit 5ca65f1939
3 changed files with 9 additions and 8 deletions

View File

@@ -1,9 +1,10 @@
import { Socket } from "socket.io";
export class Connector {
constructor(private socket: SocketIO.Socket,
// @ts-ignore
constructor(private socket: Socket,
public app: Electron.App) { }
on(key: string, javaScriptCode: Function): void {
on(key: string, javaScriptCode: (...args) => void): void {
this.socket.on(key, (...args: any[]) => {
const id: string = args.pop();

View File

@@ -1,13 +1,13 @@
// @ts-ignore
import * as Electron from "electron";
import { Socket } from "socket.io";
import { Connector } from "./connector";
export class HookService extends Connector {
constructor(socket: SocketIO.Socket, public app: Electron.App) {
constructor(socket: Socket, public app: Electron.App) {
super(socket, app);
}
onHostReady(): void {
onHostReady() {
// execute your own JavaScript Host logic here
}
}

View File

@@ -13,7 +13,7 @@
"author": "Gregor Biswanger",
"license": "MIT",
"devDependencies": {
"@types/socket.io": "^2.1.12",
"typescript": "^4.3.5"
"socket.io": "^4.4.1",
"typescript": "^4.6.3"
}
}