tiny-essentials 1.16.2 → 1.17.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 (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 +559 -71
  94. package/dist/v1/TinyBasicsEs.min.js +1 -1
  95. package/dist/v1/TinyDragger.js +486 -47
  96. package/dist/v1/TinyDragger.min.js +1 -1
  97. package/dist/v1/TinyEssentials.js +2496 -72
  98. package/dist/v1/TinyEssentials.min.js +1 -1
  99. package/dist/v1/TinyHtml.js +486 -47
  100. package/dist/v1/TinyHtml.min.js +1 -1
  101. package/dist/v1/TinySmartScroller.js +6230 -0
  102. package/dist/v1/TinySmartScroller.min.js +1 -0
  103. package/dist/v1/TinyUploadClicker.js +1538 -72
  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 +486 -47
  120. package/dist/v1/libs/TinyHtml.d.mts +352 -139
  121. package/dist/v1/libs/TinyHtml.mjs +431 -47
  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 +197 -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
@@ -40,6 +40,17 @@ export type TinyElementAndWindow = ElementAndWindow | TinyHtml;
40
40
  * Useful for functions that operate generically on scrollable or measurable targets.
41
41
  */
42
42
  export type ElementAndWindow = Element | Window;
43
+ /**
44
+ * Represents a raw DOM element/window/document or an instance of TinyHtml.
45
+ * This type is used to abstract interactions with both plain elements
46
+ * and wrapped elements via the TinyHtml class.
47
+ */
48
+ export type TinyElementAndWinAndDoc = ElementAndWinAndDoc | TinyHtml;
49
+ /**
50
+ * Represents a value that can be either a DOM Element, or the global Window object, or the document object.
51
+ * Useful for functions that operate generically on scrollable or measurable targets.
52
+ */
53
+ export type ElementAndWinAndDoc = Element | Window | Document;
43
54
  /**
44
55
  * A parameter type used for filtering or matching elements.
45
56
  * It can be:
@@ -54,7 +65,7 @@ export type WinnowRequest = string | Element | Element[] | ((index: number, el:
54
65
  * Elements accepted as constructor values for TinyHtml.
55
66
  * These include common DOM elements and root containers.
56
67
  */
57
- export type ConstructorElValues = Window | Element | Document;
68
+ export type ConstructorElValues = Window | Element | Document | Text;
58
69
  /**
59
70
  * The handler function used in event listeners.
60
71
  */
@@ -186,34 +197,7 @@ declare class TinyHtml {
186
197
  areElsCollRight: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
187
198
  areElsCollPerfTop: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
188
199
  areElsCollPerfBottom: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
189
- areElsCollPerfLeft: (rect1: TinyCollision.ObjRect,
190
- /**
191
- * @typedef {string | number | Date | boolean | null} SetValueBase - Primitive types accepted as input values.
192
- */
193
- /**
194
- * @typedef {'string' | 'date' | 'number'} GetValueTypes
195
- * Types of value extractors supported by TinyHtml._valTypes.
196
- */
197
- /**
198
- * @typedef {SetValueBase|SetValueBase[]} SetValueList - A single value or an array of values to be assigned to the input element.
199
- */
200
- /**
201
- * A list of HTML form elements that can have a `.value` property used by TinyHtml.
202
- * Includes common input types used in forms.
203
- *
204
- * @typedef {HTMLInputElement|HTMLSelectElement|HTMLTextAreaElement|HTMLOptionElement} InputElement
205
- */
206
- /**
207
- * TinyHtml is a utility class that provides static and instance-level methods
208
- * for precise dimension and position computations on HTML elements.
209
- * It mimics some jQuery functionalities while using native browser APIs.
210
- *
211
- * Inspired by the jQuery project's open source implementations of element dimension
212
- * and offset utilities. This class serves as a lightweight alternative using modern DOM APIs.
213
- *
214
- * @class
215
- */
216
- rect2: TinyCollision.ObjRect) => boolean;
200
+ areElsCollPerfLeft: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
217
201
  areElsCollPerfRight: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
218
202
  areElsColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
219
203
  areElsPerfColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
@@ -239,36 +223,66 @@ declare class TinyHtml {
239
223
  y: number;
240
224
  };
241
225
  };
226
+ /**
227
+ * Creates a new DOM element with the specified tag name and options, then wraps it in a TinyHtml instance.
228
+ *
229
+ * @param {string} tagName - The tag name of the element to create (e.g., 'div', 'span').
230
+ * @param {ElementCreationOptions} ops - Optional settings for creating the element.
231
+ * @returns {TinyHtml} A TinyHtml instance wrapping the newly created DOM element.
232
+ * @throws {TypeError} If tagName is not a string or ops is not an object.
233
+ */
234
+ static createElement(tagName: string, ops: ElementCreationOptions): TinyHtml;
235
+ /**
236
+ * Creates a new TinyHtml instance that wraps a DOM TextNode.
237
+ *
238
+ * This method is useful when you want to insert raw text content into the DOM
239
+ * without it being interpreted as HTML. The returned instance behaves like any
240
+ * other TinyHtml element and can be appended or manipulated as needed.
241
+ *
242
+ * @param {string} value - The plain text content to be wrapped in a TextNode.
243
+ * @returns {TinyHtml} A TinyHtml instance wrapping the newly created DOM TextNode.
244
+ * @throws {TypeError} If the provided value is not a string.
245
+ */
246
+ static createTextNode(value: string): TinyHtml;
247
+ /**
248
+ * Creates an HTMLElement or TextNode from an HTML string.
249
+ * Supports both elements and plain text.
250
+ *
251
+ * @param {string} htmlString - The HTML string to convert.
252
+ * @returns {TinyHtml} - A single HTMLElement or TextNode.
253
+ */
254
+ static createElementFromHTML(htmlString: string): TinyHtml;
242
255
  /**
243
256
  * Queries the document for the first element matching the CSS selector and wraps it in a TinyHtml instance.
244
257
  *
245
258
  * @param {string} selector - A valid CSS selector string.
246
- * @returns {TinyHtml} A TinyHtml instance wrapping the matched element.
247
- * @throws {Error} If no element matches the selector.
259
+ * @param {Document|Element} elem - Target element.
260
+ * @returns {TinyHtml|null} A TinyHtml instance wrapping the matched element.
248
261
  */
249
- static query(selector: string): TinyHtml;
262
+ static query(selector: string, elem?: Document | Element): TinyHtml | null;
250
263
  /**
251
264
  * Queries the document for all elements matching the CSS selector and wraps them in TinyHtml instances.
252
265
  *
253
266
  * @param {string} selector - A valid CSS selector string.
267
+ * @param {Document|Element} elem - Target element.
254
268
  * @returns {TinyHtml[]} An array of TinyHtml instances wrapping the matched elements.
255
269
  */
256
- static queryAll(selector: string): TinyHtml[];
270
+ static queryAll(selector: string, elem?: Document | Element): TinyHtml[];
257
271
  /**
258
272
  * Retrieves an element by its ID and wraps it in a TinyHtml instance.
259
273
  *
260
274
  * @param {string} selector - The ID of the element to retrieve.
261
- * @returns {TinyHtml} A TinyHtml instance wrapping the found element.
262
- * @throws {Error} If no element is found with the specified ID.
275
+ * @returns {TinyHtml|null} A TinyHtml instance wrapping the found element.
263
276
  */
264
- static getById(selector: string): TinyHtml;
277
+ static getById(selector: string): TinyHtml | null;
265
278
  /**
266
279
  * Retrieves all elements with the specified class name and wraps them in TinyHtml instances.
267
280
  *
268
281
  * @param {string} selector - The class name to search for.
282
+ * @param {Document|Element} elem - Target element.
269
283
  * @returns {TinyHtml[]} An array of TinyHtml instances wrapping the found elements.
270
284
  */
271
- static getByClassName(selector: string): TinyHtml[];
285
+ static getByClassName(selector: string, elem?: Document | Element): TinyHtml[];
272
286
  /**
273
287
  * Retrieves all elements with the specified name attribute and wraps them in TinyHtml instances.
274
288
  *
@@ -282,9 +296,10 @@ declare class TinyHtml {
282
296
  *
283
297
  * @param {string} localName - The local name (tag) of the elements to search for.
284
298
  * @param {string|null} [namespaceURI='http://www.w3.org/1999/xhtml'] - The namespace URI to search within.
299
+ * @param {Document|Element} elem - Target element.
285
300
  * @returns {TinyHtml[]} An array of TinyHtml instances wrapping the found elements.
286
301
  */
287
- static getByTagNameNS(localName: string, namespaceURI?: string | null): TinyHtml[];
302
+ static getByTagNameNS(localName: string, namespaceURI?: string | null, elem?: Document | Element): TinyHtml[];
288
303
  /**
289
304
  * @param {TinyElement|EventTarget|null|(TinyElement|EventTarget|null)[]} elems
290
305
  * @param {string} where
@@ -434,6 +449,26 @@ declare class TinyHtml {
434
449
  * @readonly
435
450
  */
436
451
  static readonly _preElemAndWindow(elems: TinyElementAndWindow | TinyElementAndWindow[], where: string): ElementAndWindow;
452
+ /**
453
+ * Ensures the input is returned as an array.
454
+ * Useful to normalize operations across multiple or single element/window/document elements.
455
+ *
456
+ * @param {TinyElementAndWinAndDoc|TinyElementAndWinAndDoc[]} elems - A single element/window element or array of html elements.
457
+ * @param {string} where - The method or context name where validation is being called.
458
+ * @returns {ElementAndWindow[]} - Always returns an array of element/window elements.
459
+ * @readonly
460
+ */
461
+ static readonly _preElemsAndWinAndDoc(elems: TinyElementAndWinAndDoc | TinyElementAndWinAndDoc[], where: string): ElementAndWindow[];
462
+ /**
463
+ * Ensures the input is returned as an single element/window/document element.
464
+ * Useful to normalize operations across multiple or single element/window/document elements.
465
+ *
466
+ * @param {TinyElementAndWinAndDoc|TinyElementAndWinAndDoc[]} elems - A single element/window element or array of html elements.
467
+ * @param {string} where - The method or context name where validation is being called.
468
+ * @returns {ElementAndWindow} - Always returns an single element/window element.
469
+ * @readonly
470
+ */
471
+ static readonly _preElemAndWinAndDoc(elems: TinyElementAndWinAndDoc | TinyElementAndWinAndDoc[], where: string): ElementAndWindow;
437
472
  /**
438
473
  * Normalizes and converts one or more DOM elements (or TinyHtml instances)
439
474
  * into an array of `TinyHtml` instances.
@@ -568,9 +603,9 @@ declare class TinyHtml {
568
603
  * @param {string} key - The key under which the data will be stored.
569
604
  * @param {any} value - The value to store.
570
605
  * @param {boolean} [isPrivate=false] - Whether to store the data in the private store.
571
- * @returns {void}
606
+ * @returns {TinyElement}
572
607
  */
573
- static setData(el: TinyElement, key: string, value: any, isPrivate?: boolean): void;
608
+ static setData(el: TinyElement, key: string, value: any, isPrivate?: boolean): TinyElement;
574
609
  /**
575
610
  * Get the sibling element in a given direction.
576
611
  *
@@ -691,76 +726,86 @@ declare class TinyHtml {
691
726
  /**
692
727
  * Appends child elements or strings to the end of the target element(s).
693
728
  *
694
- * @param {TinyElement | TinyElement[]} el - The target element(s) to receive children.
729
+ * @param {TinyElement} el - The target element(s) to receive children.
695
730
  * @param {...(TinyNode | TinyNode[] | string)} children - The child elements or text to append.
731
+ * @returns {TinyElement}
696
732
  */
697
- static append(el: TinyElement | TinyElement[], ...children: (TinyNode | TinyNode[] | string)[]): void;
733
+ static append(el: TinyElement, ...children: (TinyNode | TinyNode[] | string)[]): TinyElement;
698
734
  /**
699
735
  * Prepends child elements or strings to the beginning of the target element(s).
700
736
  *
701
- * @param {TinyElement | TinyElement[]} el - The target element(s) to receive children.
737
+ * @param {TinyElement} el - The target element(s) to receive children.
702
738
  * @param {...(TinyNode | TinyNode[] | string)} children - The child elements or text to prepend.
739
+ * @returns {TinyElement}
703
740
  */
704
- static prepend(el: TinyElement | TinyElement[], ...children: (TinyNode | TinyNode[] | string)[]): void;
741
+ static prepend(el: TinyElement, ...children: (TinyNode | TinyNode[] | string)[]): TinyElement;
705
742
  /**
706
743
  * Inserts elements or strings immediately before the target element(s) in the DOM.
707
744
  *
708
- * @param {TinyElement | TinyElement[]} el - The target element(s) before which new content is inserted.
745
+ * @param {TinyElement} el - The target element(s) before which new content is inserted.
709
746
  * @param {...(TinyNode | TinyNode[] | string)} children - Elements or text to insert before the target.
747
+ * @returns {TinyElement}
710
748
  */
711
- static before(el: TinyElement | TinyElement[], ...children: (TinyNode | TinyNode[] | string)[]): void;
749
+ static before(el: TinyElement, ...children: (TinyNode | TinyNode[] | string)[]): TinyElement;
712
750
  /**
713
751
  * Inserts elements or strings immediately after the target element(s) in the DOM.
714
752
  *
715
- * @param {TinyElement | TinyElement[]} el - The target element(s) after which new content is inserted.
753
+ * @param {TinyElement} el - The target element(s) after which new content is inserted.
716
754
  * @param {...(TinyNode | TinyNode[] | string)} children - Elements or text to insert after the target.
755
+ * @returns {TinyElement}
717
756
  */
718
- static after(el: TinyElement | TinyElement[], ...children: (TinyNode | TinyNode[] | string)[]): void;
757
+ static after(el: TinyElement, ...children: (TinyNode | TinyNode[] | string)[]): TinyElement;
719
758
  /**
720
759
  * Replaces the target element(s) in the DOM with new elements or text.
721
760
  *
722
- * @param {TinyElement | TinyElement[]} el - The element(s) to be replaced.
761
+ * @param {TinyElement} el - The element(s) to be replaced.
723
762
  * @param {...(TinyNode | TinyNode[] | string)} newNodes - New elements or text to replace the target.
763
+ * @returns {TinyElement}
724
764
  */
725
- static replaceWith(el: TinyElement | TinyElement[], ...newNodes: (TinyNode | TinyNode[] | string)[]): void;
765
+ static replaceWith(el: TinyElement, ...newNodes: (TinyNode | TinyNode[] | string)[]): TinyElement;
726
766
  /**
727
767
  * Appends the given element(s) to each target element in sequence.
728
768
  *
729
769
  * @param {TinyNode | TinyNode[]} el - The element(s) to append.
730
770
  * @param {TinyNode | TinyNode[]} targets - Target element(s) where content will be appended.
771
+ * @returns {TinyNode|TinyNode[]}
731
772
  */
732
- static appendTo(el: TinyNode | TinyNode[], targets: TinyNode | TinyNode[]): void;
773
+ static appendTo(el: TinyNode | TinyNode[], targets: TinyNode | TinyNode[]): TinyNode | TinyNode[];
733
774
  /**
734
775
  * Prepends the given element(s) to each target element in sequence.
735
776
  *
736
777
  * @param {TinyElement | TinyElement[]} el - The element(s) to prepend.
737
778
  * @param {TinyElement | TinyElement[]} targets - Target element(s) where content will be prepended.
779
+ * @returns {TinyElement|TinyElement[]}
738
780
  */
739
- static prependTo(el: TinyElement | TinyElement[], targets: TinyElement | TinyElement[]): void;
781
+ static prependTo(el: TinyElement | TinyElement[], targets: TinyElement | TinyElement[]): TinyElement | TinyElement[];
740
782
  /**
741
783
  * Inserts the element before a child of a given target, or before the target itself.
742
784
  *
743
785
  * @param {TinyNode | TinyNode[]} el - The element(s) to insert.
744
786
  * @param {TinyNode | TinyNode[]} target - The reference element where insertion happens.
745
787
  * @param {TinyNode | TinyNode[] | null} [child=null] - Optional child to insert before, defaults to target.
788
+ * @returns {TinyNode|TinyNode[]}
746
789
  */
747
- static insertBefore(el: TinyNode | TinyNode[], target: TinyNode | TinyNode[], child?: TinyNode | TinyNode[] | null): void;
790
+ static insertBefore(el: TinyNode | TinyNode[], target: TinyNode | TinyNode[], child?: TinyNode | TinyNode[] | null): TinyNode | TinyNode[];
748
791
  /**
749
792
  * Inserts the element after a child of a given target, or after the target itself.
750
793
  *
751
794
  * @param {TinyNode | TinyNode[]} el - The element(s) to insert.
752
795
  * @param {TinyNode | TinyNode[]} target - The reference element where insertion happens.
753
796
  * @param {TinyNode | TinyNode[] | null} [child=null] - Optional child to insert after, defaults to target.
797
+ * @returns {TinyNode|TinyNode[]}
754
798
  */
755
- static insertAfter(el: TinyNode | TinyNode[], target: TinyNode | TinyNode[], child?: TinyNode | TinyNode[] | null): void;
799
+ static insertAfter(el: TinyNode | TinyNode[], target: TinyNode | TinyNode[], child?: TinyNode | TinyNode[] | null): TinyNode | TinyNode[];
756
800
  /**
757
801
  * Replaces all target elements with the provided element(s).
758
802
  * If multiple targets exist, the inserted elements are cloned accordingly.
759
803
  *
760
804
  * @param {TinyNode | TinyNode[]} el - The new element(s) to insert.
761
805
  * @param {TinyNode | TinyNode[]} targets - The elements to be replaced.
806
+ * @returns {TinyNode|TinyNode[]}
762
807
  */
763
- static replaceAll(el: TinyNode | TinyNode[], targets: TinyNode | TinyNode[]): void;
808
+ static replaceAll(el: TinyNode | TinyNode[], targets: TinyNode | TinyNode[]): TinyNode | TinyNode[];
764
809
  /**
765
810
  * Checks whether the given object is a window.
766
811
  * @param {*} obj - The object to test.
@@ -847,8 +892,9 @@ declare class TinyHtml {
847
892
  * @param {TinyHtmlElement|TinyHtmlElement[]} el - The element to inspect.
848
893
  * @param {string|Object} prop - The property name or an object with key-value pairs
849
894
  * @param {string|null} [value=null] - The value to set (if `prop` is a string)
895
+ * @returns {TinyHtmlElement|TinyHtmlElement[]}
850
896
  */
851
- static setStyle(el: TinyHtmlElement | TinyHtmlElement[], prop: string | Object, value?: string | null): void;
897
+ static setStyle(el: TinyHtmlElement | TinyHtmlElement[], prop: string | Object, value?: string | null): TinyHtmlElement | TinyHtmlElement[];
852
898
  /**
853
899
  * Gets the value of a specific inline style property.
854
900
  *
@@ -881,8 +927,9 @@ declare class TinyHtml {
881
927
  *
882
928
  * @param {TinyHtmlElement|TinyHtmlElement[]} el - A single element or an array of elements.
883
929
  * @param {string|string[]} prop - A property name or an array of property names to remove.
930
+ * @returns {TinyHtmlElement|TinyHtmlElement[]}
884
931
  */
885
- static removeStyle(el: TinyHtmlElement | TinyHtmlElement[], prop: string | string[]): void;
932
+ static removeStyle(el: TinyHtmlElement | TinyHtmlElement[], prop: string | string[]): TinyHtmlElement | TinyHtmlElement[];
886
933
  /**
887
934
  * Toggles a CSS property value between two given values.
888
935
  *
@@ -892,26 +939,40 @@ declare class TinyHtml {
892
939
  * @param {string} prop - The CSS property to toggle.
893
940
  * @param {string} val1 - The first value (used as "current" check).
894
941
  * @param {string} val2 - The second value (used as the "alternative").
942
+ * @returns {TinyHtmlElement|TinyHtmlElement[]}
895
943
  */
896
- static toggleStyle(el: TinyHtmlElement | TinyHtmlElement[], prop: string, val1: string, val2: string): void;
944
+ static toggleStyle(el: TinyHtmlElement | TinyHtmlElement[], prop: string, val1: string, val2: string): TinyHtmlElement | TinyHtmlElement[];
897
945
  /**
898
946
  * Removes all inline styles (`style` attribute) from the given element(s).
899
947
  *
900
948
  * @param {TinyElement|TinyElement[]} el - A single element or an array of elements.
949
+ * @returns {TinyElement|TinyElement[]}
901
950
  */
902
- static clearStyle(el: TinyElement | TinyElement[]): void;
951
+ static clearStyle(el: TinyElement | TinyElement[]): TinyElement | TinyElement[];
903
952
  /**
904
953
  * Focus the element.
905
954
  *
906
955
  * @param {TinyHtmlElement} el - The element or a selector string.
956
+ * @returns {TinyHtmlElement}
907
957
  */
908
- static focus(el: TinyHtmlElement): void;
958
+ static focus(el: TinyHtmlElement): TinyHtmlElement;
909
959
  /**
910
960
  * Blur the element.
911
961
  *
912
962
  * @param {TinyHtmlElement} el - The element or a selector string.
963
+ * @returns {TinyHtmlElement}
964
+ */
965
+ static blur(el: TinyHtmlElement): TinyHtmlElement;
966
+ /**
967
+ * Interprets a value as a boolean `true` if it matches a common truthy representation.
968
+ *
969
+ * This method checks if the input is any of the common forms used to represent `true`,
970
+ * such as the string `'true'`, `'1'`, `'on'`, the boolean `true`, or the number `1`.
971
+ *
972
+ * @param {string|boolean|number} [value] - The value to interpret as boolean.
973
+ * @returns {boolean} `true` if the value represents a truthy state, otherwise `false`.
913
974
  */
914
- static blur(el: TinyHtmlElement): void;
975
+ static boolCheck(value?: string | boolean | number): boolean;
915
976
  /**
916
977
  * Sets the vertical scroll position of the window.
917
978
  * @param {number} value - Sets the scroll position.
@@ -942,67 +1003,87 @@ declare class TinyHtml {
942
1003
  * @returns {number} - Viewport width in pixels.
943
1004
  */
944
1005
  static winInnerWidth(): number;
1006
+ /**
1007
+ * Checks if the page is currently scrolled to the very top.
1008
+ *
1009
+ * This method compares the current vertical scroll position with the total document height.
1010
+ * It's useful for detecting if the user has reached the top of the page.
1011
+ *
1012
+ * @returns {boolean} `true` if the page is scrolled to the top, otherwise `false`.
1013
+ */
1014
+ static isPageTop(): boolean;
1015
+ /**
1016
+ * Checks if the page is currently scrolled to the very bottom.
1017
+ *
1018
+ * This method uses the `scrollY` and `innerHeight` properties to determine if the
1019
+ * user has reached the end of the document.
1020
+ *
1021
+ * @returns {boolean} `true` if the page is scrolled to the bottom, otherwise `false`.
1022
+ */
1023
+ static isPageBottom(): boolean;
945
1024
  /**
946
1025
  * Gets the width or height of an element based on the box model.
947
- * @param {TinyElementAndWindow} el - The element or window.
1026
+ * @param {TinyElementAndWinAndDoc} el - The element or window.
948
1027
  * @param {"width"|"height"} type - Dimension type.
949
1028
  * @param {"content"|"padding"|"border"|"margin"} [extra='content'] - Box model context.
950
1029
  * @returns {number} - Computed dimension.
951
1030
  * @throws {TypeError} If `type` or `extra` is not a string.
952
1031
  */
953
- static getDimension(el: TinyElementAndWindow, type: "width" | "height", extra?: "content" | "padding" | "border" | "margin"): number;
1032
+ static getDimension(el: TinyElementAndWinAndDoc, type: "width" | "height", extra?: "content" | "padding" | "border" | "margin"): number;
954
1033
  /**
955
1034
  * Sets the height of the element.
956
1035
  * @param {TinyHtmlElement} el - Target element.
957
1036
  * @param {string|number} value - Height value.
958
1037
  * @throws {TypeError} If `value` is neither a string nor number.
1038
+ * @returns {TinyHtmlElement}
959
1039
  */
960
- static setHeight(el: TinyHtmlElement, value: string | number): void;
1040
+ static setHeight(el: TinyHtmlElement, value: string | number): TinyHtmlElement;
961
1041
  /**
962
1042
  * Sets the width of the element.
963
1043
  * @param {TinyHtmlElement} el - Target element.
964
1044
  * @param {string|number} value - Width value.
965
1045
  * @throws {TypeError} If `value` is neither a string nor number.
1046
+ * @returns {TinyHtmlElement}
966
1047
  */
967
- static setWidth(el: TinyHtmlElement, value: string | number): void;
1048
+ static setWidth(el: TinyHtmlElement, value: string | number): TinyHtmlElement;
968
1049
  /**
969
1050
  * Returns content box height.
970
- * @param {TinyElementAndWindow} el - Target element.
1051
+ * @param {TinyElementAndWinAndDoc} el - Target element.
971
1052
  * @returns {number}
972
1053
  */
973
- static height(el: TinyElementAndWindow): number;
1054
+ static height(el: TinyElementAndWinAndDoc): number;
974
1055
  /**
975
1056
  * Returns content box width.
976
- * @param {TinyElementAndWindow} el - Target element.
1057
+ * @param {TinyElementAndWinAndDoc} el - Target element.
977
1058
  * @returns {number}
978
1059
  */
979
- static width(el: TinyElementAndWindow): number;
1060
+ static width(el: TinyElementAndWinAndDoc): number;
980
1061
  /**
981
1062
  * Returns padding box height.
982
- * @param {TinyElementAndWindow} el - Target element.
1063
+ * @param {TinyElementAndWinAndDoc} el - Target element.
983
1064
  * @returns {number}
984
1065
  */
985
- static innerHeight(el: TinyElementAndWindow): number;
1066
+ static innerHeight(el: TinyElementAndWinAndDoc): number;
986
1067
  /**
987
1068
  * Returns padding box width.
988
- * @param {TinyElementAndWindow} el - Target element.
1069
+ * @param {TinyElementAndWinAndDoc} el - Target element.
989
1070
  * @returns {number}
990
1071
  */
991
- static innerWidth(el: TinyElementAndWindow): number;
1072
+ static innerWidth(el: TinyElementAndWinAndDoc): number;
992
1073
  /**
993
1074
  * Returns outer height of the element, optionally including margin.
994
- * @param {TinyElementAndWindow} el - Target element.
1075
+ * @param {TinyElementAndWinAndDoc} el - Target element.
995
1076
  * @param {boolean} [includeMargin=false] - Whether to include margin.
996
1077
  * @returns {number}
997
1078
  */
998
- static outerHeight(el: TinyElementAndWindow, includeMargin?: boolean): number;
1079
+ static outerHeight(el: TinyElementAndWinAndDoc, includeMargin?: boolean): number;
999
1080
  /**
1000
1081
  * Returns outer width of the element, optionally including margin.
1001
- * @param {TinyElementAndWindow} el - Target element.
1082
+ * @param {TinyElementAndWinAndDoc} el - Target element.
1002
1083
  * @param {boolean} [includeMargin=false] - Whether to include margin.
1003
1084
  * @returns {number}
1004
1085
  */
1005
- static outerWidth(el: TinyElementAndWindow, includeMargin?: boolean): number;
1086
+ static outerWidth(el: TinyElementAndWinAndDoc, includeMargin?: boolean): number;
1006
1087
  /**
1007
1088
  * Gets the offset of the element relative to the document.
1008
1089
  * @param {TinyElement} el - Target element.
@@ -1043,14 +1124,16 @@ declare class TinyHtml {
1043
1124
  * Sets the vertical scroll position.
1044
1125
  * @param {TinyElementAndWindow|TinyElementAndWindow[]} el - Element or window.
1045
1126
  * @param {number} value - Scroll top value.
1127
+ * @returns {TinyElementAndWindow|TinyElementAndWindow[]}
1046
1128
  */
1047
- static setScrollTop(el: TinyElementAndWindow | TinyElementAndWindow[], value: number): void;
1129
+ static setScrollTop(el: TinyElementAndWindow | TinyElementAndWindow[], value: number): TinyElementAndWindow | TinyElementAndWindow[];
1048
1130
  /**
1049
1131
  * Sets the horizontal scroll position.
1050
1132
  * @param {TinyElementAndWindow|TinyElementAndWindow[]} el - Element or window.
1051
1133
  * @param {number} value - Scroll left value.
1134
+ * @returns {TinyElementAndWindow|TinyElementAndWindow[]}
1052
1135
  */
1053
- static setScrollLeft(el: TinyElementAndWindow | TinyElementAndWindow[], value: number): void;
1136
+ static setScrollLeft(el: TinyElementAndWindow | TinyElementAndWindow[], value: number): TinyElementAndWindow | TinyElementAndWindow[];
1054
1137
  /**
1055
1138
  * Returns the total border width and individual sides from `border{Side}Width` CSS properties.
1056
1139
  *
@@ -1079,8 +1162,8 @@ declare class TinyHtml {
1079
1162
  * @returns {HtmlElBoxSides} - Total horizontal (x) and vertical (y) paddings, and each side individually.
1080
1163
  */
1081
1164
  static padding(el: TinyElement): HtmlElBoxSides;
1082
- static addClass(el: TinyElement | TinyElement[], ...tokens: string[]): void;
1083
- static removeClass(el: TinyElement | TinyElement[], ...tokens: string[]): void;
1165
+ static addClass(el: TinyElement | TinyElement[], ...tokens: string[]): (TinyElement | TinyElement[]);
1166
+ static removeClass(el: TinyElement | TinyElement[], ...tokens: string[]): (TinyElement | TinyElement[]);
1084
1167
  /**
1085
1168
  * Replaces an existing class name with a new one.
1086
1169
  * @param {TinyElement|TinyElement[]} el - Target element.
@@ -1149,25 +1232,29 @@ declare class TinyHtml {
1149
1232
  * Set text content of elements.
1150
1233
  * @param {TinyElement|TinyElement[]} el
1151
1234
  * @param {string} value
1235
+ * @returns {TinyElement|TinyElement[]}
1152
1236
  */
1153
- static setText(el: TinyElement | TinyElement[], value: string): void;
1237
+ static setText(el: TinyElement | TinyElement[], value: string): TinyElement | TinyElement[];
1154
1238
  /**
1155
1239
  * Remove all child nodes from each element.
1156
1240
  * @param {TinyElement|TinyElement[]} el
1241
+ * @returns {TinyElement|TinyElement[]}
1157
1242
  */
1158
- static empty(el: TinyElement | TinyElement[]): void;
1243
+ static empty(el: TinyElement | TinyElement[]): TinyElement | TinyElement[];
1159
1244
  /**
1160
1245
  * Get the innerHTML of the element.
1161
- * @param {TinyElement|TinyElement[]} el
1246
+ * @param {TinyElement} el
1247
+ * @param {GetHTMLOptions} [ops]
1162
1248
  * @returns {string}
1163
1249
  */
1164
- static html(el: TinyElement | TinyElement[]): string;
1250
+ static html(el: TinyElement, ops?: GetHTMLOptions): string;
1165
1251
  /**
1166
1252
  * Set the innerHTML of each element.
1167
1253
  * @param {TinyElement|TinyElement[]} el
1168
1254
  * @param {string} value
1255
+ * @returns {TinyElement|TinyElement[]}
1169
1256
  */
1170
- static setHtml(el: TinyElement | TinyElement[], value: string): void;
1257
+ static setHtml(el: TinyElement | TinyElement[], value: string): TinyElement | TinyElement[];
1171
1258
  /** @readonly */
1172
1259
  static readonly _valHooks: {
1173
1260
  option: {
@@ -1221,8 +1308,9 @@ declare class TinyHtml {
1221
1308
  * @param {TinyInputElement|TinyInputElement[]} el - Target element.
1222
1309
  * @param {SetValueList|((el: InputElement, val: SetValueList) => SetValueList)} value - The value to assign or a function that returns it.
1223
1310
  * @throws {Error} If the computed value is not a valid string or boolean.
1311
+ * @returns {TinyInputElement|TinyInputElement[]}
1224
1312
  */
1225
- static setVal(el: TinyInputElement | TinyInputElement[], value: SetValueList | ((el: InputElement, val: SetValueList) => SetValueList)): void;
1313
+ static setVal(el: TinyInputElement | TinyInputElement[], value: SetValueList | ((el: InputElement, val: SetValueList) => SetValueList)): TinyInputElement | TinyInputElement[];
1226
1314
  /**
1227
1315
  * Maps value types to their corresponding getter functions.
1228
1316
  * Each function extracts a value of a specific type from a compatible HTMLInputElement.
@@ -1340,8 +1428,9 @@ declare class TinyHtml {
1340
1428
  * @param {string} event - The event type (e.g. 'click', 'keydown').
1341
1429
  * @param {EventRegistryHandle} handler - The callback function to run on event.
1342
1430
  * @param {EventRegistryOptions} [options] - Optional event listener options.
1431
+ * @returns {TinyEventTarget|TinyEventTarget[]}
1343
1432
  */
1344
- static on(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): void;
1433
+ static on(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
1345
1434
  /**
1346
1435
  * Registers an event listener that runs only once, then is removed.
1347
1436
  *
@@ -1349,8 +1438,9 @@ declare class TinyHtml {
1349
1438
  * @param {string} event - The event type (e.g. 'click', 'keydown').
1350
1439
  * @param {EventRegistryHandle} handler - The callback function to run on event.
1351
1440
  * @param {EventRegistryOptions} [options={}] - Optional event listener options.
1441
+ * @returns {TinyEventTarget|TinyEventTarget[]}
1352
1442
  */
1353
- static once(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): void;
1443
+ static once(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
1354
1444
  /**
1355
1445
  * Removes a specific event listener from an element.
1356
1446
  *
@@ -1358,31 +1448,35 @@ declare class TinyHtml {
1358
1448
  * @param {string} event - The event type.
1359
1449
  * @param {EventRegistryHandle} handler - The function originally bound to the event.
1360
1450
  * @param {boolean|EventListenerOptions} [options] - Optional listener options.
1451
+ * @returns {TinyEventTarget|TinyEventTarget[]}
1361
1452
  */
1362
- static off(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventRegistryHandle, options?: boolean | EventListenerOptions): void;
1453
+ static off(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventRegistryHandle, options?: boolean | EventListenerOptions): TinyEventTarget | TinyEventTarget[];
1363
1454
  /**
1364
1455
  * Removes all event listeners of a specific type from the element.
1365
1456
  *
1366
1457
  * @param {TinyEventTarget|TinyEventTarget[]} el - The target element.
1367
1458
  * @param {string} event - The event type to remove (e.g. 'click').
1459
+ * @returns {TinyEventTarget|TinyEventTarget[]}
1368
1460
  */
1369
- static offAll(el: TinyEventTarget | TinyEventTarget[], event: string): void;
1461
+ static offAll(el: TinyEventTarget | TinyEventTarget[], event: string): TinyEventTarget | TinyEventTarget[];
1370
1462
  /**
1371
1463
  * Removes all event listeners of all types from the element.
1372
1464
  *
1373
1465
  * @param {TinyEventTarget|TinyEventTarget[]} el - The target element.
1374
1466
  * @param {((handler: EventListenerOrEventListenerObject, event: string) => boolean)|null} [filterFn=null] -
1375
1467
  * Optional filter function to selectively remove specific handlers.
1468
+ * @returns {TinyEventTarget|TinyEventTarget[]}
1376
1469
  */
1377
- static offAllTypes(el: TinyEventTarget | TinyEventTarget[], filterFn?: ((handler: EventListenerOrEventListenerObject, event: string) => boolean) | null): void;
1470
+ static offAllTypes(el: TinyEventTarget | TinyEventTarget[], filterFn?: ((handler: EventListenerOrEventListenerObject, event: string) => boolean) | null): TinyEventTarget | TinyEventTarget[];
1378
1471
  /**
1379
1472
  * Triggers all handlers associated with a specific event on the given element.
1380
1473
  *
1381
1474
  * @param {TinyEventTarget|TinyEventTarget[]} el - Target element where the event should be triggered.
1382
1475
  * @param {string} event - Name of the event to trigger.
1383
1476
  * @param {Event|CustomEvent|CustomEventInit} [payload] - Optional event object or data to pass.
1477
+ * @returns {TinyEventTarget|TinyEventTarget[]}
1384
1478
  */
1385
- static trigger(el: TinyEventTarget | TinyEventTarget[], event: string, payload?: Event | CustomEvent | CustomEventInit): void;
1479
+ static trigger(el: TinyEventTarget | TinyEventTarget[], event: string, payload?: Event | CustomEvent | CustomEventInit): TinyEventTarget | TinyEventTarget[];
1386
1480
  /**
1387
1481
  * Property name normalization similar to jQuery's propFix.
1388
1482
  * @readonly
@@ -1403,14 +1497,16 @@ declare class TinyHtml {
1403
1497
  * @param {TinyElement|TinyElement[]} el
1404
1498
  * @param {string} name
1405
1499
  * @param {string|null} [value=null]
1500
+ * @returns {TinyElement|TinyElement[]}
1406
1501
  */
1407
- static setAttr(el: TinyElement | TinyElement[], name: string, value?: string | null): void;
1502
+ static setAttr(el: TinyElement | TinyElement[], name: string, value?: string | null): TinyElement | TinyElement[];
1408
1503
  /**
1409
1504
  * Remove attribute(s) from an element.
1410
1505
  * @param {TinyElement|TinyElement[]} el
1411
1506
  * @param {string} name Space-separated list of attributes.
1507
+ * @returns {TinyElement|TinyElement[]}
1412
1508
  */
1413
- static removeAttr(el: TinyElement | TinyElement[], name: string): void;
1509
+ static removeAttr(el: TinyElement | TinyElement[], name: string): TinyElement | TinyElement[];
1414
1510
  /**
1415
1511
  * Check if an attribute exists on an element.
1416
1512
  * @param {TinyElement} el
@@ -1429,14 +1525,16 @@ declare class TinyHtml {
1429
1525
  * Set a property on an element.
1430
1526
  * @param {TinyElement|TinyElement[]} el
1431
1527
  * @param {string} name
1528
+ * @returns {TinyElement|TinyElement[]}
1432
1529
  */
1433
- static addProp(el: TinyElement | TinyElement[], name: string): void;
1530
+ static addProp(el: TinyElement | TinyElement[], name: string): TinyElement | TinyElement[];
1434
1531
  /**
1435
1532
  * Remove a property from an element.
1436
1533
  * @param {TinyElement|TinyElement[]} el
1437
1534
  * @param {string} name
1535
+ * @returns {TinyElement|TinyElement[]}
1438
1536
  */
1439
- static removeProp(el: TinyElement | TinyElement[], name: string): void;
1537
+ static removeProp(el: TinyElement | TinyElement[], name: string): TinyElement | TinyElement[];
1440
1538
  /**
1441
1539
  * Toggle a boolean property.
1442
1540
  * @param {TinyElement|TinyElement[]} el
@@ -1447,8 +1545,9 @@ declare class TinyHtml {
1447
1545
  /**
1448
1546
  * Removes an element from the DOM.
1449
1547
  * @param {TinyElement|TinyElement[]} el - The DOM element or selector to remove.
1548
+ * @returns {TinyElement|TinyElement[]}
1450
1549
  */
1451
- static remove(el: TinyElement | TinyElement[]): void;
1550
+ static remove(el: TinyElement | TinyElement[]): TinyElement | TinyElement[];
1452
1551
  /**
1453
1552
  * Returns the index of the first element within its parent or relative to a selector/element.
1454
1553
  *
@@ -1554,12 +1653,68 @@ declare class TinyHtml {
1554
1653
  * @returns {boolean} True if the element is fully visible in the viewport, false otherwise.
1555
1654
  */
1556
1655
  static isScrolledIntoView(el: TinyElement): boolean;
1656
+ /**
1657
+ * Checks if the given element is at least partially visible within the boundaries of a container.
1658
+ *
1659
+ * @param {TinyElement} el - The DOM element to check.
1660
+ * @param {TinyElement} cont - The container element acting as the viewport.
1661
+ * @returns {boolean} True if the element is partially visible within the container, false otherwise.
1662
+ */
1663
+ static isInContainer(el: TinyElement, cont: TinyElement): boolean;
1664
+ /**
1665
+ * Checks if the given element is fully visible within the boundaries of a container (top and bottom).
1666
+ *
1667
+ * @param {TinyElement} el - The DOM element to check.
1668
+ * @param {TinyElement} cont - The container element acting as the viewport.
1669
+ * @returns {boolean} True if the element is fully visible within the container, false otherwise.
1670
+ */
1671
+ static isFullyInContainer(el: TinyElement, cont: TinyElement): boolean;
1672
+ /**
1673
+ * Checks if an element has scrollable content.
1674
+ *
1675
+ * @param {TinyElement} el - The DOM element to check.
1676
+ * @returns {{ v: boolean, h: boolean }} - True if scroll is needed in that direction.
1677
+ */
1678
+ static hasScroll(el: TinyElement): {
1679
+ v: boolean;
1680
+ h: boolean;
1681
+ };
1557
1682
  /**
1558
1683
  * Creates an instance of TinyHtml for a specific Element.
1559
1684
  * Useful when you want to operate repeatedly on the same element using instance methods.
1560
1685
  * @param {ConstructorElValues} el - The element to wrap and manipulate.
1561
1686
  */
1562
1687
  constructor(el: ConstructorElValues);
1688
+ /**
1689
+ * Queries the element for the first element matching the CSS selector and wraps it in a TinyHtml instance.
1690
+ *
1691
+ * @param {string} selector - A valid CSS selector string.
1692
+ * @returns {TinyHtml|null} A TinyHtml instance wrapping the matched element.
1693
+ */
1694
+ querySelector(selector: string): TinyHtml | null;
1695
+ /**
1696
+ * Queries the element for all elements matching the CSS selector and wraps them in TinyHtml instances.
1697
+ *
1698
+ * @param {string} selector - A valid CSS selector string.
1699
+ * @returns {TinyHtml[]} An array of TinyHtml instances wrapping the matched elements.
1700
+ */
1701
+ querySelectorAll(selector: string): TinyHtml[];
1702
+ /**
1703
+ * Retrieves all elements with the specified class name and wraps them in TinyHtml instances.
1704
+ *
1705
+ * @param {string} selector - The class name to search for.
1706
+ * @returns {TinyHtml[]} An array of TinyHtml instances wrapping the found elements.
1707
+ */
1708
+ getElementsByClassName(selector: string): TinyHtml[];
1709
+ /**
1710
+ * Retrieves all elements with the specified local tag name within the given namespace URI,
1711
+ * and wraps them in TinyHtml instances.
1712
+ *
1713
+ * @param {string} localName - The local name (tag) of the elements to search for.
1714
+ * @param {string|null} [namespaceURI='http://www.w3.org/1999/xhtml'] - The namespace URI to search within.
1715
+ * @returns {TinyHtml[]} An array of TinyHtml instances wrapping the found elements.
1716
+ */
1717
+ getElementsByTagNameNS(localName: string, namespaceURI?: string | null): TinyHtml[];
1563
1718
  /**
1564
1719
  * Returns the current target held by this instance.
1565
1720
  *
@@ -1637,9 +1792,9 @@ declare class TinyHtml {
1637
1792
  * @param {string} key - The key under which the data will be stored.
1638
1793
  * @param {any} value - The value to store.
1639
1794
  * @param {boolean} [isPrivate=false] - Whether to store the data in the private store.
1640
- * @returns {void}
1795
+ * @returns {TinyElement}
1641
1796
  */
1642
- setData(key: string, value: any, isPrivate?: boolean): void;
1797
+ setData(key: string, value: any, isPrivate?: boolean): TinyElement;
1643
1798
  /**
1644
1799
  * Returns the direct parent node of the given element, excluding document fragments.
1645
1800
  *
@@ -1719,65 +1874,75 @@ declare class TinyHtml {
1719
1874
  * Appends child elements or strings to the end of the target element(s).
1720
1875
  *
1721
1876
  * @param {...(TinyNode | TinyNode[] | string)} children - The child elements or text to append.
1877
+ * @returns {TinyElement}
1722
1878
  */
1723
- append(...children: (TinyNode | TinyNode[] | string)[]): void;
1879
+ append(...children: (TinyNode | TinyNode[] | string)[]): TinyElement;
1724
1880
  /**
1725
1881
  * Prepends child elements or strings to the beginning of the target element(s).
1726
1882
  *
1727
1883
  * @param {...(TinyNode | TinyNode[] | string)} children - The child elements or text to prepend.
1884
+ * @returns {TinyElement}
1728
1885
  */
1729
- prepend(...children: (TinyNode | TinyNode[] | string)[]): void;
1886
+ prepend(...children: (TinyNode | TinyNode[] | string)[]): TinyElement;
1730
1887
  /**
1731
1888
  * Inserts elements or strings immediately before the target element(s) in the DOM.
1732
1889
  *
1733
1890
  * @param {...(TinyNode | TinyNode[] | string)} children - Elements or text to insert before the target.
1891
+ * @returns {TinyElement}
1734
1892
  */
1735
- before(...children: (TinyNode | TinyNode[] | string)[]): void;
1893
+ before(...children: (TinyNode | TinyNode[] | string)[]): TinyElement;
1736
1894
  /**
1737
1895
  * Inserts elements or strings immediately after the target element(s) in the DOM.
1738
1896
  *
1739
1897
  * @param {...(TinyNode | TinyNode[] | string)} children - Elements or text to insert after the target.
1898
+ * @returns {TinyElement}
1740
1899
  */
1741
- after(...children: (TinyNode | TinyNode[] | string)[]): void;
1900
+ after(...children: (TinyNode | TinyNode[] | string)[]): TinyElement;
1742
1901
  /**
1743
1902
  * Replaces the target element(s) in the DOM with new elements or text.
1744
1903
  *
1745
1904
  * @param {...(TinyNode | TinyNode[] | string)} newNodes - New elements or text to replace the target.
1905
+ * @returns {TinyElement}
1746
1906
  */
1747
- replaceWith(...newNodes: (TinyNode | TinyNode[] | string)[]): void;
1907
+ replaceWith(...newNodes: (TinyNode | TinyNode[] | string)[]): TinyElement;
1748
1908
  /**
1749
1909
  * Appends the given element(s) to each target element in sequence.
1750
1910
  *
1751
1911
  * @param {TinyNode | TinyNode[]} targets - Target element(s) where content will be appended.
1912
+ * @returns {TinyNode|TinyNode[]}
1752
1913
  */
1753
- appendTo(targets: TinyNode | TinyNode[]): void;
1914
+ appendTo(targets: TinyNode | TinyNode[]): TinyNode | TinyNode[];
1754
1915
  /**
1755
1916
  * Prepends the given element(s) to each target element in sequence.
1756
1917
  *
1757
1918
  * @param {TinyElement | TinyElement[]} targets - Target element(s) where content will be prepended.
1919
+ * @returns {TinyElement|TinyElement[]}
1758
1920
  */
1759
- prependTo(targets: TinyElement | TinyElement[]): void;
1921
+ prependTo(targets: TinyElement | TinyElement[]): TinyElement | TinyElement[];
1760
1922
  /**
1761
1923
  * Inserts the element before a child of a given target, or before the target itself.
1762
1924
  *
1763
1925
  * @param {TinyNode | TinyNode[]} target - The reference element where insertion happens.
1764
1926
  * @param {TinyNode | TinyNode[] | null} [child=null] - Optional child to insert before, defaults to target.
1927
+ * @returns {TinyNode|TinyNode[]}
1765
1928
  */
1766
- insertBefore(target: TinyNode | TinyNode[], child?: TinyNode | TinyNode[] | null): void;
1929
+ insertBefore(target: TinyNode | TinyNode[], child?: TinyNode | TinyNode[] | null): TinyNode | TinyNode[];
1767
1930
  /**
1768
1931
  * Inserts the element after a child of a given target, or after the target itself.
1769
1932
  *
1770
1933
  * @param {TinyNode | TinyNode[]} target - The reference element where insertion happens.
1771
1934
  * @param {TinyNode | TinyNode[] | null} [child=null] - Optional child to insert after, defaults to target.
1935
+ * @returns {TinyNode|TinyNode[]}
1772
1936
  */
1773
- insertAfter(target: TinyNode | TinyNode[], child?: TinyNode | TinyNode[] | null): void;
1937
+ insertAfter(target: TinyNode | TinyNode[], child?: TinyNode | TinyNode[] | null): TinyNode | TinyNode[];
1774
1938
  /**
1775
1939
  * Replaces all target elements with the provided element(s).
1776
1940
  * If multiple targets exist, the inserted elements are cloned accordingly.
1777
1941
  *
1778
1942
  * @param {TinyNode | TinyNode[]} targets - The elements to be replaced.
1943
+ * @returns {TinyNode|TinyNode[]}
1779
1944
  */
1780
- replaceAll(targets: TinyNode | TinyNode[]): void;
1945
+ replaceAll(targets: TinyNode | TinyNode[]): TinyNode | TinyNode[];
1781
1946
  /**
1782
1947
  * Returns the full computed CSS styles for the given element.
1783
1948
  *
@@ -1818,8 +1983,9 @@ declare class TinyHtml {
1818
1983
  *
1819
1984
  * @param {string|Object} prop - The property name or an object with key-value pairs
1820
1985
  * @param {string|null} [value=null] - The value to set (if `prop` is a string)
1986
+ * @returns {TinyHtmlElement|TinyHtmlElement[]}
1821
1987
  */
1822
- setStyle(prop: string | Object, value?: string | null): void;
1988
+ setStyle(prop: string | Object, value?: string | null): TinyHtmlElement | TinyHtmlElement[];
1823
1989
  /**
1824
1990
  * Gets the value of a specific inline style property.
1825
1991
  *
@@ -1847,8 +2013,9 @@ declare class TinyHtml {
1847
2013
  * Removes one or more inline CSS properties from the given element(s).
1848
2014
  *
1849
2015
  * @param {string|string[]} prop - A property name or an array of property names to remove.
2016
+ * @returns {TinyHtmlElement|TinyHtmlElement[]}
1850
2017
  */
1851
- removeStyle(prop: string | string[]): void;
2018
+ removeStyle(prop: string | string[]): TinyHtmlElement | TinyHtmlElement[];
1852
2019
  /**
1853
2020
  * Toggles a CSS property value between two given values.
1854
2021
  *
@@ -1857,21 +2024,24 @@ declare class TinyHtml {
1857
2024
  * @param {string} prop - The CSS property to toggle.
1858
2025
  * @param {string} val1 - The first value (used as "current" check).
1859
2026
  * @param {string} val2 - The second value (used as the "alternative").
2027
+ * @returns {TinyHtmlElement|TinyHtmlElement[]}
1860
2028
  */
1861
- toggleStyle(prop: string, val1: string, val2: string): void;
2029
+ toggleStyle(prop: string, val1: string, val2: string): TinyHtmlElement | TinyHtmlElement[];
1862
2030
  /**
1863
2031
  * Removes all inline styles (`style` attribute) from the given element(s).
1864
- *
2032
+ * @returns {TinyElement|TinyElement[]}
1865
2033
  */
1866
- clearStyle(): void;
2034
+ clearStyle(): TinyElement | TinyElement[];
1867
2035
  /**
1868
2036
  * Focus the element.
2037
+ * @returns {TinyHtmlElement}
1869
2038
  */
1870
- focus(): void;
2039
+ focus(): TinyHtmlElement;
1871
2040
  /**
1872
2041
  * Blur the element.
2042
+ * @returns {TinyHtmlElement}
1873
2043
  */
1874
- blur(): void;
2044
+ blur(): TinyHtmlElement;
1875
2045
  /**
1876
2046
  * Gets the width or height of an element based on the box model.
1877
2047
  * @param {"width"|"height"} type - Dimension type.
@@ -1882,13 +2052,15 @@ declare class TinyHtml {
1882
2052
  /**
1883
2053
  * Sets the height of the element.
1884
2054
  * @param {string|number} value - Height value.
2055
+ * @returns {TinyHtmlElement}
1885
2056
  */
1886
- setHeight(value: string | number): void;
2057
+ setHeight(value: string | number): TinyHtmlElement;
1887
2058
  /**
1888
2059
  * Sets the width of the element.
1889
2060
  * @param {string|number} value - Width value.
2061
+ * @returns {TinyHtmlElement}
1890
2062
  */
1891
- setWidth(value: string | number): void;
2063
+ setWidth(value: string | number): TinyHtmlElement;
1892
2064
  /**
1893
2065
  * Returns content box height.
1894
2066
  * @returns {number}
@@ -1955,13 +2127,15 @@ declare class TinyHtml {
1955
2127
  /**
1956
2128
  * Sets the vertical scroll position.
1957
2129
  * @param {number} value - Scroll top value.
2130
+ * @returns {TinyElementAndWindow|TinyElementAndWindow[]}
1958
2131
  */
1959
- setScrollTop(value: number): void;
2132
+ setScrollTop(value: number): TinyElementAndWindow | TinyElementAndWindow[];
1960
2133
  /**
1961
2134
  * Sets the horizontal scroll position.
1962
2135
  * @param {number} value - Scroll left value.
2136
+ * @returns {TinyElementAndWindow|TinyElementAndWindow[]}
1963
2137
  */
1964
- setScrollLeft(value: number): void;
2138
+ setScrollLeft(value: number): TinyElementAndWindow | TinyElementAndWindow[];
1965
2139
  /**
1966
2140
  * Returns the total border width and individual sides from `border{Side}Width` CSS properties.
1967
2141
  *
@@ -1986,8 +2160,8 @@ declare class TinyHtml {
1986
2160
  * @returns {HtmlElBoxSides} - Total horizontal (x) and vertical (y) paddings, and each side individually.
1987
2161
  */
1988
2162
  padding(): HtmlElBoxSides;
1989
- addClass(...tokens: string[]): void;
1990
- removeClass(...tokens: string[]): void;
2163
+ addClass(...tokens: string[]): (TinyElement | TinyElement[]);
2164
+ removeClass(...tokens: string[]): (TinyElement | TinyElement[]);
1991
2165
  /**
1992
2166
  * Replaces an existing class name with a new one.
1993
2167
  * @param {string} token - The class name to be replaced.
@@ -2046,30 +2220,35 @@ declare class TinyHtml {
2046
2220
  /**
2047
2221
  * Set text content of the element.
2048
2222
  * @param {string} value
2223
+ * @returns {TinyElement|TinyElement[]}
2049
2224
  */
2050
- setText(value: string): void;
2225
+ setText(value: string): TinyElement | TinyElement[];
2051
2226
  /**
2052
2227
  * Remove all child nodes of the element.
2228
+ * @returns {TinyElement|TinyElement[]}
2053
2229
  */
2054
- empty(): void;
2230
+ empty(): TinyElement | TinyElement[];
2055
2231
  /**
2056
2232
  * Get the innerHTML of the element.
2233
+ * @param {GetHTMLOptions} [ops]
2057
2234
  * @returns {string}
2058
2235
  */
2059
- html(): string;
2236
+ html(ops?: GetHTMLOptions): string;
2060
2237
  /**
2061
2238
  * Set the innerHTML of the element.
2062
2239
  * @param {string} value
2240
+ * @returns {TinyElement|TinyElement[]}
2063
2241
  */
2064
- setHtml(value: string): void;
2242
+ setHtml(value: string): TinyElement | TinyElement[];
2065
2243
  /**
2066
2244
  * Sets the value of the current HTML value element (input, select, textarea, etc.).
2067
2245
  * Accepts strings, numbers, booleans or arrays of these values, or a callback function that computes them.
2068
2246
  *
2069
2247
  * @param {SetValueList|((el: InputElement, val: SetValueList) => SetValueList)} value - The value to assign or a function that returns it.
2248
+ * @returns {TinyInputElement|TinyInputElement[]}
2070
2249
  * @throws {Error} If the computed value is not a valid string or boolean.
2071
2250
  */
2072
- setVal(value: SetValueList | ((el: InputElement, val: SetValueList) => SetValueList)): void;
2251
+ setVal(value: SetValueList | ((el: InputElement, val: SetValueList) => SetValueList)): TinyInputElement | TinyInputElement[];
2073
2252
  /**
2074
2253
  * Retrieves the raw value from the HTML input element.
2075
2254
  * If a custom value hook exists, it will be used first.
@@ -2137,44 +2316,50 @@ declare class TinyHtml {
2137
2316
  * @param {string} event - The event type (e.g. 'click', 'keydown').
2138
2317
  * @param {EventRegistryHandle} handler - The callback function to run on event.
2139
2318
  * @param {EventRegistryOptions} [options] - Optional event listener options.
2319
+ * @returns {TinyEventTarget|TinyEventTarget[]}
2140
2320
  */
2141
- on(event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): void;
2321
+ on(event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
2142
2322
  /**
2143
2323
  * Registers an event listener that runs only once, then is removed.
2144
2324
  *
2145
2325
  * @param {string} event - The event type (e.g. 'click', 'keydown').
2146
2326
  * @param {EventRegistryHandle} handler - The callback function to run on event.
2147
2327
  * @param {EventRegistryOptions} [options={}] - Optional event listener options.
2328
+ * @returns {TinyEventTarget|TinyEventTarget[]}
2148
2329
  */
2149
- once(event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): void;
2330
+ once(event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
2150
2331
  /**
2151
2332
  * Removes a specific event listener from an element.
2152
2333
  *
2153
2334
  * @param {string} event - The event type.
2154
2335
  * @param {EventRegistryHandle} handler - The function originally bound to the event.
2155
2336
  * @param {boolean|EventListenerOptions} [options] - Optional listener options.
2337
+ * @returns {TinyEventTarget|TinyEventTarget[]}
2156
2338
  */
2157
- off(event: string, handler: EventRegistryHandle, options?: boolean | EventListenerOptions): void;
2339
+ off(event: string, handler: EventRegistryHandle, options?: boolean | EventListenerOptions): TinyEventTarget | TinyEventTarget[];
2158
2340
  /**
2159
2341
  * Removes all event listeners of a specific type from the element.
2160
2342
  *
2161
2343
  * @param {string} event - The event type to remove (e.g. 'click').
2344
+ * @returns {TinyEventTarget|TinyEventTarget[]}
2162
2345
  */
2163
- offAll(event: string): void;
2346
+ offAll(event: string): TinyEventTarget | TinyEventTarget[];
2164
2347
  /**
2165
2348
  * Removes all event listeners of all types from the element.
2166
2349
  *
2167
2350
  * @param {((handler: EventListenerOrEventListenerObject, event: string) => boolean)|null} [filterFn=null] -
2168
2351
  * Optional filter function to selectively remove specific handlers.
2352
+ * @returns {TinyEventTarget|TinyEventTarget[]}
2169
2353
  */
2170
- offAllTypes(filterFn?: ((handler: EventListenerOrEventListenerObject, event: string) => boolean) | null): void;
2354
+ offAllTypes(filterFn?: ((handler: EventListenerOrEventListenerObject, event: string) => boolean) | null): TinyEventTarget | TinyEventTarget[];
2171
2355
  /**
2172
2356
  * Triggers all handlers associated with a specific event on the given element.
2173
2357
  *
2174
2358
  * @param {string} event - Name of the event to trigger.
2175
2359
  * @param {Event|CustomEvent|CustomEventInit} [payload] - Optional event object or data to pass.
2360
+ * @returns {TinyEventTarget|TinyEventTarget[]}
2176
2361
  */
2177
- trigger(event: string, payload?: Event | CustomEvent | CustomEventInit): void;
2362
+ trigger(event: string, payload?: Event | CustomEvent | CustomEventInit): TinyEventTarget | TinyEventTarget[];
2178
2363
  /**
2179
2364
  * Get an attribute on an element.
2180
2365
  * @param {string} name
@@ -2185,13 +2370,15 @@ declare class TinyHtml {
2185
2370
  * Set an attribute on an element.
2186
2371
  * @param {string} name
2187
2372
  * @param {string|null} [value=null]
2373
+ * @returns {TinyElement|TinyElement[]}
2188
2374
  */
2189
- setAttr(name: string, value?: string | null): void;
2375
+ setAttr(name: string, value?: string | null): TinyElement | TinyElement[];
2190
2376
  /**
2191
2377
  * Remove attribute(s) from an element.
2192
2378
  * @param {string} name Space-separated list of attributes.
2379
+ * @returns {TinyElement|TinyElement[]}
2193
2380
  */
2194
- removeAttr(name: string): void;
2381
+ removeAttr(name: string): TinyElement | TinyElement[];
2195
2382
  /**
2196
2383
  * Check if an attribute exists on an element.
2197
2384
  * @param {string} name
@@ -2207,13 +2394,15 @@ declare class TinyHtml {
2207
2394
  /**
2208
2395
  * Set a property on an element.
2209
2396
  * @param {string} name
2397
+ * @returns {TinyElement|TinyElement[]}
2210
2398
  */
2211
- addProp(name: string): void;
2399
+ addProp(name: string): TinyElement | TinyElement[];
2212
2400
  /**
2213
2401
  * Remove a property from an element.
2214
2402
  * @param {string} name
2403
+ * @returns {TinyElement|TinyElement[]}
2215
2404
  */
2216
- removeProp(name: string): void;
2405
+ removeProp(name: string): TinyElement | TinyElement[];
2217
2406
  /**
2218
2407
  * Toggle a boolean property.
2219
2408
  * @param {string} name
@@ -2222,8 +2411,9 @@ declare class TinyHtml {
2222
2411
  toggleProp(name: string, force?: boolean): void;
2223
2412
  /**
2224
2413
  * Removes the element from the DOM.
2414
+ * @returns {TinyElement|TinyElement[]}
2225
2415
  */
2226
- remove(): void;
2416
+ remove(): TinyElement | TinyElement[];
2227
2417
  /**
2228
2418
  * Returns the index of the first element within its parent or relative to a selector/element.
2229
2419
  *
@@ -2295,6 +2485,29 @@ declare class TinyHtml {
2295
2485
  * @returns {boolean} True if the element is fully visible in the viewport, false otherwise.
2296
2486
  */
2297
2487
  isScrolledIntoView(): boolean;
2488
+ /**
2489
+ * Checks if the given element is at least partially visible within the boundaries of a container.
2490
+ *
2491
+ * @param {TinyElement} cont - The container element acting as the viewport.
2492
+ * @returns {boolean} True if the element is partially visible within the container, false otherwise.
2493
+ */
2494
+ isInContainer(cont: TinyElement): boolean;
2495
+ /**
2496
+ * Checks if the given element is fully visible within the boundaries of a container (top and bottom).
2497
+ *
2498
+ * @param {TinyElement} cont - The container element acting as the viewport.
2499
+ * @returns {boolean} True if the element is fully visible within the container, false otherwise.
2500
+ */
2501
+ isFullyInContainer(cont: TinyElement): boolean;
2502
+ /**
2503
+ * Checks if an element has scrollable content.
2504
+ *
2505
+ * @returns {{ v: boolean, h: boolean }} - True if scroll is needed in that direction.
2506
+ */
2507
+ hasScroll(): {
2508
+ v: boolean;
2509
+ h: boolean;
2510
+ };
2298
2511
  #private;
2299
2512
  }
2300
2513
  import * as TinyCollision from '../basics/collision.mjs';