Interfaces work a little different than events on classes, because interfaces don't support 'getter' properies. The best way to implement them is with a method.
interface IMyInterface
{
onMyEvent(): IEvent<IMyInterface, IMyArgument>;
}
class MyClass implements IMyInterface
{
private _myEvent = new EventDispatcher<IMyInterface, IMyArgument>();
public onMyEvent(): IEvent<IMyInterface, IMyArgument>
{
return this._myEvent.asEvent();
};
}
interface IMyArgument
{
}
let myObject: IMyInterface = new MyClass();
myObject.onMyEvent().subscribe((s: IMyInterface, a: IMyArgument) => {
alert('Ping!');
});