@julseb-lib/react 1.0.66 → 1.0.68

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/index.d.cts CHANGED
@@ -154,7 +154,6 @@ declare function enableScroll(): void;
154
154
  */
155
155
  declare function scrollToTop(): void;
156
156
 
157
- type Event = MouseEvent | TouchEvent;
158
157
  /**
159
158
  * Hook to trigger a function when clicking outside a referenced element.
160
159
  *
@@ -170,13 +169,14 @@ type Event = MouseEvent | TouchEvent;
170
169
  * @template T - HTML element type that extends HTMLElement
171
170
  * @param {RefObject<T>} ref - React ref object pointing to the target element
172
171
  * @param {function} handler - Callback function to execute when clicking outside the element
173
- * @param {Event} handler.event - The mouse or touch event that triggered the outside click
172
+ * @param {boolean} isActive - Whether the click outside detection is active (default: true)
173
+ * @param {number} delay - Delay in milliseconds before activating the listener (default: 100ms)
174
174
  *
175
175
  * @returns {void} This hook doesn't return anything
176
176
  *
177
177
  * @see https://doc-julseb-lib-react.vercel.app/helpers/hooks#useClickOutside
178
178
  */
179
- declare const useClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: (event: Event) => void) => void;
179
+ declare const useClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: () => void, isActive?: boolean, delay?: number) => void;
180
180
 
181
181
  type CopiedValue = string | null;
182
182
  type CopyFn = (text: string) => Promise<boolean>;
package/dist/index.d.ts CHANGED
@@ -154,7 +154,6 @@ declare function enableScroll(): void;
154
154
  */
155
155
  declare function scrollToTop(): void;
156
156
 
157
- type Event = MouseEvent | TouchEvent;
158
157
  /**
159
158
  * Hook to trigger a function when clicking outside a referenced element.
160
159
  *
@@ -170,13 +169,14 @@ type Event = MouseEvent | TouchEvent;
170
169
  * @template T - HTML element type that extends HTMLElement
171
170
  * @param {RefObject<T>} ref - React ref object pointing to the target element
172
171
  * @param {function} handler - Callback function to execute when clicking outside the element
173
- * @param {Event} handler.event - The mouse or touch event that triggered the outside click
172
+ * @param {boolean} isActive - Whether the click outside detection is active (default: true)
173
+ * @param {number} delay - Delay in milliseconds before activating the listener (default: 100ms)
174
174
  *
175
175
  * @returns {void} This hook doesn't return anything
176
176
  *
177
177
  * @see https://doc-julseb-lib-react.vercel.app/helpers/hooks#useClickOutside
178
178
  */
179
- declare const useClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: (event: Event) => void) => void;
179
+ declare const useClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: () => void, isActive?: boolean, delay?: number) => void;
180
180
 
181
181
  type CopiedValue = string | null;
182
182
  type CopyFn = (text: string) => Promise<boolean>;