14 lines
333 B
TypeScript
14 lines
333 B
TypeScript
|
class EventBase {
|
||
|
private _listeners: { (...args: any[]): void; }[] = [];
|
||
|
|
||
|
add(listener: (...args: any[]) => void): void {
|
||
|
this._listeners.push(listener);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class StringEvent extends EventBase {
|
||
|
add(listener: (items: string, moreitems: number) => void ) {
|
||
|
super.add(listener);
|
||
|
}
|
||
|
}
|