Base class which provides default on/emit functions to child classes.
Events are specified by providing a type or interface as a type parameter.
The type parameter should list the supported event names and the event value type (or void
if there is no value).
Example
interfaceMyEvents { numberChanged: number; // event handlers will receive a number value print: void; // event handlers will receive no value }
classMyClassextendsEvented<MyEvents> { // ... }
constobject = newMyClass(); object.on("numberChanged", (value) => { // value is a number });
Base class which provides default on/emit functions to child classes.
Events are specified by providing a type or interface as a type parameter. The type parameter should list the supported event names and the event value type (or void if there is no value).
Example