diff --git a/src/list.ts b/src/list.ts index 205722a..0e5cfce 100644 --- a/src/list.ts +++ b/src/list.ts @@ -1,6 +1,12 @@ import { EventEmitter } from 'eventemitter3'; -export class List extends EventEmitter<'update'> implements RelativeIndexable { +export class List + extends EventEmitter<{ + update: []; + add: [T]; + }> + implements RelativeIndexable +{ public readonly [Symbol.toStringTag] = 'List'; public constructor(values?: readonly T[] | Iterable | null) { @@ -101,6 +107,7 @@ export class List extends EventEmitter<'update'> implements RelativeIndexable public add(value: T): this { this.data.add(value); this.emit('update'); + this.emit('add', value); return this; }