utilium 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/list.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
- export declare class List<T> extends EventEmitter<'update'> implements RelativeIndexable<T> {
2
+ export declare class List<T> extends EventEmitter<{
3
+ update: [];
4
+ add: [T];
5
+ }> implements RelativeIndexable<T> {
3
6
  readonly [Symbol.toStringTag] = "List";
4
7
  constructor(values?: readonly T[] | Iterable<T> | null);
5
8
  protected data: Set<T>;
package/dist/list.js CHANGED
@@ -78,6 +78,7 @@ export class List extends EventEmitter {
78
78
  add(value) {
79
79
  this.data.add(value);
80
80
  this.emit('update');
81
+ this.emit('add', value);
81
82
  return this;
82
83
  }
83
84
  clear() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Typescript utilities",
5
5
  "funding": {
6
6
  "type": "individual",
package/src/list.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
2
 
3
- export class List<T> extends EventEmitter<'update'> implements RelativeIndexable<T> {
3
+ export class List<T>
4
+ extends EventEmitter<{
5
+ update: [];
6
+ add: [T];
7
+ }>
8
+ implements RelativeIndexable<T>
9
+ {
4
10
  public readonly [Symbol.toStringTag] = 'List';
5
11
 
6
12
  public constructor(values?: readonly T[] | Iterable<T> | null) {
@@ -101,6 +107,7 @@ export class List<T> extends EventEmitter<'update'> implements RelativeIndexable
101
107
  public add(value: T): this {
102
108
  this.data.add(value);
103
109
  this.emit('update');
110
+ this.emit('add', value);
104
111
  return this;
105
112
  }
106
113