feat: update typescript version

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2021-12-26 01:21:06 +08:00
parent 72173b4778
commit 5ed61829e1
68 changed files with 234 additions and 161 deletions

View File

@ -47,7 +47,7 @@ export class WebSocket extends EventEmitter {
let TransportImpl = require('./netty').NettyWebSocket
this.client = new TransportImpl(url, subProtocol, headers)
console.debug('create websocket from ' + this.client.constructor.name)
} catch (error) {
} catch (error: any) {
console.error('create websocket impl error: ' + error)
console.ex(error)
return

View File

@ -31,7 +31,7 @@ var SslHandler: any
try {
SslContextBuilder = Java.type('io.netty.handler.ssl.SslContextBuilder')
InsecureTrustManagerFactory = Java.type('io.netty.handler.ssl.util.InsecureTrustManagerFactory')
} catch (error) {
} catch (error: any) {
SSLContext = Java.type('javax.net.ssl.SSLContext')
SslHandler = Java.type('io.netty.handler.ssl.SslHandler')
}
@ -45,7 +45,7 @@ try {
const EpollSocketChannel = Java.type('io.netty.channel.epoll.EpollSocketChannel')
group = epull ? new EpollEventLoopGroup() : new NioEventLoopGroup()
socketChannelClass = epull ? EpollSocketChannel.class : NioSocketChannel.class
} catch (error) {
} catch (error: any) {
group = new NioEventLoopGroup()
socketChannelClass = NioSocketChannel.class
}
@ -130,7 +130,7 @@ export class NettyWebSocket extends Transport {
future.sync()
// only trigger onconnect when not have error
this.onconnect({})
} catch (error) {
} catch (error: any) {
// ignore error exceptionCaught from handler
// this.onerror({ error })
}

View File

@ -35,7 +35,7 @@ export abstract class Transport extends EventEmitter {
console.debug(`client Transport connect`)
try {
this.doConnect()
} catch (error) {
} catch (error: any) {
console.ex(error)
this.onerror({ error })
}
@ -44,7 +44,7 @@ export abstract class Transport extends EventEmitter {
send(text: string) {
try {
this.doSend(text)
} catch (error) {
} catch (error: any) {
this.onerror({ error })
}
}
@ -55,7 +55,7 @@ export abstract class Transport extends EventEmitter {
try {
this.onclose({ code, reason })
this.doClose(code, reason)
} catch (error) {
} catch (error: any) {
this.onerror({ error })
} finally {
this.removeAllListeners()