vagusX / koa-proxies

a koa@2.x+ proxy middleware
https://vagusx.github.io/koa-proxies/
MIT License
161 stars 44 forks source link

options.events is missing in .d.ts #57

Closed Val-istar-Guo closed 3 years ago

Val-istar-Guo commented 4 years ago

https://github.com/vagusX/koa-proxies/blob/35d27b088174fe5c95a2d8661f2bb89f9bea48ec/index.d.ts#L5

throw Error when use events in Typescript

image

Val-istar-Guo commented 4 years ago

declare module 'koa-proxies' {
  interface IKoaProxiesOptions {
    events: {
      error?: (error: any, req: IncomingMessage, res: ServerResponse) => void
      proxyReq?: (proxyReq: ClientRequest, req: IncomingMessage, res: ServerResponse) => void
      proxyRes?: (proxyRes: IncomingMessage, req: IncomingMessage, res: ServerResponse) => void
    }
  }
}