I am struggling to extend an interface in a library and I need some help. I am trying to extend the WebSocket interface from the ws library.
...
declare class WebSocket extends events.EventEmitter {
...
}
declare namespace WebSocket {
...
}
export = WebSocket;
In particular, I need to add a property called isAlive of type boolean to the WebSocket class.
I have tried:
import ws from 'ws';
declare module 'ws' {
export interface WebSocket {
isAlive: boolean;
}
}
but so far it has not been successful.