Skip to content

Commit

Permalink
fix(cqhttp, puppeteer): typescript 4.1 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Nov 23, 2020
1 parent be953f0 commit 1d77469
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
atri
dist

/packages/*/*.js
/packages/*/*.d.ts
/build/*.js
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
dist
temp

/packages/*/*.js
/packages/*/*.d.ts
/build/*.js

/addons
/atri
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-cqhttp/src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class Channel {

constructor(private server: Server) {}

connect = (resolve: () => void, reject: (error: Error) => void, bot: Bot, socket: WebSocket) => {
connect = (resolve: (value: void) => void, reject: (error: Error) => void, bot: Bot, socket: WebSocket) => {
bot.ready = true
bot.socket = socket

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-cqhttp/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class WsClient extends Server {
const { token, server } = bot
if (!server) return
const Socket: typeof WebSocket = require('ws')
const connect = (resolve: () => void, reject: (reason: Error) => void) => {
const connect = (resolve: (value: void) => void, reject: (reason: Error) => void) => {
logger.debug('websocket client opening')
const headers: Record<string, string> = {}
const { retryInterval, retryTimes } = this.app.options
Expand Down
2 changes: 2 additions & 0 deletions packages/plugin-eval/src/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,10 @@ Helper.object = function (this: Helper, object, traps, deepTraps, mock) {
}
return success
},
// @ts-ignore
enumerate: () => {
try {
// @ts-ignore
return this.value(this.remote.Reflect.enumerate(object))
} catch (e) {
throw this.value(e)
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-puppeteer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function apply(ctx: Context, config: Config = {}) {
}
}

await new Promise((resolve, reject) => {
await new Promise<void>((resolve, reject) => {
logger.debug(`navigating to ${url}`)
const _resolve = () => {
clearTimeout(timer)
Expand Down

0 comments on commit 1d77469

Please sign in to comment.