@tarsis/toolkit 0.6.3 → 0.6.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.
@@ -1,4 +1,4 @@
1
- import { c as commonjsGlobal, a as getAugmentedNamespace, g as getDefaultExportFromCjs, W as WebGLRenderer, P as PerspectiveCamera, S as Scene, T as THREE$1, C as Clock, b as TextureLoader, R as RawShaderMaterial, D as DoubleSide, d as WebGLRenderTarget, e as Color, M as Mesh, f as TorusKnotGeometry, h as ShaderMaterial } from './index-Benrsg6B.js';
1
+ import { c as commonjsGlobal, a as getAugmentedNamespace, g as getDefaultExportFromCjs, W as WebGLRenderer, P as PerspectiveCamera, S as Scene, T as THREE$1, C as Clock, b as TextureLoader, R as RawShaderMaterial, D as DoubleSide, d as WebGLRenderTarget, e as Color, M as Mesh, f as TorusKnotGeometry, h as ShaderMaterial } from './index-ss50SEnC.js';
2
2
 
3
3
  /*
4
4
  object-assign
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const index = require('./index-Cz-laGWF.cjs');
5
+ const index = require('./index-BcIzOPR7.cjs');
6
6
 
7
7
  /*
8
8
  object-assign
package/dist/hooks.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const useWindowReady = require('./useWindowReady-Il0Ibn7I.cjs');
5
+ const useWindowReady = require('./useWindowReady-6kIdYolB.cjs');
6
6
 
7
7
 
8
8
 
package/dist/hooks.d.ts CHANGED
@@ -25,7 +25,10 @@ declare interface UseBowserResult {
25
25
  *
26
26
  * @param callback - The function to debounce
27
27
  * @param delay - The delay time (in milliseconds) to wait before executing the callback
28
- * @returns A debounced version of the callback function
28
+ * @param options - Optional configuration object
29
+ * @param options.maxWait - Maximum time before function must be invoked
30
+ * @param options.leading - If true, invoke on the leading edge
31
+ * @returns A debounced version of the callback function with a `cancel` method
29
32
  *
30
33
  * @example
31
34
  * ```tsx
@@ -35,8 +38,34 @@ declare interface UseBowserResult {
35
38
  *
36
39
  * return <input onChange={(e) => debouncedSearch(e.target.value)} />
37
40
  * ```
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * // With maxWait and leading options
45
+ * const debouncedSearch = useDebounce(
46
+ * (query: string) => console.log('Searching for:', query),
47
+ * 300,
48
+ * { maxWait: 1000, leading: true }
49
+ * )
50
+ * ```
51
+ *
52
+ * @example
53
+ * ```tsx
54
+ * // Cancel pending debounced call
55
+ * const debouncedSearch = useDebounce((query: string) => {
56
+ * console.log('Searching for:', query)
57
+ * }, 300)
58
+ *
59
+ * debouncedSearch('test')
60
+ * debouncedSearch.cancel() // Cancels the pending call
61
+ * ```
38
62
  */
39
- export declare const useDebounce: <T extends (...args: any[]) => any>(callback: T, delay: number) => T;
63
+ export declare const useDebounce: <T extends (...args: any[]) => any>(callback: T, delay: number, { maxWait, leading }?: {
64
+ maxWait?: number;
65
+ leading?: boolean;
66
+ }) => T & {
67
+ cancel: VoidFunction;
68
+ };
40
69
 
41
70
  /**
42
71
  * A React hook that implements the useEffectEvent pattern from React RFC.
package/dist/hooks.js CHANGED
@@ -1 +1 @@
1
- export { u as useAnimatedText, a as useBowser, b as useDebounce, d as useEffectEvent, e as useInterval, f as useLiveRef, g as useMatchMedia, h as useOklch, i as useOutsideClick, k as usePreviousRender, j as usePreviousState, l as useRaf, m as useThrottle, n as useTimeout, c as useUniversalLayoutEffect, o as useWindowReady } from './useWindowReady-DVV-s65K.js';
1
+ export { u as useAnimatedText, a as useBowser, b as useDebounce, d as useEffectEvent, e as useInterval, f as useLiveRef, g as useMatchMedia, h as useOklch, i as useOutsideClick, k as usePreviousRender, j as usePreviousState, l as useRaf, m as useThrottle, n as useTimeout, c as useUniversalLayoutEffect, o as useWindowReady } from './useWindowReady-tUs-ONyG.js';