tiny-essentials 1.17.0 → 1.18.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 (39) hide show
  1. package/dist/v1/TinyBasicsEs.js +336 -45
  2. package/dist/v1/TinyBasicsEs.min.js +1 -1
  3. package/dist/v1/TinyClipboard.js +459 -0
  4. package/dist/v1/TinyClipboard.min.js +1 -0
  5. package/dist/v1/TinyDragger.js +336 -45
  6. package/dist/v1/TinyDragger.min.js +1 -1
  7. package/dist/v1/TinyEssentials.js +1218 -45
  8. package/dist/v1/TinyEssentials.min.js +1 -1
  9. package/dist/v1/TinyHtml.js +336 -45
  10. package/dist/v1/TinyHtml.min.js +1 -1
  11. package/dist/v1/TinySmartScroller.js +336 -45
  12. package/dist/v1/TinySmartScroller.min.js +1 -1
  13. package/dist/v1/TinyTextRangeEditor.js +497 -0
  14. package/dist/v1/TinyTextRangeEditor.min.js +1 -0
  15. package/dist/v1/TinyUploadClicker.js +338 -45
  16. package/dist/v1/TinyUploadClicker.min.js +1 -1
  17. package/dist/v1/build/TinyClipboard.cjs +7 -0
  18. package/dist/v1/build/TinyClipboard.d.mts +3 -0
  19. package/dist/v1/build/TinyClipboard.mjs +2 -0
  20. package/dist/v1/build/TinyTextRangeEditor.cjs +7 -0
  21. package/dist/v1/build/TinyTextRangeEditor.d.mts +3 -0
  22. package/dist/v1/build/TinyTextRangeEditor.mjs +2 -0
  23. package/dist/v1/index.cjs +4 -0
  24. package/dist/v1/index.d.mts +3 -1
  25. package/dist/v1/index.mjs +3 -1
  26. package/dist/v1/libs/TinyClipboard.cjs +420 -0
  27. package/dist/v1/libs/TinyClipboard.d.mts +155 -0
  28. package/dist/v1/libs/TinyClipboard.mjs +398 -0
  29. package/dist/v1/libs/TinyHtml.cjs +336 -45
  30. package/dist/v1/libs/TinyHtml.d.mts +238 -27
  31. package/dist/v1/libs/TinyHtml.mjs +320 -47
  32. package/dist/v1/libs/TinyTextRangeEditor.cjs +458 -0
  33. package/dist/v1/libs/TinyTextRangeEditor.d.mts +200 -0
  34. package/dist/v1/libs/TinyTextRangeEditor.mjs +424 -0
  35. package/docs/v1/README.md +2 -0
  36. package/docs/v1/libs/TinyClipboard.md +213 -0
  37. package/docs/v1/libs/TinyHtml.md +211 -15
  38. package/docs/v1/libs/TinyTextRangeEditor.md +208 -0
  39. package/package.json +1 -1
@@ -1,4 +1,18 @@
1
1
  export default TinyHtml;
2
+ /**
3
+ * Callback invoked on each animation frame with the current scroll position,
4
+ * normalized animation time (`0` to `1`), and a completion flag.
5
+ */
6
+ export type OnScrollAnimation = (progress: {
7
+ x: number;
8
+ y: number;
9
+ isComplete: boolean;
10
+ time: number;
11
+ }) => void;
12
+ /**
13
+ * A list of supported easing function names for smooth animations.
14
+ */
15
+ export type Easings = "linear" | "easeInQuad" | "easeOutQuad" | "easeInOutQuad" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic";
2
16
  /**
3
17
  * Represents a raw Node element or an instance of TinyHtml.
4
18
  * This type is used to abstract interactions with both plain elements
@@ -51,6 +65,17 @@ export type TinyElementAndWinAndDoc = ElementAndWinAndDoc | TinyHtml;
51
65
  * Useful for functions that operate generically on scrollable or measurable targets.
52
66
  */
53
67
  export type ElementAndWinAndDoc = Element | Window | Document;
68
+ /**
69
+ * Represents a raw DOM element with document or an instance of TinyHtml.
70
+ * This type is used to abstract interactions with both plain elements
71
+ * and wrapped elements via the TinyHtml class.
72
+ */
73
+ export type TinyElementWithDoc = ElementWithDoc | TinyHtml;
74
+ /**
75
+ * Represents a value that can be either a DOM Element, or the document object.
76
+ * Useful for functions that operate generically on measurable targets.
77
+ */
78
+ export type ElementWithDoc = Element | Document;
54
79
  /**
55
80
  * A parameter type used for filtering or matching elements.
56
81
  * It can be:
@@ -66,10 +91,6 @@ export type WinnowRequest = string | Element | Element[] | ((index: number, el:
66
91
  * These include common DOM elements and root containers.
67
92
  */
68
93
  export type ConstructorElValues = Window | Element | Document | Text;
69
- /**
70
- * The handler function used in event listeners.
71
- */
72
- export type EventRegistryHandle = (e: Event) => any;
73
94
  /**
74
95
  * Options passed to `addEventListener` or `removeEventListener`.
75
96
  * Can be a boolean or an object of type `AddEventListenerOptions`.
@@ -82,7 +103,7 @@ export type EventRegistryItem = {
82
103
  /**
83
104
  * - The function to be executed when the event is triggered.
84
105
  */
85
- handler: EventRegistryHandle;
106
+ handler: EventListenerOrEventListenerObject | null;
86
107
  /**
87
108
  * - Optional configuration passed to the listener.
88
109
  */
@@ -201,8 +222,41 @@ declare class TinyHtml {
201
222
  areElsCollPerfRight: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
202
223
  areElsColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
203
224
  areElsPerfColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => boolean;
204
- getElsColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => string | null;
205
- getElsPerfColliding: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => "top" | "bottom" | "left" | "right" | null;
225
+ getElsColliding: (
226
+ /**
227
+ * @typedef {'string' | 'date' | 'number'} GetValueTypes
228
+ * Types of value extractors supported by TinyHtml._valTypes.
229
+ */
230
+ /**
231
+ * @typedef {SetValueBase|SetValueBase[]} SetValueList - A single value or an array of values to be assigned to the input element.
232
+ */
233
+ /**
234
+ * A list of HTML form elements that can have a `.value` property used by TinyHtml.
235
+ * Includes common input types used in forms.
236
+ *
237
+ * @typedef {HTMLInputElement|HTMLSelectElement|HTMLTextAreaElement|HTMLOptionElement} InputElement
238
+ */
239
+ /**
240
+ * TinyHtml is a utility class that provides static and instance-level methods
241
+ * for precise dimension and position computations on HTML elements.
242
+ * It mimics some jQuery functionalities while using native browser APIs.
243
+ *
244
+ * Inspired by the jQuery project's open source implementations of element dimension
245
+ * and offset utilities. This class serves as a lightweight alternative using modern DOM APIs.
246
+ *
247
+ * @class
248
+ */
249
+ rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => string | null;
250
+ getElsPerfColliding: (rect1: TinyCollision.ObjRect /**
251
+ * TinyHtml is a utility class that provides static and instance-level methods
252
+ * for precise dimension and position computations on HTML elements.
253
+ * It mimics some jQuery functionalities while using native browser APIs.
254
+ *
255
+ * Inspired by the jQuery project's open source implementations of element dimension
256
+ * and offset utilities. This class serves as a lightweight alternative using modern DOM APIs.
257
+ *
258
+ * @class
259
+ */, rect2: TinyCollision.ObjRect) => "top" | "bottom" | "left" | "right" | null;
206
260
  getElsCollOverlap: (rect1: TinyCollision.ObjRect, rect2: TinyCollision.ObjRect) => {
207
261
  overlapLeft: number;
208
262
  overlapRight: number;
@@ -453,9 +507,9 @@ declare class TinyHtml {
453
507
  * Ensures the input is returned as an array.
454
508
  * Useful to normalize operations across multiple or single element/window/document elements.
455
509
  *
456
- * @param {TinyElementAndWinAndDoc|TinyElementAndWinAndDoc[]} elems - A single element/window element or array of html elements.
510
+ * @param {TinyElementAndWinAndDoc|TinyElementAndWinAndDoc[]} elems - A single element/document/window element or array of html elements.
457
511
  * @param {string} where - The method or context name where validation is being called.
458
- * @returns {ElementAndWindow[]} - Always returns an array of element/window elements.
512
+ * @returns {ElementAndWindow[]} - Always returns an array of element/document/window elements.
459
513
  * @readonly
460
514
  */
461
515
  static readonly _preElemsAndWinAndDoc(elems: TinyElementAndWinAndDoc | TinyElementAndWinAndDoc[], where: string): ElementAndWindow[];
@@ -463,12 +517,32 @@ declare class TinyHtml {
463
517
  * Ensures the input is returned as an single element/window/document element.
464
518
  * Useful to normalize operations across multiple or single element/window/document elements.
465
519
  *
466
- * @param {TinyElementAndWinAndDoc|TinyElementAndWinAndDoc[]} elems - A single element/window element or array of html elements.
520
+ * @param {TinyElementAndWinAndDoc|TinyElementAndWinAndDoc[]} elems - A single element/document/window element or array of html elements.
467
521
  * @param {string} where - The method or context name where validation is being called.
468
- * @returns {ElementAndWindow} - Always returns an single element/window element.
522
+ * @returns {ElementAndWindow} - Always returns an single element/document/window element.
469
523
  * @readonly
470
524
  */
471
525
  static readonly _preElemAndWinAndDoc(elems: TinyElementAndWinAndDoc | TinyElementAndWinAndDoc[], where: string): ElementAndWindow;
526
+ /**
527
+ * Ensures the input is returned as an array.
528
+ * Useful to normalize operations across multiple or single element with document elements.
529
+ *
530
+ * @param {TinyElementWithDoc|TinyElementWithDoc[]} elems - A single element with document element or array of html elements.
531
+ * @param {string} where - The method or context name where validation is being called.
532
+ * @returns {ElementWithDoc[]} - Always returns an array of element with document elements.
533
+ * @readonly
534
+ */
535
+ static readonly _preElemsWithDoc(elems: TinyElementWithDoc | TinyElementWithDoc[], where: string): ElementWithDoc[];
536
+ /**
537
+ * Ensures the input is returned as an single element with document element.
538
+ * Useful to normalize operations across multiple or single element with document elements.
539
+ *
540
+ * @param {TinyElementWithDoc|TinyElementWithDoc[]} elems - A single element/window element or array of html elements.
541
+ * @param {string} where - The method or context name where validation is being called.
542
+ * @returns {ElementWithDoc} - Always returns an single element/window element.
543
+ * @readonly
544
+ */
545
+ static readonly _preElemWithDoc(elems: TinyElementWithDoc | TinyElementWithDoc[], where: string): ElementWithDoc;
472
546
  /**
473
547
  * Normalizes and converts one or more DOM elements (or TinyHtml instances)
474
548
  * into an array of `TinyHtml` instances.
@@ -1084,6 +1158,15 @@ declare class TinyHtml {
1084
1158
  * @returns {number}
1085
1159
  */
1086
1160
  static outerWidth(el: TinyElementAndWinAndDoc, includeMargin?: boolean): number;
1161
+ /**
1162
+ * Applies an animation to one or multiple TinyElement instances.
1163
+ *
1164
+ * @param {TinyElement|TinyElement[]} el - A single TinyElement or an array of TinyElements to animate.
1165
+ * @param {Keyframe[] | PropertyIndexedKeyframes | null} keyframes - The keyframes used to define the animation.
1166
+ * @param {number | KeyframeAnimationOptions} [ops] - Timing or configuration options for the animation.
1167
+ * @returns {TinyElement|TinyElement[]}
1168
+ */
1169
+ static animate(el: TinyElement | TinyElement[], keyframes: Keyframe[] | PropertyIndexedKeyframes | null, ops?: number | KeyframeAnimationOptions): TinyElement | TinyElement[];
1087
1170
  /**
1088
1171
  * Gets the offset of the element relative to the document.
1089
1172
  * @param {TinyElement} el - Target element.
@@ -1120,6 +1203,41 @@ declare class TinyHtml {
1120
1203
  * @returns {number}
1121
1204
  */
1122
1205
  static scrollLeft(el: TinyElementAndWindow): number;
1206
+ /**
1207
+ * Collection of easing functions used for scroll and animation calculations.
1208
+ * Each function receives a normalized time value (`t` from 0 to 1) and returns the eased progress.
1209
+ *
1210
+ * @type {Record<string, (t: number) => number>}
1211
+ */
1212
+ static easings: Record<string, (t: number) => number>;
1213
+ /**
1214
+ * Smoothly scrolls one or more elements (or the window) to the specified X and Y coordinates
1215
+ * using a custom duration and easing function.
1216
+ *
1217
+ * If `duration` or a valid `easing` is not provided, the scroll will be performed immediately.
1218
+ *
1219
+ * @param {TinyElementAndWindow | TinyElementAndWindow[]} el - A single element, array of elements, or the window to scroll.
1220
+ * @param {Object} [settings={}] - Configuration object for the scroll animation.
1221
+ * @param {number} [settings.targetX] - The horizontal scroll target in pixels.
1222
+ * @param {number} [settings.targetY] - The vertical scroll target in pixels.
1223
+ * @param {number} [settings.duration] - The duration of the animation in milliseconds.
1224
+ * @param {Easings} [settings.easing] - The easing function name to use for the scroll animation.
1225
+ * @param {OnScrollAnimation} [settings.onAnimation] - Optional callback invoked on each animation
1226
+ * frame with the current scroll position, normalized animation time (`0` to `1`), and a completion flag.
1227
+ * @returns {TinyElementAndWindow|TinyElementAndWindow[]}
1228
+ * @throws {TypeError} If `el` is not a valid element, array, or window.
1229
+ * @throws {TypeError} If `targetX` or `targetY` is defined but not a number.
1230
+ * @throws {TypeError} If `duration` is defined but not a number.
1231
+ * @throws {TypeError} If `easing` is defined but not a valid easing function name.
1232
+ * @throws {TypeError} If `onAnimation` is defined but not a function.
1233
+ */
1234
+ static scrollToXY(el: TinyElementAndWindow | TinyElementAndWindow[], { targetX, targetY, duration, easing, onAnimation }?: {
1235
+ targetX?: number | undefined;
1236
+ targetY?: number | undefined;
1237
+ duration?: number | undefined;
1238
+ easing?: Easings | undefined;
1239
+ onAnimation?: OnScrollAnimation | undefined;
1240
+ }): TinyElementAndWindow | TinyElementAndWindow[];
1123
1241
  /**
1124
1242
  * Sets the vertical scroll position.
1125
1243
  * @param {TinyElementAndWindow|TinyElementAndWindow[]} el - Element or window.
@@ -1421,36 +1539,69 @@ declare class TinyHtml {
1421
1539
  * @throws {Error} If the element is not a checkbox/radio input.
1422
1540
  */
1423
1541
  static valBool(el: TinyInputElement): boolean;
1542
+ /**
1543
+ * Registers a listener for the "paste" event to extract files and text from the clipboard (e.g., when the user presses Ctrl+V).
1544
+ *
1545
+ * This method allows reacting to pasted content by providing separate callbacks for files and plain text.
1546
+ * Useful for building file upload areas, rich-text editors, or input enhancements.
1547
+ *
1548
+ * @param {TinyElementWithDoc|TinyElementWithDoc[]} el - The target element(s) where the "paste" event will be listened.
1549
+ * @param {Object} [settings={}] - Optional callbacks to handle clipboard content.
1550
+ * @param {(data: DataTransferItem, file: File) => void} [settings.onFilePaste] - Called for each file pasted from the clipboard (e.g., images).
1551
+ * @param {(data: DataTransferItem, text: string) => void} [settings.onTextPaste] - Called when plain text is pasted from the clipboard.
1552
+ * @returns {EventListenerOrEventListenerObject} The internal "paste" event handler used.
1553
+ */
1554
+ static listenForPaste(el: TinyElementWithDoc | TinyElementWithDoc[], { onFilePaste, onTextPaste }?: {
1555
+ onFilePaste?: ((data: DataTransferItem, file: File) => void) | undefined;
1556
+ onTextPaste?: ((data: DataTransferItem, text: string) => void) | undefined;
1557
+ }): EventListenerOrEventListenerObject;
1558
+ /**
1559
+ * Checks if the element has a listener for a specific event.
1560
+ *
1561
+ * @param {TinyEventTarget} el - The element to check.
1562
+ * @param {string} event - The event name to check.
1563
+ * @returns {boolean}
1564
+ */
1565
+ static hasEventListener(el: TinyEventTarget, event: string): boolean;
1566
+ /**
1567
+ * Checks if the element has the exact handler registered for a specific event.
1568
+ *
1569
+ * @param {TinyEventTarget} el - The element to check.
1570
+ * @param {string} event - The event name to check.
1571
+ * @param {EventListenerOrEventListenerObject} handler - The handler function to check.
1572
+ * @returns {boolean}
1573
+ */
1574
+ static hasExactEventListener(el: TinyEventTarget, event: string, handler: EventListenerOrEventListenerObject): boolean;
1424
1575
  /**
1425
1576
  * Registers an event listener on the specified element.
1426
1577
  *
1427
1578
  * @param {TinyEventTarget|TinyEventTarget[]} el - The target to listen on.
1428
1579
  * @param {string} event - The event type (e.g. 'click', 'keydown').
1429
- * @param {EventRegistryHandle} handler - The callback function to run on event.
1580
+ * @param {EventListenerOrEventListenerObject|null} handler - The callback function to run on event.
1430
1581
  * @param {EventRegistryOptions} [options] - Optional event listener options.
1431
1582
  * @returns {TinyEventTarget|TinyEventTarget[]}
1432
1583
  */
1433
- static on(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
1584
+ static on(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventListenerOrEventListenerObject | null, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
1434
1585
  /**
1435
1586
  * Registers an event listener that runs only once, then is removed.
1436
1587
  *
1437
1588
  * @param {TinyEventTarget|TinyEventTarget[]} el - The target to listen on.
1438
1589
  * @param {string} event - The event type (e.g. 'click', 'keydown').
1439
- * @param {EventRegistryHandle} handler - The callback function to run on event.
1590
+ * @param {EventListenerOrEventListenerObject} handler - The callback function to run on event.
1440
1591
  * @param {EventRegistryOptions} [options={}] - Optional event listener options.
1441
1592
  * @returns {TinyEventTarget|TinyEventTarget[]}
1442
1593
  */
1443
- static once(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
1594
+ static once(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventListenerOrEventListenerObject, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
1444
1595
  /**
1445
1596
  * Removes a specific event listener from an element.
1446
1597
  *
1447
1598
  * @param {TinyEventTarget|TinyEventTarget[]} el - The target element.
1448
1599
  * @param {string} event - The event type.
1449
- * @param {EventRegistryHandle} handler - The function originally bound to the event.
1600
+ * @param {EventListenerOrEventListenerObject|null} handler - The function originally bound to the event.
1450
1601
  * @param {boolean|EventListenerOptions} [options] - Optional listener options.
1451
1602
  * @returns {TinyEventTarget|TinyEventTarget[]}
1452
1603
  */
1453
- static off(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventRegistryHandle, options?: boolean | EventListenerOptions): TinyEventTarget | TinyEventTarget[];
1604
+ static off(el: TinyEventTarget | TinyEventTarget[], event: string, handler: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): TinyEventTarget | TinyEventTarget[];
1454
1605
  /**
1455
1606
  * Removes all event listeners of a specific type from the element.
1456
1607
  *
@@ -1463,11 +1614,11 @@ declare class TinyHtml {
1463
1614
  * Removes all event listeners of all types from the element.
1464
1615
  *
1465
1616
  * @param {TinyEventTarget|TinyEventTarget[]} el - The target element.
1466
- * @param {((handler: EventListenerOrEventListenerObject, event: string) => boolean)|null} [filterFn=null] -
1617
+ * @param {((handler: EventListenerOrEventListenerObject|null, event: string) => boolean)|null} [filterFn=null] -
1467
1618
  * Optional filter function to selectively remove specific handlers.
1468
1619
  * @returns {TinyEventTarget|TinyEventTarget[]}
1469
1620
  */
1470
- static offAllTypes(el: TinyEventTarget | TinyEventTarget[], filterFn?: ((handler: EventListenerOrEventListenerObject, event: string) => boolean) | null): TinyEventTarget | TinyEventTarget[];
1621
+ static offAllTypes(el: TinyEventTarget | TinyEventTarget[], filterFn?: ((handler: EventListenerOrEventListenerObject | null, event: string) => boolean) | null): TinyEventTarget | TinyEventTarget[];
1471
1622
  /**
1472
1623
  * Triggers all handlers associated with a specific event on the given element.
1473
1624
  *
@@ -2093,6 +2244,14 @@ declare class TinyHtml {
2093
2244
  * @returns {number}
2094
2245
  */
2095
2246
  outerWidth(includeMargin?: boolean): number;
2247
+ /**
2248
+ * Applies an animation to one or multiple TinyElement instances.
2249
+ *
2250
+ * @param {Keyframe[] | PropertyIndexedKeyframes | null} keyframes - The keyframes used to define the animation.
2251
+ * @param {number | KeyframeAnimationOptions} [ops] - Timing or configuration options for the animation.
2252
+ * @returns {TinyElement|TinyElement[]}
2253
+ */
2254
+ animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, ops?: number | KeyframeAnimationOptions): TinyElement | TinyElement[];
2096
2255
  /**
2097
2256
  * Gets the offset of the element relative to the document.
2098
2257
  * @returns {{top: number, left: number}}
@@ -2124,6 +2283,28 @@ declare class TinyHtml {
2124
2283
  * @returns {number}
2125
2284
  */
2126
2285
  scrollLeft(): number;
2286
+ /**
2287
+ * Smoothly scrolls one or more elements (or the window) to the specified X and Y coordinates
2288
+ * using a custom duration and easing function.
2289
+ *
2290
+ * If `duration` or a valid `easing` is not provided, the scroll will be performed immediately.
2291
+ *
2292
+ * @param {Object} [settings={}] - Configuration object for the scroll animation.
2293
+ * @param {number} [settings.targetX] - The horizontal scroll target in pixels.
2294
+ * @param {number} [settings.targetY] - The vertical scroll target in pixels.
2295
+ * @param {number} [settings.duration] - The duration of the animation in milliseconds.
2296
+ * @param {Easings} [settings.easing] - The easing function name to use for the scroll animation.
2297
+ * @param {OnScrollAnimation} [settings.onAnimation] - Optional callback invoked on each animation
2298
+ * frame with the current scroll position, normalized animation time (`0` to `1`), and a completion flag.
2299
+ * @returns {TinyElementAndWindow|TinyElementAndWindow[]}
2300
+ */
2301
+ scrollToXY({ targetX, targetY, duration, easing, onAnimation }?: {
2302
+ targetX?: number | undefined;
2303
+ targetY?: number | undefined;
2304
+ duration?: number | undefined;
2305
+ easing?: Easings | undefined;
2306
+ onAnimation?: OnScrollAnimation | undefined;
2307
+ }): TinyElementAndWindow | TinyElementAndWindow[];
2127
2308
  /**
2128
2309
  * Sets the vertical scroll position.
2129
2310
  * @param {number} value - Scroll top value.
@@ -2310,33 +2491,63 @@ declare class TinyHtml {
2310
2491
  * @throws {Error} If the element is not a checkbox/radio input.
2311
2492
  */
2312
2493
  valBool(): boolean;
2494
+ /**
2495
+ * Registers a listener for the "paste" event to extract files and text from the clipboard (e.g., when the user presses Ctrl+V).
2496
+ *
2497
+ * This method allows reacting to pasted content by providing separate callbacks for files and plain text.
2498
+ * Useful for building file upload areas, rich-text editors, or input enhancements.
2499
+ *
2500
+ * @param {Object} [settings={}] - Optional callbacks to handle clipboard content.
2501
+ * @param {(data: DataTransferItem, file: File) => void} [settings.onFilePaste] - Called for each file pasted from the clipboard (e.g., images).
2502
+ * @param {(data: DataTransferItem, text: string) => void} [settings.onTextPaste] - Called when plain text is pasted from the clipboard.
2503
+ * @returns {EventListenerOrEventListenerObject} The internal "paste" event handler used.
2504
+ */
2505
+ listenForPaste({ onFilePaste, onTextPaste }?: {
2506
+ onFilePaste?: ((data: DataTransferItem, file: File) => void) | undefined;
2507
+ onTextPaste?: ((data: DataTransferItem, text: string) => void) | undefined;
2508
+ }): EventListenerOrEventListenerObject;
2509
+ /**
2510
+ * Checks if the element has a listener for a specific event.
2511
+ *
2512
+ * @param {string} event - The event name to check.
2513
+ * @returns {boolean}
2514
+ */
2515
+ hasEventListener(event: string): boolean;
2516
+ /**
2517
+ * Checks if the element has the exact handler registered for a specific event.
2518
+ *
2519
+ * @param {string} event - The event name to check.
2520
+ * @param {EventListenerOrEventListenerObject} handler - The handler function to check.
2521
+ * @returns {boolean}
2522
+ */
2523
+ hasExactEventListener(event: string, handler: EventListenerOrEventListenerObject): boolean;
2313
2524
  /**
2314
2525
  * Registers an event listener on the specified element.
2315
2526
  *
2316
2527
  * @param {string} event - The event type (e.g. 'click', 'keydown').
2317
- * @param {EventRegistryHandle} handler - The callback function to run on event.
2528
+ * @param {EventListenerOrEventListenerObject|null} handler - The callback function to run on event.
2318
2529
  * @param {EventRegistryOptions} [options] - Optional event listener options.
2319
2530
  * @returns {TinyEventTarget|TinyEventTarget[]}
2320
2531
  */
2321
- on(event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
2532
+ on(event: string, handler: EventListenerOrEventListenerObject | null, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
2322
2533
  /**
2323
2534
  * Registers an event listener that runs only once, then is removed.
2324
2535
  *
2325
2536
  * @param {string} event - The event type (e.g. 'click', 'keydown').
2326
- * @param {EventRegistryHandle} handler - The callback function to run on event.
2537
+ * @param {EventListenerOrEventListenerObject} handler - The callback function to run on event.
2327
2538
  * @param {EventRegistryOptions} [options={}] - Optional event listener options.
2328
2539
  * @returns {TinyEventTarget|TinyEventTarget[]}
2329
2540
  */
2330
- once(event: string, handler: EventRegistryHandle, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
2541
+ once(event: string, handler: EventListenerOrEventListenerObject, options?: EventRegistryOptions): TinyEventTarget | TinyEventTarget[];
2331
2542
  /**
2332
2543
  * Removes a specific event listener from an element.
2333
2544
  *
2334
2545
  * @param {string} event - The event type.
2335
- * @param {EventRegistryHandle} handler - The function originally bound to the event.
2546
+ * @param {EventListenerOrEventListenerObject|null} handler - The function originally bound to the event.
2336
2547
  * @param {boolean|EventListenerOptions} [options] - Optional listener options.
2337
2548
  * @returns {TinyEventTarget|TinyEventTarget[]}
2338
2549
  */
2339
- off(event: string, handler: EventRegistryHandle, options?: boolean | EventListenerOptions): TinyEventTarget | TinyEventTarget[];
2550
+ off(event: string, handler: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): TinyEventTarget | TinyEventTarget[];
2340
2551
  /**
2341
2552
  * Removes all event listeners of a specific type from the element.
2342
2553
  *
@@ -2347,11 +2558,11 @@ declare class TinyHtml {
2347
2558
  /**
2348
2559
  * Removes all event listeners of all types from the element.
2349
2560
  *
2350
- * @param {((handler: EventListenerOrEventListenerObject, event: string) => boolean)|null} [filterFn=null] -
2561
+ * @param {((handler: EventListenerOrEventListenerObject|null, event: string) => boolean)|null} [filterFn=null] -
2351
2562
  * Optional filter function to selectively remove specific handlers.
2352
2563
  * @returns {TinyEventTarget|TinyEventTarget[]}
2353
2564
  */
2354
- offAllTypes(filterFn?: ((handler: EventListenerOrEventListenerObject, event: string) => boolean) | null): TinyEventTarget | TinyEventTarget[];
2565
+ offAllTypes(filterFn?: ((handler: EventListenerOrEventListenerObject | null, event: string) => boolean) | null): TinyEventTarget | TinyEventTarget[];
2355
2566
  /**
2356
2567
  * Triggers all handlers associated with a specific event on the given element.
2357
2568
  *