From 2ca8f018473274fa544234c91fc608fa9bf09032 Mon Sep 17 00:00:00 2001 From: waiting Date: Sun, 8 Jul 2018 00:14:33 +0800 Subject: [PATCH] feat(typings): define Messenger['on'] and Messenger['once'] (#2763) --- index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index b831cd12e2..4a2a2f6b84 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,6 +1,7 @@ import * as accepts from 'accepts'; import * as KoaApplication from 'koa'; import * as KoaRouter from 'koa-router'; +import { EventEmitter } from 'events' import { RequestOptions } from 'urllib'; import { Readable } from 'stream'; import { Socket } from 'net'; @@ -1035,7 +1036,7 @@ declare module 'egg' { }; // send data can be number|string|boolean|object but not Set|Map - export interface Messenger { + export interface Messenger extends EventEmitter { /** * broadcast to all agent/app processes including itself */