tiny-essentials 1.16.2 โ†’ 1.17.1

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 (133) hide show
  1. package/dist/legacy/crypto/decrypt.cjs +1 -0
  2. package/dist/legacy/crypto/decrypt.d.mts +1 -0
  3. package/dist/legacy/crypto/decrypt.mjs +1 -0
  4. package/dist/legacy/crypto/encrypt.cjs +1 -0
  5. package/dist/legacy/crypto/encrypt.d.mts +1 -0
  6. package/dist/legacy/crypto/encrypt.mjs +1 -0
  7. package/dist/legacy/get/decimalColor.cjs +1 -0
  8. package/dist/legacy/get/decimalColor.d.mts +1 -0
  9. package/dist/legacy/get/decimalColor.mjs +1 -0
  10. package/dist/legacy/get/pagination.cjs +1 -0
  11. package/dist/legacy/get/pagination.d.mts +1 -0
  12. package/dist/legacy/get/pagination.mjs +1 -0
  13. package/dist/legacy/get/queryUrlByName.cjs +1 -0
  14. package/dist/legacy/get/queryUrlByName.d.mts +1 -0
  15. package/dist/legacy/get/queryUrlByName.mjs +1 -0
  16. package/dist/legacy/get/queryUrlJSON.cjs +1 -0
  17. package/dist/legacy/get/queryUrlJSON.d.mts +1 -0
  18. package/dist/legacy/get/queryUrlJSON.mjs +1 -0
  19. package/dist/legacy/get/super_string_filter.cjs +1 -0
  20. package/dist/legacy/get/super_string_filter.d.mts +1 -0
  21. package/dist/legacy/get/super_string_filter.mjs +1 -0
  22. package/dist/legacy/get/versionCheck.cjs +1 -0
  23. package/dist/legacy/get/versionCheck.d.mts +1 -0
  24. package/dist/legacy/get/versionCheck.mjs +1 -0
  25. package/dist/legacy/http/HTTP-1.0.cjs +2 -0
  26. package/dist/legacy/http/HTTP-1.0.mjs +2 -0
  27. package/dist/legacy/http/auth.cjs +1 -0
  28. package/dist/legacy/http/auth.d.mts +1 -0
  29. package/dist/legacy/http/auth.mjs +1 -0
  30. package/dist/legacy/http/check_domain.cjs +11 -0
  31. package/dist/legacy/http/check_domain.d.mts +3 -0
  32. package/dist/legacy/http/check_domain.mjs +11 -0
  33. package/dist/legacy/http/csrfTokenAnalyze.cjs +1 -0
  34. package/dist/legacy/http/csrfTokenAnalyze.d.mts +1 -0
  35. package/dist/legacy/http/csrfTokenAnalyze.mjs +1 -0
  36. package/dist/legacy/http/domainValidator.cjs +1 -0
  37. package/dist/legacy/http/domainValidator.d.mts +1 -0
  38. package/dist/legacy/http/domainValidator.mjs +1 -0
  39. package/dist/legacy/http/errorsCallback.cjs +1 -0
  40. package/dist/legacy/http/errorsCallback.d.mts +1 -0
  41. package/dist/legacy/http/errorsCallback.mjs +1 -0
  42. package/dist/legacy/http/fetch/json.cjs +1 -0
  43. package/dist/legacy/http/fetch/json.d.mts +1 -0
  44. package/dist/legacy/http/fetch/json.mjs +1 -0
  45. package/dist/legacy/http/fetch/text.cjs +1 -0
  46. package/dist/legacy/http/fetch/text.d.mts +1 -0
  47. package/dist/legacy/http/fetch/text.mjs +1 -0
  48. package/dist/legacy/http/fileCache.cjs +1 -0
  49. package/dist/legacy/http/fileCache.d.mts +1 -0
  50. package/dist/legacy/http/fileCache.mjs +1 -0
  51. package/dist/legacy/http/getDomainURL.cjs +1 -0
  52. package/dist/legacy/http/getDomainURL.d.mts +1 -0
  53. package/dist/legacy/http/getDomainURL.mjs +1 -0
  54. package/dist/legacy/http/userIP.cjs +1 -0
  55. package/dist/legacy/http/userIP.d.mts +1 -0
  56. package/dist/legacy/http/userIP.mjs +1 -0
  57. package/dist/legacy/libs/capitalize.cjs +1 -0
  58. package/dist/legacy/libs/capitalize.d.mts +1 -0
  59. package/dist/legacy/libs/capitalize.mjs +1 -0
  60. package/dist/legacy/libs/convertBytes.cjs +2 -0
  61. package/dist/legacy/libs/convertBytes.mjs +2 -0
  62. package/dist/legacy/libs/custom_module_loader.cjs +2 -0
  63. package/dist/legacy/libs/custom_module_loader.mjs +2 -0
  64. package/dist/legacy/libs/dice.cjs +2 -0
  65. package/dist/legacy/libs/dice.mjs +2 -0
  66. package/dist/legacy/libs/markdown.cjs +1 -0
  67. package/dist/legacy/libs/markdown.mjs +1 -0
  68. package/dist/legacy/libs/percentage.cjs +1 -0
  69. package/dist/legacy/libs/percentage.mjs +1 -0
  70. package/dist/legacy/libs/regex/getLetter.cjs +2 -0
  71. package/dist/legacy/libs/regex/getLetter.d.mts +2 -0
  72. package/dist/legacy/libs/regex/getLetter.mjs +2 -0
  73. package/dist/legacy/libs/rule3.cjs +1 -0
  74. package/dist/legacy/libs/rule3.mjs +1 -0
  75. package/dist/legacy/momentjs/getAge.cjs +1 -0
  76. package/dist/legacy/momentjs/getAge.d.mts +1 -0
  77. package/dist/legacy/momentjs/getAge.mjs +1 -0
  78. package/dist/legacy/momentjs/timeDuration.cjs +1 -0
  79. package/dist/legacy/momentjs/timeDuration.d.mts +1 -0
  80. package/dist/legacy/momentjs/timeDuration.mjs +1 -0
  81. package/dist/legacy/socket.io/antiFlood/install.cjs +1 -0
  82. package/dist/legacy/socket.io/antiFlood/install.d.mts +1 -0
  83. package/dist/legacy/socket.io/antiFlood/install.mjs +1 -0
  84. package/dist/legacy/socket.io/antiFlood/verify.cjs +1 -0
  85. package/dist/legacy/socket.io/antiFlood/verify.d.mts +1 -0
  86. package/dist/legacy/socket.io/antiFlood/verify.mjs +1 -0
  87. package/dist/legacy/socket.io/cookie-session.cjs +1 -0
  88. package/dist/legacy/socket.io/cookie-session.d.mts +1 -0
  89. package/dist/legacy/socket.io/cookie-session.mjs +1 -0
  90. package/dist/legacy/socket.io/discord.cjs +1 -0
  91. package/dist/legacy/socket.io/discord.d.mts +1 -0
  92. package/dist/legacy/socket.io/discord.mjs +1 -0
  93. package/dist/v1/TinyBasicsEs.js +729 -93
  94. package/dist/v1/TinyBasicsEs.min.js +1 -1
  95. package/dist/v1/TinyDragger.js +656 -69
  96. package/dist/v1/TinyDragger.min.js +1 -1
  97. package/dist/v1/TinyEssentials.js +2688 -116
  98. package/dist/v1/TinyEssentials.min.js +1 -1
  99. package/dist/v1/TinyHtml.js +656 -69
  100. package/dist/v1/TinyHtml.min.js +1 -1
  101. package/dist/v1/TinySmartScroller.js +6378 -0
  102. package/dist/v1/TinySmartScroller.min.js +1 -0
  103. package/dist/v1/TinyUploadClicker.js +1732 -118
  104. package/dist/v1/TinyUploadClicker.min.js +1 -1
  105. package/dist/v1/UltraRandomMsgGen.js +995 -0
  106. package/dist/v1/UltraRandomMsgGen.min.js +1 -0
  107. package/dist/v1/basics/html.cjs +74 -24
  108. package/dist/v1/basics/html.d.mts +38 -15
  109. package/dist/v1/basics/html.mjs +63 -20
  110. package/dist/v1/build/TinySmartScroller.cjs +7 -0
  111. package/dist/v1/build/TinySmartScroller.d.mts +3 -0
  112. package/dist/v1/build/TinySmartScroller.mjs +2 -0
  113. package/dist/v1/build/UltraRandomMsgGen.cjs +7 -0
  114. package/dist/v1/build/UltraRandomMsgGen.d.mts +3 -0
  115. package/dist/v1/build/UltraRandomMsgGen.mjs +2 -0
  116. package/dist/v1/index.cjs +4 -0
  117. package/dist/v1/index.d.mts +3 -1
  118. package/dist/v1/index.mjs +3 -1
  119. package/dist/v1/libs/TinyHtml.cjs +656 -69
  120. package/dist/v1/libs/TinyHtml.d.mts +440 -139
  121. package/dist/v1/libs/TinyHtml.mjs +591 -72
  122. package/dist/v1/libs/TinySmartScroller.cjs +976 -0
  123. package/dist/v1/libs/TinySmartScroller.d.mts +458 -0
  124. package/dist/v1/libs/TinySmartScroller.mjs +856 -0
  125. package/dist/v1/libs/UltraRandomMsgGen.cjs +956 -0
  126. package/dist/v1/libs/UltraRandomMsgGen.d.mts +390 -0
  127. package/dist/v1/libs/UltraRandomMsgGen.mjs +825 -0
  128. package/docs/v1/README.md +2 -0
  129. package/docs/v1/basics/html.md +17 -2
  130. package/docs/v1/libs/TinyHtml.md +296 -8
  131. package/docs/v1/libs/TinySmartScroller.md +523 -0
  132. package/docs/v1/libs/UltraRandomMsgGen.md +289 -0
  133. package/package.json +1 -1
@@ -0,0 +1,523 @@
1
+ # ๐Ÿ“ฆ `TinySmartScroller` Class
2
+
3
+ A utility class for managing smart scroll behavior in DOM containers or the window. Ideal for dynamic content like chat UIs or live feeds.
4
+
5
+ ---
6
+
7
+ ## ๐Ÿงฉ Typedefs
8
+
9
+ ### ๐Ÿงฑ `NodeSizes`
10
+
11
+ ```js
12
+ type NodeSizes = { height: number, width: number };
13
+ ```
14
+
15
+ Represents the **dimensions of a DOM element** in pixels.
16
+
17
+ ### ๐Ÿ” `NodeSizesEvent`
18
+
19
+ ```js
20
+ type NodeSizesEvent = (elem, sizes, elemAmount) => NodeSizes | undefined;
21
+ ```
22
+
23
+ A **callback function** used to compare previous and current element sizes, optionally returning custom size adjustments.
24
+
25
+ * `elem`: the DOM element.
26
+ * `sizes.old`: previous size.
27
+ * `sizes.now`: current size.
28
+ * `elemAmount.old` / `elemAmount.now`: number of matching elements before/after.
29
+
30
+ ### ๐Ÿ“ก `ScrollListenersFunc`
31
+
32
+ ```js
33
+ type ScrollListenersFunc = (payload: any) => void;
34
+ ```
35
+
36
+ A generic **scroll event callback function**.
37
+
38
+ ---
39
+
40
+ ## ๐Ÿ—๏ธ Constructor
41
+
42
+ ### โœ… `new TinySmartScroller(target, options?)`
43
+
44
+ Initializes a new smart scroller instance.
45
+
46
+ ```js
47
+ const scroller = new TinySmartScroller(document.querySelector('.chatbox'), {
48
+ autoScrollBottom: true,
49
+ observeMutations: true,
50
+ preserveScrollOnLayoutShift: true,
51
+ debounceTime: 100,
52
+ querySelector: '.message',
53
+ });
54
+ ```
55
+
56
+ ### ๐Ÿ”ง Options:
57
+
58
+ | Option | Type | Default | Description | |
59
+ | ----------------------------- | --------------------- | ----------- | -------------------------------------------------------------------- | ----------------------------------------- |
60
+ | `extraScrollBoundary` | `number` | `0` | Adds extra margin for scroll edge detection | |
61
+ | `autoScrollBottom` | `boolean` | `true` | Auto-scroll to bottom on updates | |
62
+ | `observeMutations` | `boolean` | `true` | Uses MutationObserver to detect DOM changes | |
63
+ | `preserveScrollOnLayoutShift` | `boolean` | `true` | Prevents jumps in scroll position due to layout shifts | |
64
+ | `debounceTime` | `number` | `100` | Debounce time (ms) for scroll processing | |
65
+ | `querySelector` | \`string | null\` | `null` | Filters which children should be observed |
66
+ | `attributeFilter` | `string[]\|Set\|null` | Default set | Which attributes to track for mutations (e.g., `src`, `style`, etc.) | |
67
+
68
+ ---
69
+
70
+ ## ๐Ÿ“ Size Helpers
71
+
72
+ ### ๐Ÿ” `getSimpleOnHeight(filter = [])`
73
+
74
+ Returns a size filter function that only compares height difference for allowed tags.
75
+
76
+ ```js
77
+ const filter = scroller.getSimpleOnHeight(['IMG', 'VIDEO']);
78
+ ```
79
+
80
+ #### โœ… Use when:
81
+
82
+ * You want to track layout shifts that affect only **vertical space**.
83
+ * You want to limit updates by tag name (like images or videos only).
84
+
85
+ ### โž• `addSimpleOnHeight(filter)`
86
+
87
+ Same as `getSimpleOnHeight()`, but **registers the filter** into the scroll system.
88
+
89
+ ```js
90
+ scroller.addSimpleOnHeight(['IFRAME']);
91
+ ```
92
+
93
+ ---
94
+
95
+ ## ๐Ÿ–ผ๏ธ Load Tags Management
96
+
97
+ These are used to determine **which tags can trigger scroll corrections** when they load (e.g., images expanding).
98
+
99
+ ### ๐Ÿ“„ `getLoadTags()`
100
+
101
+ Returns a list of currently tracked **load-sensitive tag names**.
102
+
103
+ ```js
104
+ const tags = scroller.getLoadTags(); // ['IMG', 'IFRAME', 'VIDEO']
105
+ ```
106
+
107
+ ### โž• `addLoadTag(tag)`
108
+
109
+ Adds a tag to the **load tracking set**.
110
+
111
+ ```js
112
+ scroller.addLoadTag('AUDIO');
113
+ ```
114
+
115
+ ### โž– `removeLoadTag(tag)`
116
+
117
+ Removes a tag from the load tracking set.
118
+
119
+ ```js
120
+ scroller.removeLoadTag('IFRAME');
121
+ ```
122
+
123
+ ### โ“ `hasLoadTag(tag)`
124
+
125
+ Checks if a tag is being tracked.
126
+
127
+ ```js
128
+ scroller.hasLoadTag('IMG'); // true
129
+ ```
130
+
131
+ ### โ™ป๏ธ `resetLoadTags(addDefault = false)`
132
+
133
+ Clears the load tags. If `addDefault` is true, resets to: `'IMG'`, `'IFRAME'`, `'VIDEO'`.
134
+
135
+ ```js
136
+ scroller.resetLoadTags(true);
137
+ ```
138
+
139
+ ---
140
+
141
+ ## ๐Ÿงฌ Attribute Filters Management
142
+
143
+ Used by the MutationObserver to watch **specific attribute changes**.
144
+
145
+ ### ๐Ÿ“‹ `getAttributeFilters()`
146
+
147
+ Returns the current list of tracked attributes.
148
+
149
+ ```js
150
+ scroller.getAttributeFilters(); // ['class', 'style', 'src', ...]
151
+ ```
152
+
153
+ ### โž• `addAttributeFilter(attr)`
154
+
155
+ Adds an attribute to the filter set.
156
+
157
+ ```js
158
+ scroller.addAttributeFilter('data-src');
159
+ ```
160
+
161
+ ### โž– `removeAttributeFilter(attr)`
162
+
163
+ Removes an attribute from the filter set.
164
+
165
+ ```js
166
+ scroller.removeAttributeFilter('style');
167
+ ```
168
+
169
+ ### โ“ `hasAttributeFilter(attr)`
170
+
171
+ Checks if an attribute is being watched.
172
+
173
+ ```js
174
+ scroller.hasAttributeFilter('src'); // true
175
+ ```
176
+
177
+ ### โ™ป๏ธ `resetAttributeFilters(addDefault = false)`
178
+
179
+ Clears attribute filters. If `addDefault` is true, resets to:
180
+
181
+ ```js
182
+ ['class', 'style', 'src', 'data-*', 'height', 'width']
183
+ ```
184
+
185
+ ---
186
+
187
+ ## ๐Ÿง  Size Filter Handlers
188
+
189
+ ### ๐Ÿช `onSize(handler)`
190
+
191
+ Registers a custom handler to observe changes in element size.
192
+
193
+ ```js
194
+ scroller.onSize((elem, sizes) => {
195
+ if (sizes.now.height > sizes.old.height) {
196
+ return { height: sizes.now.height - sizes.old.height, width: 0 };
197
+ }
198
+ });
199
+ ```
200
+
201
+ * ๐Ÿ“Œ **Throws** if `handler` is not a function.
202
+ * ๐Ÿšซ Does nothing if the instance is destroyed.
203
+
204
+ ---
205
+
206
+ ### โŒ `offSize(handler)`
207
+
208
+ Removes a previously registered size change handler.
209
+
210
+ ```js
211
+ scroller.offSize(mySizeHandler);
212
+ ```
213
+
214
+ * ๐Ÿ“Œ **Throws** if `handler` is not a function.
215
+ * ๐Ÿšซ Does nothing if the instance is destroyed.
216
+
217
+ ---
218
+
219
+ ## ๐Ÿ—ฃ๏ธ Scroll Event Listeners
220
+
221
+ ### ๐Ÿงท `on(event, handler)`
222
+
223
+ Registers a scroll-related listener.
224
+
225
+ ```js
226
+ scroller.on('onAutoScroll', (payload) => {
227
+ console.log('Auto-scrolling triggered!', payload);
228
+ });
229
+ ```
230
+
231
+ * ๐Ÿ“Œ **Valid events**:
232
+ `onScrollBoundary`, `onAutoScroll`, `onScrollPause`, `onExtraScrollBoundary`
233
+ * ๐Ÿ“Œ **Throws** if `event` is not a string or `handler` is not a function.
234
+
235
+ ---
236
+
237
+ ### โŒ `off(event, handler)`
238
+
239
+ Removes a scroll event listener.
240
+
241
+ ```js
242
+ scroller.off('onAutoScroll', myListener);
243
+ ```
244
+
245
+ * ๐Ÿ“Œ **Throws** if `event` is not a string or `handler` is not a function.
246
+
247
+ ---
248
+
249
+ ## ๐Ÿ‘๏ธโ€๐Ÿ—จ๏ธ Visibility Map Updater
250
+
251
+ ### ๐Ÿ” `_scrollDataUpdater()`
252
+
253
+ Scans visible elements and tracks visibility changes internally.
254
+
255
+ ```js
256
+ const result = scroller._scrollDataUpdater();
257
+ // Map<Element, { oldIsVisible: boolean, isVisible: boolean }>
258
+ ```
259
+
260
+ * โœ… Returns a `Map` of visibility states for each target element.
261
+
262
+ ---
263
+
264
+ ## ๐Ÿš€ Internal Event Emission
265
+
266
+ ### ๐Ÿ“ฃ `_emit(event, payload?)`
267
+
268
+ Calls all registered handlers for the specified scroll event.
269
+
270
+ ```js
271
+ scroller._emit('onAutoScroll', { debug: true });
272
+ ```
273
+
274
+ * ๐Ÿ“Œ **Throws** if `event` is not a string.
275
+ * ๐Ÿšซ Does nothing if the instance is destroyed.
276
+
277
+ ---
278
+
279
+ ## ๐Ÿ“œ Scroll Position Evaluation
280
+
281
+ ### ๐ŸŽข `_onScroll()`
282
+
283
+ Handles scroll updates, boundary detection, and emits relevant events:
284
+
285
+ ```js
286
+ // Emits:
287
+ 'onScrollBoundary'
288
+ 'onExtraScrollBoundary'
289
+ 'onAutoScroll'
290
+ 'onScrollPause'
291
+ ```
292
+
293
+ * ๐Ÿ”„ Updates scroll direction states like `isAtBottom`, `isAtTop`.
294
+ * ๐Ÿง  Determines whether to pause or continue auto-scroll.
295
+
296
+ ---
297
+
298
+ ## ๐Ÿ”ง Scroll Correction on Layout Shifts
299
+
300
+ ### ๐Ÿช„ `_fixScroll(targets = [])`
301
+
302
+ Attempts to correct scroll position after layout changes (like image loading or content insertion).
303
+
304
+ ```js
305
+ scroller._fixScroll([imgElement]);
306
+ ```
307
+
308
+ * ๐Ÿ” Measures height & width delta using `ResizeObserver` entries.
309
+ * ๐Ÿ”„ Preserves scroll position intelligently unless scrolled to bottom.
310
+ * ๐Ÿ“Œ Throws if invalid return types are found in size handlers.
311
+
312
+ ---
313
+
314
+ ## ๐Ÿงฌ Mutation Observer Setup
315
+
316
+ ### ๐Ÿ‘€ `_observeMutations()`
317
+
318
+ Initializes a `MutationObserver` to watch child mutations and trigger scroll adjustments.
319
+
320
+ * ๐ŸŽฏ Watches:
321
+
322
+ * Element insertion/removal
323
+ * Attribute changes (filtered)
324
+ * ๐Ÿ“Œ Automatically sets up `ResizeObserver` and load listeners on new elements.
325
+
326
+ ---
327
+
328
+ ## ๐Ÿ“ Resize Observer Setup
329
+
330
+ ### ๐Ÿงฟ `_observeResizes(elements)`
331
+
332
+ Applies a `ResizeObserver` to elements for layout shift tracking.
333
+
334
+ ```js
335
+ scroller._observeResizes(document.querySelectorAll('.message'));
336
+ ```
337
+
338
+ * ๐ŸŽฏ Updates size maps (`#oldSizes`, `#newSizes`)
339
+ * ๐Ÿ“Œ Throws if `ResizeObserver` is missing or invalid.
340
+
341
+ ---
342
+
343
+ ## ๐Ÿ“ก Load Event Listener for Media
344
+
345
+ ### ๐ŸŽฌ `_listenLoadEvents(elements)`
346
+
347
+ Tracks loading of elements like `IMG`, `IFRAME`, and `VIDEO`.
348
+
349
+ ```js
350
+ scroller._listenLoadEvents(imgElement);
351
+ ```
352
+
353
+ * โณ Listens for the `load` event.
354
+ * โœ… Triggers scroll updates and auto-scroll when media finishes loading.
355
+ * โœ… Honors load tags set by `addLoadTag()`.
356
+
357
+ ---
358
+
359
+ ## ๐Ÿงฑ DOM and Element Accessors
360
+
361
+ ### ๐ŸŽฏ `target`
362
+
363
+ Returns the internal scroll container element being monitored.
364
+
365
+ ```js
366
+ const container = scroller.target;
367
+ ```
368
+
369
+ * ๐Ÿ”™ Returns the target DOM element (or `window` if in window mode).
370
+
371
+ ### ๐Ÿ•ต๏ธโ€โ™€๏ธ `getOldSize(el)`
372
+
373
+ Gets the previous recorded size of an element.
374
+
375
+ ```js
376
+ scroller.getOldSize(myDiv); // โ†’ { height: 120, width: 300 }
377
+ ```
378
+
379
+ * โ“ Returns `null` if the element wasn't tracked.
380
+
381
+ ### ๐Ÿ“ `getNewSize(el)`
382
+
383
+ Gets the most recent measured size of an element.
384
+
385
+ ```js
386
+ scroller.getNewSize(myDiv); // โ†’ { height: 150, width: 300 }
387
+ ```
388
+
389
+ * โ“ Returns `null` if the element wasn't tracked.
390
+
391
+ ---
392
+
393
+ ## ๐Ÿ‘๏ธ Visibility Status Checkers
394
+
395
+ ### ๐Ÿ‘€ `wasVisible(el)`
396
+
397
+ Returns `true` if the element was visible during the last scroll update.
398
+
399
+ ### ๐Ÿ”Ž `isVisible(el)`
400
+
401
+ Returns `true` if the element is currently visible in the scroll view.
402
+
403
+ ### โฑ๏ธ `wasTimedVisible(el)`
404
+
405
+ Returns visibility based on the previous **timed** visibility update.
406
+
407
+ ### โŒš `isTimedVisible(el)`
408
+
409
+ Returns visibility based on the current **timed** visibility update.
410
+
411
+ ---
412
+
413
+ ## ๐Ÿ“ Scroll Configuration and Info
414
+
415
+ ### โž• `setExtraScrollBoundary(pixels)`
416
+
417
+ Defines a custom pixel margin for top/bottom boundary detection.
418
+
419
+ ```js
420
+ scroller.setExtraScrollBoundary(50);
421
+ ```
422
+
423
+ * ๐Ÿ”’ Throws if not a valid number.
424
+
425
+ ### ๐Ÿ“Š `getExtraScrollBoundary()`
426
+
427
+ Returns the currently defined extra scroll boundary in pixels.
428
+
429
+ ### ๐Ÿ“‰ `getLastKnownScrollBottomOffset()`
430
+
431
+ Gets the last recorded scroll distance from the bottom (in pixels).
432
+
433
+ ### โฌ‡๏ธ `scrollToBottom()`
434
+
435
+ Scrolls the target all the way to the bottom immediately.
436
+
437
+ ### โฌ†๏ธ `scrollToTop()`
438
+
439
+ Scrolls the target all the way to the top immediately.
440
+
441
+ ---
442
+
443
+ ## ๐Ÿงญ Scroll Position Status
444
+
445
+ ### ๐Ÿ”š `isUserAtCustomBottom()`
446
+
447
+ Returns `true` if the user is within the custom boundary of the bottom.
448
+
449
+ ### ๐Ÿ” `isUserAtCustomTop()`
450
+
451
+ Returns `true` if the user is within the custom boundary of the top.
452
+
453
+ ### ๐Ÿงจ `isUserAtBottom()`
454
+
455
+ Returns `true` if user is currently scrolled to the actual bottom.
456
+
457
+ ### ๐Ÿงท `isUserAtTop()`
458
+
459
+ Returns `true` if user is currently scrolled to the actual top.
460
+
461
+ ### โธ๏ธ `isScrollPaused()`
462
+
463
+ Returns `true` if auto-scroll is currently paused.
464
+
465
+ ---
466
+
467
+ ## ๐Ÿ’ป Internal Engine Status
468
+
469
+ ### ๐ŸŒ `isWindow()`
470
+
471
+ Returns `true` if the scroll target is the `window` object.
472
+
473
+ ### ๐Ÿ’€ `isDestroyed()`
474
+
475
+ Returns `true` if the instance has already been destroyed.
476
+
477
+ ### ๐Ÿ” `getAutoScrollBottom()`
478
+
479
+ Returns whether auto-scroll-to-bottom is active.
480
+
481
+ ### ๐Ÿงฌ `getObserveMutations()`
482
+
483
+ Returns whether `MutationObserver` is currently enabled.
484
+
485
+ ### ๐Ÿงท `getPreserveScrollOnLayoutShift()`
486
+
487
+ Returns whether scroll preservation is enabled when layout shifts.
488
+
489
+ ### โŒ› `getDebounceTime()`
490
+
491
+ Returns the debounce delay (ms) for scroll-based events.
492
+
493
+ ---
494
+
495
+ ## ๐Ÿงฎ Tracked Element Info
496
+
497
+ ### ๐Ÿ“ `getElemAmount()`
498
+
499
+ Returns the current number of matching observed elements.
500
+
501
+ ### ๐Ÿงพ `getPrevElemAmount()`
502
+
503
+ Returns the previous number of matching elements.
504
+
505
+ ### ๐Ÿงต `getQuerySelector()`
506
+
507
+ Returns the CSS selector used to filter tracked elements.
508
+
509
+ ---
510
+
511
+ ## ๐Ÿ’ฃ Cleanup and Destruction
512
+
513
+ ### โ˜ ๏ธ `destroy()`
514
+
515
+ Disconnects all internal listeners and observers and clears memory.
516
+
517
+ ```js
518
+ scroller.destroy();
519
+ ```
520
+
521
+ * ๐Ÿงน Removes `scroll`, `resize`, and `load` listeners.
522
+ * ๐Ÿงผ Clears WeakMaps and listener registries.
523
+ * โŒ Once destroyed, the instance should not be reused.