dep: add socket.io-client
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { io, Socket } from 'https://unpkg.com/socket.io-client@4.8.1/dist/socket.io.esm.min.js'
|
import { io, Socket } from 'socket.io-client'
|
||||||
import { CallMethod, ClientEvent } from './ApiDeclare.ts'
|
import { CallMethod, ClientEvent } from './ApiDeclare.ts'
|
||||||
import ApiCallbackMessage from './ApiCallbackMessage.ts'
|
import ApiCallbackMessage from './ApiCallbackMessage.ts'
|
||||||
|
|
||||||
@@ -10,7 +10,9 @@ class Client {
|
|||||||
static connect() {
|
static connect() {
|
||||||
this.socket?.disconnect()
|
this.socket?.disconnect()
|
||||||
this.socket && delete this.socket
|
this.socket && delete this.socket
|
||||||
this.socket = io()
|
this.socket = io({
|
||||||
|
transports: ['websocket']
|
||||||
|
})
|
||||||
this.socket!.on("The_White_Silk", (name: string, data: UnknownObject, callback: (ret: UnknownObject) => void) => {
|
this.socket!.on("The_White_Silk", (name: string, data: UnknownObject, callback: (ret: UnknownObject) => void) => {
|
||||||
try {
|
try {
|
||||||
if (name == null || data == null) return
|
if (name == null || data == null) return
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
"mdui": "npm:mdui@2.1.4",
|
"mdui": "npm:mdui@2.1.4",
|
||||||
"split.js": "npm:split.js@1.3.2",
|
"split.js": "npm:split.js@1.3.2",
|
||||||
"crypto-es": "npm:crypto-es@3.1.0"
|
"crypto-es": "npm:crypto-es@3.1.0",
|
||||||
|
"socket.io-client": "npm:socket.io-client@4.8.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user