How do we fix typescript error when using EventSource needed to handle SSE events?


I am using Server Sent Events (SSE) in my Ionic 2 typescript App and I get following error on console while running “ionic serve” command.

Error TS2304: Cannot find name ‘EventSource’

The functionality seems to work correctly and I can ignore this error on console, but I sometime miss genuine error on console due to several such error messages.

I tried to search definition using typings definition manager, but could not find any.
“typings search eventsource” or “typings search --name eventsource”