@rzl-zone/utils-js 3.1.0-beta.2 → 3.1.1-beta.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.
Files changed (134) hide show
  1. package/dist/NumberRangeUnion-DC-C3_Kq.d.ts +23 -23
  2. package/dist/any-BmdI8UbK.d.ts +56 -56
  3. package/dist/arrays-normalize-recursive-CnjYJ9xg.d.ts +66 -66
  4. package/dist/assertions/index.cjs +1 -1
  5. package/dist/assertions/index.d.ts +396 -396
  6. package/dist/assertions/index.js +1 -1
  7. package/dist/chunk-26W3VZIK.cjs +1 -0
  8. package/dist/chunk-2KRCHXFG.cjs +2 -0
  9. package/dist/{chunk-TQMZ2LPI.js → chunk-33ZLH266.js} +1 -1
  10. package/dist/{chunk-VQLAPEL3.js → chunk-4L4EJTNZ.js} +1 -1
  11. package/dist/{chunk-CK3BZGEU.js → chunk-5Q37AP7P.js} +1 -1
  12. package/dist/chunk-7CHFAMS2.js +1 -0
  13. package/dist/{chunk-REFMEB4A.js → chunk-7MMJZ6HS.js} +1 -1
  14. package/dist/chunk-7TC6DE3J.cjs +1 -0
  15. package/dist/{chunk-K4PLGD7C.js → chunk-7VX33E3V.js} +1 -1
  16. package/dist/chunk-BEZPD44N.cjs +1 -0
  17. package/dist/{chunk-2AUUPGMN.js → chunk-BI263OHW.js} +1 -1
  18. package/dist/{chunk-LVUSFXQS.cjs → chunk-CII6WWLO.cjs} +1 -1
  19. package/dist/{chunk-OX6RLS2F.cjs → chunk-D5TYPCWU.cjs} +1 -1
  20. package/dist/{chunk-MWLEM7ED.js → chunk-EEQY5QUG.js} +1 -1
  21. package/dist/chunk-ESJYBIYH.js +1 -0
  22. package/dist/{chunk-MJAW5RAK.js → chunk-EWYPSKKM.js} +1 -1
  23. package/dist/chunk-EXCOQLWX.cjs +1 -0
  24. package/dist/chunk-FWQVTMYA.cjs +1 -0
  25. package/dist/{chunk-25G6B35W.js → chunk-G4EWCRKS.js} +1 -1
  26. package/dist/{chunk-PFLNHD4B.cjs → chunk-G7R5XZRM.cjs} +1 -1
  27. package/dist/{chunk-EXXLUO7L.cjs → chunk-GGEV7LXX.cjs} +1 -1
  28. package/dist/{chunk-VTR75UID.cjs → chunk-HJOZOENU.cjs} +1 -1
  29. package/dist/{chunk-HXTACM3O.cjs → chunk-IRDZVLNZ.cjs} +1 -1
  30. package/dist/chunk-IW73G523.cjs +1 -0
  31. package/dist/chunk-IY5OZAB3.cjs +1 -0
  32. package/dist/{chunk-467VEMJH.js → chunk-J4NCYYGS.js} +1 -1
  33. package/dist/{chunk-RHIBYOFQ.js → chunk-J7JAZAJD.js} +1 -1
  34. package/dist/{chunk-JQZUWBIX.js → chunk-JYNSO7ZY.js} +1 -1
  35. package/dist/{chunk-UUMKL74S.js → chunk-K3UVKYEU.js} +1 -1
  36. package/dist/{chunk-ME5OV5HN.js → chunk-LQ76EDZG.js} +1 -1
  37. package/dist/chunk-MROH35V3.cjs +1 -0
  38. package/dist/chunk-NJSAV73S.js +1 -0
  39. package/dist/{chunk-HXST7RJB.js → chunk-NR44SNYE.js} +1 -1
  40. package/dist/{chunk-BLCANGFS.js → chunk-NXMTWY77.js} +1 -1
  41. package/dist/chunk-OZCQZO2V.cjs +4 -0
  42. package/dist/chunk-Q3NTKN5I.cjs +1 -0
  43. package/dist/{chunk-NSVLG7NY.js → chunk-QDNSC57Z.js} +1 -1
  44. package/dist/{chunk-NUVGETPD.js → chunk-QGXTL5ZH.js} +1 -1
  45. package/dist/{chunk-D43GV6EF.cjs → chunk-QSQDP7L2.cjs} +1 -1
  46. package/dist/{chunk-U4TZO7WV.js → chunk-S5M33A4O.js} +1 -1
  47. package/dist/{chunk-S7GMG4TB.js → chunk-SGTHOQQ2.js} +1 -1
  48. package/dist/chunk-SL3RQOWA.js +1 -0
  49. package/dist/{chunk-NUHOOAUN.cjs → chunk-SZPWZZYG.cjs} +1 -1
  50. package/dist/{chunk-RHE3M2NJ.cjs → chunk-UA4B7JBO.cjs} +1 -1
  51. package/dist/chunk-UQDJF5RR.cjs +1 -0
  52. package/dist/chunk-UTQUYABU.cjs +1 -0
  53. package/dist/{chunk-G72VSVGO.js → chunk-VPW3DRV5.js} +1 -1
  54. package/dist/{chunk-PSWITZK5.js → chunk-W32WALNU.js} +1 -1
  55. package/dist/chunk-XGZ6K753.cjs +1 -0
  56. package/dist/chunk-YFTR64N5.cjs +1 -0
  57. package/dist/chunk-ZFDS7W6B.cjs +1 -0
  58. package/dist/chunk-ZQOLZE6Z.cjs +1 -0
  59. package/dist/conversions/index.cjs +1 -1
  60. package/dist/conversions/index.d.ts +1285 -1285
  61. package/dist/conversions/index.js +1 -1
  62. package/dist/env/index.d.ts +14 -14
  63. package/dist/events/index.cjs +1 -1
  64. package/dist/events/index.d.ts +109 -109
  65. package/dist/events/index.js +1 -1
  66. package/dist/extends-Bk_SBGdT.d.ts +330 -330
  67. package/dist/formatting/index.cjs +1 -1
  68. package/dist/formatting/index.d.ts +855 -855
  69. package/dist/formatting/index.js +1 -1
  70. package/dist/generator/index.cjs +1 -1
  71. package/dist/generator/index.d.ts +155 -155
  72. package/dist/generator/index.js +1 -1
  73. package/dist/if-CvT4R7Kh.d.ts +16 -16
  74. package/dist/index.cjs +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/is-array--YjXV-Wx.d.ts +1084 -1084
  77. package/dist/isPlainObject-BVhBAPHX.d.ts +154 -154
  78. package/dist/never-BfayMBF9.d.ts +64 -64
  79. package/dist/next/index.cjs +5 -5
  80. package/dist/next/index.d.ts +183 -183
  81. package/dist/next/index.js +1 -1
  82. package/dist/next/server/index.cjs +1 -1
  83. package/dist/next/server/index.d.ts +25 -25
  84. package/dist/next/server/index.js +1 -1
  85. package/dist/nils-DMz3kU7M.d.ts +155 -155
  86. package/dist/omit-VvmIsZmX.d.ts +25 -25
  87. package/dist/operations/index.cjs +1 -1
  88. package/dist/operations/index.d.ts +120 -120
  89. package/dist/operations/index.js +1 -1
  90. package/dist/parsers/index.cjs +1 -1
  91. package/dist/parsers/index.d.ts +34 -34
  92. package/dist/parsers/index.js +1 -1
  93. package/dist/predicates/index.cjs +1 -1
  94. package/dist/predicates/index.d.ts +1674 -1674
  95. package/dist/predicates/index.js +1 -1
  96. package/dist/prettify-C4xLcYOP.d.ts +328 -328
  97. package/dist/promise/index.cjs +1 -1
  98. package/dist/promise/index.d.ts +29 -29
  99. package/dist/promise/index.js +1 -1
  100. package/dist/rzl-utils.global.js +1 -1
  101. package/dist/string-XA-til3C.d.ts +318 -318
  102. package/dist/strings/index.cjs +1 -1
  103. package/dist/strings/index.d.ts +690 -690
  104. package/dist/strings/index.js +1 -1
  105. package/dist/stylings/index.cjs +1 -1
  106. package/dist/stylings/index.d.ts +35 -35
  107. package/dist/stylings/index.js +1 -1
  108. package/dist/type-data-DDs-u2kq.d.ts +241 -241
  109. package/dist/types/index.d.ts +3264 -3264
  110. package/dist/urls/index.cjs +1 -1
  111. package/dist/urls/index.d.ts +373 -373
  112. package/dist/urls/index.js +1 -1
  113. package/package.json +1 -1
  114. package/dist/chunk-2JQQQ625.js +0 -1
  115. package/dist/chunk-445TAVT4.cjs +0 -1
  116. package/dist/chunk-6Q4I2RPC.cjs +0 -1
  117. package/dist/chunk-6SMJMZ7G.cjs +0 -1
  118. package/dist/chunk-DFSTVQFI.cjs +0 -1
  119. package/dist/chunk-DYRDBYPF.cjs +0 -1
  120. package/dist/chunk-GAJTFCUA.js +0 -1
  121. package/dist/chunk-GOJNH55O.cjs +0 -1
  122. package/dist/chunk-IJTZWWRJ.cjs +0 -1
  123. package/dist/chunk-ISJ33O2J.cjs +0 -1
  124. package/dist/chunk-JISH2VGG.js +0 -1
  125. package/dist/chunk-KZQB7H4E.cjs +0 -1
  126. package/dist/chunk-LUVV5KSD.cjs +0 -2
  127. package/dist/chunk-MF5Y5K4N.cjs +0 -1
  128. package/dist/chunk-O5VXBNUQ.cjs +0 -4
  129. package/dist/chunk-O7SJR4CY.cjs +0 -1
  130. package/dist/chunk-PYUVKHUF.cjs +0 -1
  131. package/dist/chunk-XFCJDSB2.cjs +0 -1
  132. package/dist/chunk-XOYX4PLZ.cjs +0 -1
  133. package/dist/chunk-Z6FLCEN6.js +0 -1
  134. package/dist/chunk-ZO5364A6.cjs +0 -1
@@ -1 +1 @@
1
- export{f as convertType,g as removeObjectPaths,b as toBooleanContent,c as toBooleanContentDeep,d as toBooleanExplicit,e as toBooleanLoose,a as toNumberArrayUnRecursive,h as toNumberDeep,i as toStringDeep}from'../chunk-G72VSVGO.js';export{b as cleanParsedData,a as extractDigits,c as parseCustomDate,d as safeJsonParse}from'../chunk-MWLEM7ED.js';import'../chunk-RHIBYOFQ.js';export{c as dedupeArray,b as filterNilArray,d as toStringArrayUnRecursive,a as toStringDeepForce}from'../chunk-PSWITZK5.js';import'../chunk-REFMEB4A.js';import'../chunk-ME5OV5HN.js';import'../chunk-2JQQQ625.js';export{a as parseCurrencyString}from'../chunk-K4PLGD7C.js';import'../chunk-GAJTFCUA.js';import'../chunk-SYJC7UAW.js';import'../chunk-Z6FLCEN6.js';import'../chunk-JISH2VGG.js';export{c as safeStableStringify}from'../chunk-467VEMJH.js';import'../chunk-5SZUSNGZ.js';import'../chunk-MJAW5RAK.js';
1
+ export{f as convertType,g as removeObjectPaths,b as toBooleanContent,c as toBooleanContentDeep,d as toBooleanExplicit,e as toBooleanLoose,a as toNumberArrayUnRecursive,h as toNumberDeep,i as toStringDeep}from'../chunk-VPW3DRV5.js';export{b as cleanParsedData,a as extractDigits,c as parseCustomDate,d as safeJsonParse}from'../chunk-EEQY5QUG.js';import'../chunk-J7JAZAJD.js';export{c as dedupeArray,b as filterNilArray,d as toStringArrayUnRecursive,a as toStringDeepForce}from'../chunk-W32WALNU.js';import'../chunk-7MMJZ6HS.js';import'../chunk-LQ76EDZG.js';import'../chunk-SL3RQOWA.js';export{a as parseCurrencyString}from'../chunk-7VX33E3V.js';import'../chunk-ESJYBIYH.js';import'../chunk-SYJC7UAW.js';import'../chunk-7CHFAMS2.js';import'../chunk-NJSAV73S.js';export{c as safeStableStringify}from'../chunk-J4NCYYGS.js';import'../chunk-5SZUSNGZ.js';import'../chunk-EWYPSKKM.js';
@@ -1,16 +1,16 @@
1
1
  /** ----------------------------------------
2
- * * ***Utility: `isServer`.***
3
- * ----------------------------------------
4
- * **Checks if the current execution environment is at **server-side** (Node.js)
5
- * or **client-side** (browser).**
6
- * @returns {boolean}
7
- * - `true` ➔ running on the **server-side** (Node.js).
8
- * - `false` ➔ running on the **client-side** (browser).
9
- * @example
10
- * if (isServer()) {
11
- * console.log("Running on Node.js");
12
- * } else {
13
- * console.log("Running in the browser");
14
- * }
15
- */
2
+ * * ***Utility: `isServer`.***
3
+ * ----------------------------------------
4
+ * **Checks if the current execution environment is at **server-side** (Node.js)
5
+ * or **client-side** (browser).**
6
+ * @returns {boolean}
7
+ * - `true` ➔ running on the **server-side** (Node.js).
8
+ * - `false` ➔ running on the **client-side** (browser).
9
+ * @example
10
+ * if (isServer()) {
11
+ * console.log("Running on Node.js");
12
+ * } else {
13
+ * console.log("Running in the browser");
14
+ * }
15
+ */
16
16
  declare const isServer:()=>boolean;export{isServer};
@@ -1 +1 @@
1
- 'use strict';var chunkEXXLUO7L_cjs=require('../chunk-EXXLUO7L.cjs');require('../chunk-SW6HYEW7.cjs'),require('../chunk-DYRDBYPF.cjs'),require('../chunk-LVUSFXQS.cjs');Object.defineProperty(exports,"disableUserInteraction",{enumerable:true,get:function(){return chunkEXXLUO7L_cjs.a}});Object.defineProperty(exports,"enableUserInteraction",{enumerable:true,get:function(){return chunkEXXLUO7L_cjs.b}});Object.defineProperty(exports,"removeElementFocus",{enumerable:true,get:function(){return chunkEXXLUO7L_cjs.c}});Object.defineProperty(exports,"scrollToTop",{enumerable:true,get:function(){return chunkEXXLUO7L_cjs.d}});
1
+ 'use strict';var chunkGGEV7LXX_cjs=require('../chunk-GGEV7LXX.cjs');require('../chunk-SW6HYEW7.cjs'),require('../chunk-BEZPD44N.cjs'),require('../chunk-CII6WWLO.cjs');Object.defineProperty(exports,"disableUserInteraction",{enumerable:true,get:function(){return chunkGGEV7LXX_cjs.a}});Object.defineProperty(exports,"enableUserInteraction",{enumerable:true,get:function(){return chunkGGEV7LXX_cjs.b}});Object.defineProperty(exports,"removeElementFocus",{enumerable:true,get:function(){return chunkGGEV7LXX_cjs.c}});Object.defineProperty(exports,"scrollToTop",{enumerable:true,get:function(){return chunkGGEV7LXX_cjs.d}});
@@ -1,122 +1,122 @@
1
1
  type ScrollToTopOptions={
2
2
  /** Scroll animation type.
3
- *
4
- * - Valid values: `"auto"`, `"instant"`, `"smooth"`.
5
- * - Default force to `"smooth"` if missing or invalid.
6
- *
7
- * @default "smooth"
8
- */
3
+ *
4
+ * - Valid values: `"auto"`, `"instant"`, `"smooth"`.
5
+ * - Default force to `"smooth"` if missing or invalid.
6
+ *
7
+ * @default "smooth"
8
+ */
9
9
  behavior?:ScrollBehavior|undefined;
10
10
  /** Delay before scrolling (in milliseconds).
11
- *
12
- * - Default value is `1`.
13
- * - Valid values: any number `≥` `1`.
14
- * - Non-integer number are truncated to an integer.
15
- * - Force to `2147483647` if number is larger than `2147483647`.
16
- * - Default force to `1` if `missing`, `NaN`, `invalid-type`, or `less-than` `1`.
17
- *
18
- * @default 1
19
- */
11
+ *
12
+ * - Default value is `1`.
13
+ * - Valid values: any number `≥` `1`.
14
+ * - Non-integer number are truncated to an integer.
15
+ * - Force to `2147483647` if number is larger than `2147483647`.
16
+ * - Default force to `1` if `missing`, `NaN`, `invalid-type`, or `less-than` `1`.
17
+ *
18
+ * @default 1
19
+ */
20
20
  timeout?:number|undefined;};
21
21
  /** ----------------------------------------------------------
22
- * * ***Utility: `disableUserInteraction`.***
23
- * ----------------------------------------------------------
24
- * **Disables user interaction by adding a CSS class to the `<html>` element.**
25
- * - **Key points**:
26
- * - Works **only in browser environments**.
27
- * - Safely adds the specified CSS class to `<html>`.
28
- * - Prevents multiple additions of the same class.
29
- * - Useful to indicate that a process is ongoing
30
- * (e.g., loading or processing state).
31
- * - **Using custom CSS classes:**
32
- * - You can pass any class name that exists in your CSS.
33
- * - Example: if you have `.loading` in your styles, passing `"loading"`
34
- * will add it and disable interactions accordingly.
35
- * - **Validation:**
36
- * - Throws `TypeError` if the `className` parameter is not a string.
37
- * @param {string} [className="on_processing"] - The CSS class to add, defaults to `"on_processing"`.
38
- * @returns {void} Does not return anything.
39
- * @throws {TypeError} If `className` is not a string.
40
- * @example
41
- * disableUserInteraction(); // ➔ Adds "on_processing" class
42
- * disableUserInteraction("loading"); // ➔ Adds "loading" class
43
- * // ❌ Invalid value:
44
- * disableUserInteraction(123); // ➔ Throws TypeError
45
- */
22
+ * * ***Utility: `disableUserInteraction`.***
23
+ * ----------------------------------------------------------
24
+ * **Disables user interaction by adding a CSS class to the `<html>` element.**
25
+ * - **Key points**:
26
+ * - Works **only in browser environments**.
27
+ * - Safely adds the specified CSS class to `<html>`.
28
+ * - Prevents multiple additions of the same class.
29
+ * - Useful to indicate that a process is ongoing
30
+ * (e.g., loading or processing state).
31
+ * - **Using custom CSS classes:**
32
+ * - You can pass any class name that exists in your CSS.
33
+ * - Example: if you have `.loading` in your styles, passing `"loading"`
34
+ * will add it and disable interactions accordingly.
35
+ * - **Validation:**
36
+ * - Throws `TypeError` if the `className` parameter is not a string.
37
+ * @param {string} [className="on_processing"] - The CSS class to add, defaults to `"on_processing"`.
38
+ * @returns {void} Does not return anything.
39
+ * @throws {TypeError} If `className` is not a string.
40
+ * @example
41
+ * disableUserInteraction(); // ➔ Adds "on_processing" class
42
+ * disableUserInteraction("loading"); // ➔ Adds "loading" class
43
+ * // ❌ Invalid value:
44
+ * disableUserInteraction(123); // ➔ Throws TypeError
45
+ */
46
46
  declare const disableUserInteraction:(className?:string)=>void;
47
47
  /** ----------------------------------------------------------
48
- * * ***Utility: `enableUserInteraction`.***
49
- * ----------------------------------------------------------
50
- * **Enables user interaction by removing a CSS class from the `<html>` element.**
51
- * - **Key points**:
52
- * - Works **only in browser environments**.
53
- * - Safely removes the specified CSS class from `<html>`.
54
- * - Does nothing if the class is not present.
55
- * - Useful to re-enable user interactions after a process
56
- * (e.g., loading or processing) completes.
57
- * - **Using custom CSS classes:**
58
- * - You can pass any class name that exists in your CSS.
59
- * - Example: if you have `.loading` in your styles, passing `"loading"`
60
- * will remove it and re-enable interactions.
61
- * - **Validation:**
62
- * - Throws `TypeError` if the `className` parameter is not a string.
63
- * @param {string} [className="on_processing"] - The CSS class to remove, defaults to `"on_processing"`.
64
- * @returns {void} Does not return anything.
65
- * @throws {TypeError} If `className` is not a string.
66
- * @example
67
- * enableUserInteraction(); // ➔ Removes "on_processing" class
68
- * enableUserInteraction("loading"); // ➔ Removes "loading" class
69
- * // ❌ Invalid value:
70
- * enableUserInteraction(123); // ➔ Throws TypeError
71
- */
48
+ * * ***Utility: `enableUserInteraction`.***
49
+ * ----------------------------------------------------------
50
+ * **Enables user interaction by removing a CSS class from the `<html>` element.**
51
+ * - **Key points**:
52
+ * - Works **only in browser environments**.
53
+ * - Safely removes the specified CSS class from `<html>`.
54
+ * - Does nothing if the class is not present.
55
+ * - Useful to re-enable user interactions after a process
56
+ * (e.g., loading or processing) completes.
57
+ * - **Using custom CSS classes:**
58
+ * - You can pass any class name that exists in your CSS.
59
+ * - Example: if you have `.loading` in your styles, passing `"loading"`
60
+ * will remove it and re-enable interactions.
61
+ * - **Validation:**
62
+ * - Throws `TypeError` if the `className` parameter is not a string.
63
+ * @param {string} [className="on_processing"] - The CSS class to remove, defaults to `"on_processing"`.
64
+ * @returns {void} Does not return anything.
65
+ * @throws {TypeError} If `className` is not a string.
66
+ * @example
67
+ * enableUserInteraction(); // ➔ Removes "on_processing" class
68
+ * enableUserInteraction("loading"); // ➔ Removes "loading" class
69
+ * // ❌ Invalid value:
70
+ * enableUserInteraction(123); // ➔ Throws TypeError
71
+ */
72
72
  declare const enableUserInteraction:(className?:string)=>void;
73
73
  /** ----------------------------------------------------------
74
- * * ***Utility: `removeElementFocus`.***
75
- * ----------------------------------------------------------
76
- * **Removes focus from the currently active element in the document.**
77
- * - **Features**:
78
- * - This function works **only in browser environments**.
79
- * - If an element is focused, it will lose focus by calling `blur()`.
80
- * - If no element is focused or the active element is not an `HTMLElement`, nothing happens.
81
- * @returns {void} Does not return anything.
82
- * @example
83
- * removeElementFocus(); // ➔ Removes focus from the currently active element
84
- */
74
+ * * ***Utility: `removeElementFocus`.***
75
+ * ----------------------------------------------------------
76
+ * **Removes focus from the currently active element in the document.**
77
+ * - **Features**:
78
+ * - This function works **only in browser environments**.
79
+ * - If an element is focused, it will lose focus by calling `blur()`.
80
+ * - If no element is focused or the active element is not an `HTMLElement`, nothing happens.
81
+ * @returns {void} Does not return anything.
82
+ * @example
83
+ * removeElementFocus(); // ➔ Removes focus from the currently active element
84
+ */
85
85
  declare const removeElementFocus:()=>void;
86
86
  /** ----------------------------------------------------------
87
- * * ***Utility: `scrollToTop`.***
88
- * ----------------------------------------------------------
89
- * **Scrolls the page to the top with optional smooth animation and delay.**
90
- * - **Features**:
91
- * - This function works **only in browser environments** (no effect on server-side).
92
- * - It leverages the native `window.scrollTo()` API with support for smooth scrolling
93
- * and an optional timeout delay before executing the scroll.
94
- * - Each option has strict valid values.
95
- * - If an invalid value is provided, the function **automatically falls back to its default**.
96
- * @param {ScrollToTopOptions} [options] - Optional settings for scroll behavior.
97
- * @param {ScrollToTopOptions["behavior"]} [options.behavior="smooth"] - Scroll animation type.
98
- * - Valid values: `"auto"`, `"instant"`, `"smooth"`.
99
- * - Default force to `"smooth"` if missing or invalid.
100
- * @param {ScrollToTopOptions["timeout"]} [options.timeout=1] - Delay before scrolling (in milliseconds).
101
- * - Default value is `1`.
102
- * - Valid values: any number `≥` `1`.
103
- * - Non-integer number are truncated to an integer.
104
- * - Force to `2147483647` if number is larger than `2147483647`.
105
- * - Default force to `1` if `missing`, `NaN`, `invalid`, or `less-than` `1`.
106
- * @returns {void} Does not return anything, only scrolling to top.
107
- * @example
108
- * // ✅ Valid options value:
109
- * scrollToTop();
110
- * // ➔ Scroll smoothly to the top after 1ms delay
111
- * scrollToTop({ behavior: "instant" });
112
- * // ➔ Jump instantly to the top
113
- * scrollToTop({ timeout: 500 });
114
- * // ➔ Scroll smoothly to the top after 500ms
115
- *
116
- * // ❌ Invalid options value:
117
- * scrollToTop({ behavior: "fly", timeout: -100 });
118
- * // ➔ Fallback: behavior="smooth", timeout=1
119
- * scrollToTop({ behavior: "fly", timeout: 123.55 });
120
- * // ➔ Fallback: behavior="smooth", timeout=123
121
- */
87
+ * * ***Utility: `scrollToTop`.***
88
+ * ----------------------------------------------------------
89
+ * **Scrolls the page to the top with optional smooth animation and delay.**
90
+ * - **Features**:
91
+ * - This function works **only in browser environments** (no effect on server-side).
92
+ * - It leverages the native `window.scrollTo()` API with support for smooth scrolling
93
+ * and an optional timeout delay before executing the scroll.
94
+ * - Each option has strict valid values.
95
+ * - If an invalid value is provided, the function **automatically falls back to its default**.
96
+ * @param {ScrollToTopOptions} [options] - Optional settings for scroll behavior.
97
+ * @param {ScrollToTopOptions["behavior"]} [options.behavior="smooth"] - Scroll animation type.
98
+ * - Valid values: `"auto"`, `"instant"`, `"smooth"`.
99
+ * - Default force to `"smooth"` if missing or invalid.
100
+ * @param {ScrollToTopOptions["timeout"]} [options.timeout=1] - Delay before scrolling (in milliseconds).
101
+ * - Default value is `1`.
102
+ * - Valid values: any number `≥` `1`.
103
+ * - Non-integer number are truncated to an integer.
104
+ * - Force to `2147483647` if number is larger than `2147483647`.
105
+ * - Default force to `1` if `missing`, `NaN`, `invalid`, or `less-than` `1`.
106
+ * @returns {void} Does not return anything, only scrolling to top.
107
+ * @example
108
+ * // ✅ Valid options value:
109
+ * scrollToTop();
110
+ * // ➔ Scroll smoothly to the top after 1ms delay
111
+ * scrollToTop({ behavior: "instant" });
112
+ * // ➔ Jump instantly to the top
113
+ * scrollToTop({ timeout: 500 });
114
+ * // ➔ Scroll smoothly to the top after 500ms
115
+ *
116
+ * // ❌ Invalid options value:
117
+ * scrollToTop({ behavior: "fly", timeout: -100 });
118
+ * // ➔ Fallback: behavior="smooth", timeout=1
119
+ * scrollToTop({ behavior: "fly", timeout: 123.55 });
120
+ * // ➔ Fallback: behavior="smooth", timeout=123
121
+ */
122
122
  declare const scrollToTop:(options?:ScrollToTopOptions)=>void;export{disableUserInteraction,enableUserInteraction,removeElementFocus,scrollToTop};
@@ -1 +1 @@
1
- export{a as disableUserInteraction,b as enableUserInteraction,c as removeElementFocus,d as scrollToTop}from'../chunk-U4TZO7WV.js';import'../chunk-56QBKKRE.js';import'../chunk-JISH2VGG.js';import'../chunk-MJAW5RAK.js';
1
+ export{a as disableUserInteraction,b as enableUserInteraction,c as removeElementFocus,d as scrollToTop}from'../chunk-S5M33A4O.js';import'../chunk-56QBKKRE.js';import'../chunk-NJSAV73S.js';import'../chunk-EWYPSKKM.js';