@pushwoosh/kit-helpers 4.8.4 → 4.8.5

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.
@@ -7,7 +7,7 @@ type ClickAwayCallback = (event: MouseEvent | TouchEvent) => void;
7
7
  * @param listener The callback function to execute when the event occurs.
8
8
  * @returns A function to remove the added event listeners.
9
9
  */
10
- export declare function elementAddListeners<K extends keyof HTMLElementEventMap, E extends HTMLElement>(element: E | Document, // Allow Document as well
10
+ export declare function elementAddListener<K extends keyof HTMLElementEventMap, E extends HTMLElement>(element: E | Document, // Allow Document as well
11
11
  eventNames: K | K[], listener: (this: E | Document, ev: HTMLElementEventMap[K]) => void): () => void;
12
12
  /**
13
13
  * Subscribes to mousedown/touchstart events outside a given element.
@@ -7,7 +7,7 @@ import usePersistentFunction from './usePersistentFunction';
7
7
  * @param listener The callback function to execute when the event occurs.
8
8
  * @returns A function to remove the added event listeners.
9
9
  */
10
- export function elementAddListeners(element,
10
+ export function elementAddListener(element,
11
11
  // Allow Document as well
12
12
  eventNames, listener) {
13
13
  const eventNamesArray = Array.isArray(eventNames) ? eventNames : [eventNames];
@@ -28,7 +28,7 @@ eventNames, listener) {
28
28
  */
29
29
  export function subscribeClickAway(element, callback) {
30
30
  // Use document directly, no need for 'any' cast
31
- return elementAddListeners(document, ['mousedown', 'touchstart'], event => {
31
+ return elementAddListener(document, ['mousedown', 'touchstart'], event => {
32
32
  // Type assertion for event target
33
33
  const target = event.target;
34
34
  // Check if the element exists and the click target is outside the element
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/kit-helpers",
3
- "version": "4.8.4",
3
+ "version": "4.8.5",
4
4
  "description": "React component for build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",