mirai-js 2.8.0-2 → 2.8.0-3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/node/Middleware.d.ts +2 -2
- package/package.json +1 -1
- package/src/Middleware.d.ts +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Processor } from './BaseType';
|
1
|
+
import { Processor, EventType } from './BaseType';
|
2
2
|
import { Bot } from './Bot';
|
3
3
|
|
4
4
|
export class Middleware {
|
@@ -128,7 +128,7 @@ export class Middleware {
|
|
128
128
|
* @description 生成一个带有中间件的事件处理器
|
129
129
|
* @param callback 事件处理器
|
130
130
|
*/
|
131
|
-
done(callback: Processor): Processor
|
131
|
+
done<E extends EventType[] | EventType>(callback: Processor<E extends EventType ? [E] : E>): Processor<E extends EventType ? [E] : E>;
|
132
132
|
|
133
133
|
}
|
134
134
|
|
package/package.json
CHANGED
package/src/Middleware.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Processor } from './BaseType';
|
1
|
+
import { Processor, EventType } from './BaseType';
|
2
2
|
import { Bot } from './Bot';
|
3
3
|
|
4
4
|
export class Middleware {
|
@@ -128,7 +128,7 @@ export class Middleware {
|
|
128
128
|
* @description 生成一个带有中间件的事件处理器
|
129
129
|
* @param callback 事件处理器
|
130
130
|
*/
|
131
|
-
done(callback: Processor): Processor
|
131
|
+
done<E extends EventType[] | EventType>(callback: Processor<E extends EventType ? [E] : E>): Processor<E extends EventType ? [E] : E>;
|
132
132
|
|
133
133
|
}
|
134
134
|
|