@typedly/collection 1.1.0 → 2.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typedly/collection",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "author": "wwwdev.io <dev@wwwdev.io>",
5
5
  "description": "A TypeScript type definitions package for data collections with customizable storage.",
6
6
  "license": "MIT",
@@ -11,17 +11,17 @@ import { ConstrainedConstructor } from '@typedly/constructor';
11
11
  */
12
12
  interface CollectionShape<T, V = any> extends DataShape<V> {
13
13
  /**
14
- * @description Adds an item to the collection.
15
- * @param {T} element Element of type `T` to add.
14
+ * @description Adds elements to the collection.
15
+ * @param {...T[]} element Element of type `T` to add.
16
16
  * @returns {this} The collection instance.
17
17
  */
18
- add(element: T): this;
18
+ add(...element: T[]): this;
19
19
  /**
20
- * @description Deletes an item from the collection.
21
- * @param {T} element Element of type `T` to delete.
20
+ * @description Deletes elements from the collection.
21
+ * @param {...T[]} element Element of type `T` to delete.
22
22
  * @returns {boolean} `true` if the element was successfully deleted, otherwise `false`.
23
23
  */
24
- delete(element: T): boolean;
24
+ delete(...element: T[]): boolean;
25
25
  /**
26
26
  * @description Executes a provided function once for each collection element.
27
27
  * @param {(value: T, value2: T, collection: CollectionShape<T, V>) => void} callbackfn Function to execute for each element.
@@ -29,11 +29,11 @@ interface CollectionShape<T, V = any> extends DataShape<V> {
29
29
  */
30
30
  forEach(callbackfn: (element: T, element2: T, collection: CollectionShape<T, V>) => void, thisArg?: any): void;
31
31
  /**
32
- * @description Checks if an item exists in the collection.
33
- * @param {T} element Element of type `T` to check for existence.
32
+ * @description Checks if every item exists in the collection.
33
+ * @param {...T[]} element Element of type `T` to check for existence.
34
34
  * @returns {boolean} `true` if the element exists, otherwise `false`.
35
35
  */
36
- has(element: T): boolean;
36
+ has(...element: T[]): boolean;
37
37
  /**
38
38
  * @description The number of items in the collection.
39
39
  * @returns {number}
@@ -48,7 +48,7 @@ interface CollectionShape<T, V = any> extends DataShape<V> {
48
48
  * @description Returns an iterator for the collection.
49
49
  * @returns {Iterator<T>}
50
50
  */
51
- get [Symbol.iterator](): Iterator<T>;
51
+ [Symbol.iterator](): Iterator<T>;
52
52
  }
53
53
 
54
54
  /**