@ardium-pl/devkit 8.3.3 → 8.4.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.
@@ -46,9 +46,24 @@ export interface WritableMapSignal<K, V> extends WritableSignal<Map<K, V>>, MapS
46
46
  setKey(key: K, value: V): void;
47
47
  /**
48
48
  * Deletes a key from the map.
49
- * Returns true if a value was removed.
49
+ * @returns true if a value was removed.
50
50
  */
51
51
  delete(key: K): boolean;
52
+ /**
53
+ * Merges another map into the current map.
54
+ */
55
+ merge(value: Iterable<[K, V]>): void;
56
+ /**
57
+ * Toggles a value for a key. If the key exists, it will be deleted; if it doesn't exist, it will be added with the provided value.
58
+ * @returns true if the key was added, false if it was deleted.
59
+ */
60
+ toggleKey(key: K, value: V): boolean;
61
+ /**
62
+ * Toggles a value for a key. If the key exists, it will be deleted; if it doesn't exist, it will be added with the provided value.
63
+ * Alias of the method `toggleKey()`.
64
+ * @returns true if the key was added, false if it was deleted.
65
+ */
66
+ toggle(key: K, value: V): boolean;
52
67
  /**
53
68
  * Clears the map.
54
69
  */
@@ -56,11 +71,16 @@ export interface WritableMapSignal<K, V> extends WritableSignal<Map<K, V>>, MapS
56
71
  /**
57
72
  * Replaces the map with a new map.
58
73
  */
59
- setMap(value: Map<K, V>): void;
74
+ setMap(value: Iterable<[K, V]>): void;
60
75
  /**
61
76
  * Replaces the map with a new map. Alias of the method `setMap()`.
77
+ * @deprecated Use `setMap()` instead for clarity.
78
+ */
79
+ set(value: Iterable<[K, V]>): void;
80
+ /**
81
+ * Sets a value for the key. Alias of the method `setKey()`.
62
82
  */
63
- set(value: Map<K, V>): void;
83
+ set(key: K, value: V): void;
64
84
  /**
65
85
  * Updates the map using an update function.
66
86
  */
@@ -1,6 +1,12 @@
1
1
  import { Signal, WritableSignal } from '@angular/core';
2
2
  export interface QueryParamSignalNonNullable<T> extends Signal<T> {
3
+ /**
4
+ * The name of the query parameter used to store the signal value.
5
+ */
3
6
  readonly paramName: string;
7
+ /**
8
+ * Computed signal that returns the serialized value of the signal.
9
+ */
4
10
  readonly serialized: Signal<string | null>;
5
11
  }
6
12
  export interface QueryParamSignal<T> extends QueryParamSignalNonNullable<T | null> {
@@ -34,9 +34,14 @@ export interface WritableSetSignal<T> extends WritableSignal<Set<T>>, SetSignal<
34
34
  add(value: T): void;
35
35
  /**
36
36
  * Deletes a value from the set.
37
- * Returns true if a value was removed.
37
+ * @returns true if a value was removed.
38
38
  */
39
39
  delete(value: T): boolean;
40
+ /**
41
+ * Toggles a value in the set. If the value exists, it will be removed; if it does not exist, it will be added.
42
+ * @returns true if the value was added, false if it was removed.
43
+ */
44
+ toggle(value: T): boolean;
40
45
  /**
41
46
  * Clears the set.
42
47
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ardium-pl/devkit",
3
- "version": "8.3.3",
3
+ "version": "8.4.0",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": ">=19.0.0",