@thednp/shorty 2.0.6 → 2.0.7

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.
package/dist/shorty.d.ts CHANGED
@@ -1,1720 +1,2033 @@
1
- /**
2
- * A global namespace for aria-checked.
3
- */
4
- export declare const ariaChecked = "aria-checked";
5
- /**
6
- * A global namespace for aria-description.
7
- */
8
- export declare const ariaDescription = "aria-description";
9
- /**
10
- * A global namespace for aria-describedby.
11
- */
12
- export declare const ariaDescribedBy = "aria-describedby";
13
- /**
14
- * A global namespace for aria-expanded.
15
- */
16
- export declare const ariaExpanded = "aria-expanded";
17
- /**
18
- * A global namespace for aria-haspopup.
19
- */
20
- export declare const ariaHasPopup = "aria-haspopup";
21
- /**
22
- * A global namespace for aria-hidden.
23
- */
24
- export declare const ariaHidden = "aria-hidden";
25
- /**
26
- * A global namespace for aria-label.
27
- */
28
- export declare const ariaLabel = "aria-label";
29
- /**
30
- * A global namespace for aria-labelledby.
31
- */
32
- export declare const ariaLabelledBy = "aria-labelledby";
33
- /**
34
- * A global namespace for aria-modal.
35
- */
36
- export declare const ariaModal = "aria-modal";
37
- /**
38
- * A global namespace for aria-pressed.
39
- */
40
- export declare const ariaPressed = "aria-pressed";
41
- /**
42
- * A global namespace for aria-selected.
43
- */
44
- export declare const ariaSelected = "aria-selected";
45
- /**
46
- * A global namespace for aria-valuemin.
47
- */
48
- export declare const ariaValueMin = "aria-valuemin";
49
- /**
50
- * A global namespace for aria-valuemax.
51
- */
52
- export declare const ariaValueMax = "aria-valuemax";
53
- /**
54
- * A global namespace for aria-valuenow.
55
- */
56
- export declare const ariaValueNow = "aria-valuenow";
57
- /**
58
- * A global namespace for aria-valuetext.
59
- */
60
- export declare const ariaValueText = "aria-valuetext";
61
- /**
62
- * A global namespace for all browser native events.
63
- */
64
- export declare const nativeEvents: {
65
- DOMContentLoaded: string;
66
- DOMMouseScroll: string;
67
- abort: string;
68
- beforeunload: string;
69
- blur: string;
70
- change: string;
71
- click: string;
72
- contextmenu: string;
73
- dblclick: string;
74
- error: string;
75
- focus: string;
76
- focusin: string;
77
- focusout: string;
78
- gesturechange: string;
79
- gestureend: string;
80
- gesturestart: string;
81
- hover: string;
82
- keydown: string;
83
- keypress: string;
84
- keyup: string;
85
- load: string;
86
- mousedown: string;
87
- mousemove: string;
88
- mousein: string;
89
- mouseout: string;
90
- mouseenter: string;
91
- mouseleave: string;
92
- mouseover: string;
93
- mouseup: string;
94
- mousewheel: string;
95
- move: string;
96
- orientationchange: string;
97
- pointercancel: string;
98
- pointerdown: string;
99
- pointerleave: string;
100
- pointermove: string;
101
- pointerup: string;
102
- readystatechange: string;
103
- reset: string;
104
- resize: string;
105
- scroll: string;
106
- select: string;
107
- selectend: string;
108
- selectstart: string;
109
- submit: string;
110
- touchcancel: string;
111
- touchend: string;
112
- touchmove: string;
113
- touchstart: string;
114
- unload: string;
115
- };
116
- /**
117
- * A global namespace for `abort` event.
118
- */
119
- export declare const abortEvent = "abort";
120
- /**
121
- * A global namespace for `blur` event.
122
- */
123
- export declare const blurEvent = "blur";
124
- /**
125
- * A global namespace for `move` event.
126
- */
127
- export declare const moveEvent = "move";
128
- /**
129
- * A global namespace for `change` event.
130
- */
131
- export declare const changeEvent = "change";
132
- /**
133
- * A global namespace for `drag` event.
134
- */
135
- export declare const dragEvent = "drag";
136
- /**
137
- * A global namespace for `dragstart` event.
138
- */
139
- export declare const dragstartEvent = "dragstart";
140
- /**
141
- * A global namespace for `dragenter` event.
142
- */
143
- export declare const dragenterEvent = "dragenter";
144
- /**
145
- * A global namespace for `dragleave` event.
146
- */
147
- export declare const dragleaveEvent = "dragleave";
148
- /**
149
- * A global namespace for `dragover` event.
150
- */
151
- export declare const dragoverEvent = "dragover";
152
- /**
153
- * A global namespace for `dragend` event.
154
- */
155
- export declare const dragendEvent = "dragend";
156
- /**
157
- * A global namespace for `error` event.
158
- */
159
- export declare const errorEvent = "error";
160
- /**
161
- * A global namespace for `reset` event.
162
- */
163
- export declare const resetEvent = "reset";
164
- /**
165
- * A global namespace for `resize` event.
166
- */
167
- export declare const resizeEvent = "resize";
168
- /**
169
- * A global namespace for `scroll` event.
170
- */
171
- export declare const scrollEvent = "scroll";
172
- /**
173
- * A global namespace for `submit` event.
174
- */
175
- export declare const submitEvent = "submit";
176
- /**
177
- * A global namespace for `load` event.
178
- */
179
- export declare const loadEvent = "load";
180
- /**
181
- * A global namespace for `loadstart` event.
182
- */
183
- export declare const loadstartEvent = "loadstart";
184
- /**
185
- * A global namespace for `unload` event.
186
- */
187
- export declare const unloadEvent = "unload";
188
- /**
189
- * A global namespace for `readystatechange` event.
190
- */
191
- export declare const readystatechangeEvent = "readystatechange";
192
- /**
193
- * A global namespace for `beforeunload` event.
194
- */
195
- export declare const beforeunloadEvent = "beforeunload";
196
- /**
197
- * A global namespace for `orientationchange` event.
198
- */
199
- export declare const orientationchangeEvent = "orientationchange";
200
- /**
201
- * A global namespace for `contextmenu` event.
202
- */
203
- export declare const contextmenuEvent = "contextmenu";
204
- /**
205
- * A global namespace for `DOMContentLoaded` event.
206
- */
207
- export declare const DOMContentLoadedEvent = "DOMContentLoaded";
208
- /**
209
- * A global namespace for `DOMMouseScroll` event.
210
- */
211
- export declare const DOMMouseScrollEvent = "DOMMouseScroll";
212
- /**
213
- * A global namespace for `select` event.
214
- */
215
- export declare const selectEvent = "select";
216
- /**
217
- * A global namespace for the `selectend` event.
218
- */
219
- export declare const selectendEvent = "selectend";
220
- /**
221
- * A global namespace for the `selectstart` event.
222
- */
223
- export declare const selectstartEvent = "selectstart";
224
- /**
225
- * A global namespace for mouse events equivalent to touch events.
226
- */
227
- export declare const mouseSwipeEvents: {
228
- start: string;
229
- end: string;
230
- move: string;
231
- cancel: string;
232
- };
233
- /**
234
- * A global namespace for mouse click events.
235
- */
236
- export declare const mouseClickEvents: {
237
- down: string;
238
- up: string;
239
- };
240
- /**
241
- * A global namespace for `click` event.
242
- */
243
- export declare const mouseclickEvent = "click";
244
- /**
245
- * A global namespace for `dblclick` event.
246
- */
247
- export declare const mousedblclickEvent = "dblclick";
248
- /**
249
- * A global namespace for `mousedown` event.
250
- */
251
- export declare const mousedownEvent = "mousedown";
252
- /**
253
- * A global namespace for `mouseup` event.
254
- */
255
- export declare const mouseupEvent = "mouseup";
256
- /**
257
- * A global namespace for `hover` event.
258
- */
259
- export declare const mousehoverEvent = "hover";
260
- /**
261
- * A global namespace for mouse hover events.
262
- */
263
- export declare const mouseHoverEvents: string[];
264
- /**
265
- * A global namespace for `mouseenter` event.
266
- */
267
- export declare const mouseenterEvent = "mouseenter";
268
- /**
269
- * A global namespace for `mouseleave` event.
270
- */
271
- export declare const mouseleaveEvent = "mouseleave";
272
- /**
273
- * A global namespace for `mousein` event.
274
- */
275
- export declare const mouseinEvent = "mousein";
276
- /**
277
- * A global namespace for `mouseout` event.
278
- */
279
- export declare const mouseoutEvent = "mouseout";
280
- /**
281
- * A global namespace for `mouseover` event.
282
- */
283
- export declare const mouseoverEvent = "mouseover";
284
- /**
285
- * A global namespace for `mousemove` event.
286
- */
287
- export declare const mousemoveEvent = "mousemove";
288
- /**
289
- * A global namespace for `mousewheel` event.
290
- */
291
- export declare const mousewheelEvent = "mousewheel";
292
- /**
293
- * A global namespace for touch events.
294
- */
295
- export declare const touchEvents: {
296
- start: string;
297
- end: string;
298
- move: string;
299
- cancel: string;
300
- };
301
- /**
302
- * A global namespace for `touchstart` event.
303
- */
304
- export declare const touchstartEvent = "touchstart";
305
- /**
306
- * A global namespace for `touchmove` event.
307
- */
308
- export declare const touchmoveEvent = "touchmove";
309
- /**
310
- * A global namespace for `touchcancel` event.
311
- */
312
- export declare const touchcancelEvent = "touchcancel";
313
- /**
314
- * A global namespace for `touchend` event.
315
- */
316
- export declare const touchendEvent = "touchend";
317
- /**
318
- * A global namespace for `pointercancel` event.
319
- */
320
- export declare const pointercancelEvent = "pointercancel";
321
- /**
322
- * A global namespace for `pointerdown` event.
323
- */
324
- export declare const pointerdownEvent = "pointerdown";
325
- /**
326
- * A global namespace for `pointerleave` event.
327
- */
328
- export declare const pointerleaveEvent = "pointerleave";
329
- /**
330
- * A global namespace for `pointermove` event.
331
- */
332
- export declare const pointermoveEvent = "pointermove";
333
- /**
334
- * A global namespace for `pointerup` event.
335
- */
336
- export declare const pointerupEvent = "pointerup";
337
- /**
338
- * A global namespace for focus event names.
339
- */
340
- export declare const focusEvents: {
341
- in: string;
342
- out: string;
343
- };
344
- /**
345
- * A global namespace for `focus` event.
346
- */
347
- export declare const focusEvent = "focus";
348
- /**
349
- * A global namespace for `focusin` event.
350
- */
351
- export declare const focusinEvent = "focusin";
352
- /**
353
- * A global namespace for `focusout` event.
354
- */
355
- export declare const focusoutEvent = "focusout";
356
- export declare const focusableSelector = "a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]";
357
- /**
358
- * A global namespace for `gesturechange` event.
359
- */
360
- export declare const gesturechangeEvent = "gesturechange";
361
- /**
362
- * A global namespace for `gestureend` event.
363
- */
364
- export declare const gestureendEvent = "gestureend";
365
- /**
366
- * A global namespace for `gesturestart` event.
367
- */
368
- export declare const gesturestartEvent = "gesturestart";
369
- /**
370
- * A global namespace for keyboard event keys.
371
- */
372
- export declare const keyboardEventKeys: {
373
- Backspace: string;
374
- Tab: string;
375
- Enter: string;
376
- Shift: string;
377
- Control: string;
378
- Alt: string;
379
- Pause: string;
380
- CapsLock: string;
381
- Escape: string;
382
- Scape: string;
383
- ArrowLeft: string;
384
- ArrowUp: string;
385
- ArrowRight: string;
386
- ArrowDown: string;
387
- Insert: string;
388
- Delete: string;
389
- Meta: string;
390
- ContextMenu: string;
391
- ScrollLock: string;
392
- };
393
- /**
394
- * A global namespace for `keydown` event.
395
- */
396
- export declare const keydownEvent = "keydown";
397
- /**
398
- * A global namespace for `keyup` event.
399
- */
400
- export declare const keyupEvent = "keyup";
401
- /**
402
- * A global namespace for `keypress` event.
403
- */
404
- export declare const keypressEvent = "keypress";
405
- /**
406
- * A global namespace for `Alt` key.
407
- * e.which = 18
408
- */
409
- export declare const keyAlt = "Alt";
410
- /**
411
- * A global namespace for `ArrowDown` key.
412
- * e.which = 40 equivalent
413
- */
414
- export declare const keyArrowDown = "ArrowDown";
415
- /**
416
- * A global namespace for `ArrowUp` key.
417
- * e.which = 38 equivalent
418
- */
419
- export declare const keyArrowUp = "ArrowUp";
420
- /**
421
- * A global namespace for `ArrowLeft` key.
422
- * e.which = 37 equivalent
423
- */
424
- export declare const keyArrowLeft = "ArrowLeft";
425
- /**
426
- * A global namespace for `ArrowRight` key.
427
- * e.which = 39 equivalent
428
- */
429
- export declare const keyArrowRight = "ArrowRight";
430
- /**
431
- * A global namespace for `Backspace` key.
432
- * e.which === 8 equivalent
433
- */
434
- export declare const keyBackspace = "Backspace";
435
- /**
436
- * A global namespace for `CapsLock` key.
437
- * e.which = 20 equivalent
438
- */
439
- export declare const keyCapsLock = "CapsLock";
440
- /**
441
- * A global namespace for `Control` key.
442
- * e.which = 17
443
- */
444
- export declare const keyControl = "Control";
445
- /**
446
- * A global namespace for `Delete` key.
447
- * e.which = 46 equivalent
448
- */
449
- export declare const keyDelete = "Delete";
450
- /**
451
- * A global namespace for `Enter` key.
452
- * e.which = 13 equivalent
453
- */
454
- export declare const keyEnter = "Enter";
455
- /**
456
- * A global namespace for `Enter` key.
457
- * e.which = 13 equivalent
458
- */
459
- export declare const keyNumpadEnter = "NumpadEnter";
460
- /**
461
- * A global namespace for `Escape` key.
462
- * e.which = 27 equivalent
463
- */
464
- export declare const keyEscape = "Escape";
465
- /**
466
- * A global namespace for `Insert` key.
467
- * e.which = 45 equivalent
468
- */
469
- export declare const keyInsert = "Insert";
470
- /**
471
- * A global namespace for `Meta` key.
472
- * e.which = 93 equivalent
473
- */
474
- export declare const keyMeta = "Meta";
475
- /**
476
- * A global namespace for `Pause` key.
477
- * e.which = 19
478
- */
479
- export declare const keyPause = "Pause";
480
- /**
481
- * A global namespace for `ScrollLock` key.
482
- * e.which = 145 equivalent
483
- */
484
- export declare const keyScrollLock = "ScrollLock";
485
- /**
486
- * A global namespace for `Shift` key.
487
- * e.which = 16
488
- */
489
- export declare const keyShift = "Shift";
490
- /**
491
- * A global namespace for `Space` key.
492
- * e.which = 32 equivalent
493
- */
494
- export declare const keySpace = "Space";
495
- /**
496
- * A global namespace for `Tab` key.
497
- * e.which = 9 equivalent
498
- */
499
- export declare const keyTab = "Tab";
500
- /**
501
- * A global namespace for 'animationDuration' string.
502
- */
503
- export declare const animationDuration = "animationDuration";
504
- /**
505
- * A global namespace for 'animationDelay' string.
506
- */
507
- export declare const animationDelay = "animationDelay";
508
- /**
509
- * A global namespace for 'animationName' string.
510
- */
511
- export declare const animationName = "animationName";
512
- /**
513
- * A global namespace for 'animationend' string.
514
- */
515
- export declare const animationEndEvent = "animationend";
516
- /**
517
- * A global namespace for 'transitionDuration' string.
518
- */
519
- export declare const transitionDuration = "transitionDuration";
520
- /**
521
- * A global namespace for 'transitionDelay' string.
522
- */
523
- export declare const transitionDelay = "transitionDelay";
524
- /**
525
- * A global namespace for 'transitionend' string.
526
- */
527
- export declare const transitionEndEvent = "transitionend";
528
- /**
529
- * A global namespace for `transitionProperty` string for modern browsers.
530
- */
531
- export declare const transitionProperty = "transitionProperty";
532
- /**
533
- * A global namespace for 'addEventListener' string.
534
- */
535
- declare const addEventListener$1 = "addEventListener";
536
- /**
537
- * A global namespace for 'removeEventListener' string.
538
- */
539
- declare const removeEventListener$1 = "removeEventListener";
540
- /**
541
- * A global namespace for predefined
542
- * CSS3 'cubic-bezier()' easing functions.
543
- */
544
- export declare const bezierEasings: {
545
- linear: string;
546
- easingSinusoidalIn: string;
547
- easingSinusoidalOut: string;
548
- easingSinusoidalInOut: string;
549
- easingQuadraticIn: string;
550
- easingQuadraticOut: string;
551
- easingQuadraticInOut: string;
552
- easingCubicIn: string;
553
- easingCubicOut: string;
554
- easingCubicInOut: string;
555
- easingQuarticIn: string;
556
- easingQuarticOut: string;
557
- easingQuarticInOut: string;
558
- easingQuinticIn: string;
559
- easingQuinticOut: string;
560
- easingQuinticInOut: string;
561
- easingExponentialIn: string;
562
- easingExponentialOut: string;
563
- easingExponentialInOut: string;
564
- easingCircularIn: string;
565
- easingCircularOut: string;
566
- easingCircularInOut: string;
567
- easingBackIn: string;
568
- easingBackOut: string;
569
- easingBackInOut: string;
570
- };
571
- /**
572
- * A global namespace for `offsetHeight` property.
573
- */
574
- export declare const offsetHeight = "offsetHeight";
575
- /**
576
- * A global namespace for `offsetWidth` property.
577
- */
578
- export declare const offsetWidth = "offsetWidth";
579
- /**
580
- * A global namespace for `scrollHeight` property.
581
- */
582
- export declare const scrollHeight = "scrollHeight";
583
- /**
584
- * A global namespace for `scrollWidth` property.
585
- */
586
- export declare const scrollWidth = "scrollWidth";
587
- /**
588
- * A global namespace for `touchcancel` event.
589
- */
590
- export declare const tabindex = "tabindex";
591
- // https://github.com/lukewarlow/user-agent-data-types/blob/master/index.d.ts
592
- export declare interface NavigatorUABrand {
593
- readonly brand: string;
594
- readonly version: string;
595
- }
596
- export declare interface NavigatorUAData {
597
- readonly brands: NavigatorUABrand[];
598
- readonly mobile: boolean;
599
- readonly platform: string;
600
- }
601
- export declare interface NavigatorUA extends Navigator {
602
- readonly userAgentData: NavigatorUAData;
603
- }
604
- /**
605
- * A global namespace for `userAgentData` object.
606
- */
607
- export declare const userAgentData: NavigatorUA["userAgentData"];
608
- /**
609
- * A global namespace for `navigator.userAgent` string.
610
- */
611
- export declare const userAgent: string;
612
- /**
613
- * A global `boolean` for mobile detection.
614
- */
615
- export declare const isMobile: boolean;
616
- /**
617
- * A global `boolean` for Apple browsers.
618
- */
619
- export declare const isApple: boolean;
620
- /**
621
- * A global boolean for Gecko browsers. When writing this file,
622
- * Gecko was not supporting `userAgentData`.
623
- */
624
- export declare const isFirefox: boolean;
625
- /**
626
- * A global `boolean` for CSS3 3D transform support.
627
- */
628
- export declare const support3DTransform: boolean;
629
- /**
630
- * A global `boolean` for passive events support,
631
- * in general event options are not suited for scroll prevention.
632
- *
633
- * @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection
634
- */
635
- export declare const supportPassive: boolean;
636
- /**
637
- * A global `boolean` for CSS3 transform support.
638
- */
639
- export declare const supportTransform: boolean;
640
- /**
641
- * A global `boolean` for touch events support.
642
- */
643
- export declare const supportTouch: boolean;
644
- /**
645
- * A global `boolean` for CSS3 animation support.
646
- */
647
- export declare const supportAnimation: boolean;
648
- /**
649
- * A global `boolean` for CSS3 transition support.
650
- */
651
- export declare const supportTransition: boolean;
652
- /**
653
- * Shortcut for `HTMLElement.getAttribute()` method.
654
- *
655
- * @param element target element
656
- * @param att attribute name
657
- * @returns attribute value
658
- */
659
- export declare const getAttribute: (element: HTMLElement, att: string) => string | null;
660
- /**
661
- * Shortcut for `HTMLElement.getAttributeNS()` method.
662
- *
663
- * @param ns attribute namespace
664
- * @param element target element
665
- * @param att attribute name
666
- * @returns attribute value
667
- */
668
- export declare const getAttributeNS: (ns: string, element: HTMLElement, att: string) => string | null;
669
- /**
670
- * Shortcut for `HTMLElement.hasAttribute()` method.
671
- *
672
- * @param element target element
673
- * @param att attribute name
674
- * @returns the query result
675
- */
676
- export declare const hasAttribute: (element: HTMLElement, att: string) => boolean;
677
- /**
678
- * Shortcut for `HTMLElement.hasAttributeNS()` method.
679
- *
680
- * @param ns attribute namespace
681
- * @param element target element
682
- * @param att attribute name
683
- * @returns the query result
684
- */
685
- export declare const hasAttributeNS: (ns: string, element: HTMLElement, att: string) => boolean;
686
- /**
687
- * Shortcut for `HTMLElement.setAttribute()` method.
688
- *
689
- * @param element target element
690
- * @param att attribute name
691
- * @param value attribute value
692
- */
693
- export declare const setAttribute: (element: HTMLElement, att: string, value: string) => void;
694
- /**
695
- * Shortcut for `SVGElement.setAttributeNS()` method.
696
- *
697
- * @param ns attribute namespace
698
- * @param element target element
699
- * @param att attribute name
700
- * @param value attribute value
701
- */
702
- export declare const setAttributeNS: (ns: string, element: HTMLElement, att: string, value: string) => void;
703
- /**
704
- * Shortcut for `HTMLElement.removeAttribute()` method.
705
- *
706
- * @param element target element
707
- * @param att attribute name
708
- */
709
- export declare const removeAttribute: (element: HTMLElement, att: string) => void;
710
- /**
711
- * Shortcut for `HTMLElement.removeAttributeNS()` method.
712
- *
713
- * @param ns attribute namespace
714
- * @param element target element
715
- * @param att attribute name
716
- */
717
- export declare const removeAttributeNS: (ns: string, element: HTMLElement, att: string) => void;
718
- /**
719
- * Add one or more CSS classes to `HTMLElement.classList`.
720
- *
721
- * @param element target
722
- * @param classNAME to add
723
- */
724
- export declare const addClass: (element: HTMLElement, ...classNAME: string[]) => void;
725
- /**
726
- * Remove one or more classes from `HTMLElement.classList`.
727
- *
728
- * @param element target
729
- * @param classNAME to remove
730
- */
731
- export declare const removeClass: (element: HTMLElement, ...classNAME: string[]) => void;
732
- /**
733
- * Check class in `HTMLElement.classList`.
734
- *
735
- * @param element target
736
- * @param classNAME to check
737
- */
738
- export declare const hasClass: (element: HTMLElement, classNAME: string) => boolean;
739
- /**
740
- * Add eventListener to an `EventTarget` object.
741
- */
742
- export declare const on: <T extends EventTarget, L = EventListener>(element: T, eventName: string, listener: L, options?: AddEventListenerOptions) => void;
743
- /**
744
- * Remove eventListener from an `EventTarget` object.
745
- */
746
- export declare const off: <T extends EventTarget, L = EventListener>(element: T, eventName: string, listener: L, options?: AddEventListenerOptions) => void;
747
- /**
748
- * Add an `eventListener` to an `EventTarget`
749
- * element and remove it once callback is called.
750
- */
751
- export declare const one: <T extends EventTarget, L = EventListener>(element: T, eventName: string, listener: L, options?: AddEventListenerOptions) => void;
752
- /**
753
- * A global namespace for `document.body`.
754
- */
755
- export declare const documentBody: HTMLElement;
756
- /**
757
- * A global namespace for `document.documentElement` or the `<HTML>`.
758
- */
759
- export declare const documentElement: HTMLElement;
760
- /**
761
- * A global namespace for `document.head`.
762
- */
763
- export declare const documentHead: HTMLHeadElement;
764
- /**
765
- * Shortie for `Array.from()` static method.
766
- * The utility should also work with any typed arrays
767
- * like Float64Array or Int32Array.
768
- *
769
- * @param arr array-like iterable object
770
- * @returns a new array from iterable object
771
- */
772
- export declare const ArrayFrom: <T>(arr: ArrayLike<T> | Iterable<T>) => T[];
773
- /**
774
- * An interface for web components background data.
775
- *
776
- * @see https://github.com/thednp/bootstrap.native/blob/master/src/components/base-component.js
777
- */
778
- export declare const Data: {
779
- data: Map<string, Map<HTMLElement, unknown>>;
780
- /**
781
- * Sets web components data.
782
- *
783
- * @param element target element
784
- * @param component the component's name or a unique key
785
- * @param instance the component instance
786
- */
787
- set: <T>(element: HTMLElement, component: string, instance: T) => void;
788
- /**
789
- * Returns all instances for specified component.
790
- *
791
- * @param component the component's name or a unique key
792
- * @returns all the component instances
793
- */
794
- getAllFor: <T>(component: string) => Map<HTMLElement, T> | null;
795
- /**
796
- * Returns the instance associated with the target.
797
- *
798
- * @param element target element
799
- * @param component the component's name or a unique key
800
- * @returns the instance
801
- */
802
- get: <T>(element: HTMLElement, component: string) => T | null;
803
- /**
804
- * Removes web components data.
805
- *
806
- * @param element target element
807
- * @param component the component's name or a unique key
808
- */
809
- remove: <T>(element: HTMLElement, component: string) => void;
810
- };
811
- /**
812
- * An alias for `Data.get()`.
813
- */
814
- export declare const getInstance: <T>(target: HTMLElement, component: string) => T | null;
815
- /**
816
- * Shortie for `document.createElement` method
817
- * which allows you to create a new `HTMLElement` for a given `tagName`
818
- * or based on an object with specific non-readonly attributes with string values:
819
- * `id`, `className`, `textContent`, `style`, etc.
820
- *
821
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
822
- *
823
- * @param param `tagName` or object
824
- * @return a new `HTMLElement`
825
- */
826
- export declare const createElement: <T extends HTMLElement>(param?: string | Partial<T>) => T | undefined;
827
- /**
828
- * Shortie for `document.createElementNS` method
829
- * which allows you to create a new `HTMLElement` for a given `tagName`
830
- * or based on an object with specific non-readonly attributes with string values:
831
- * `id`, `className`, `textContent`, `style`, etc.
832
- * Note: some elements resulted from this function call may not be compatible with
833
- * some attributes.
834
- *
835
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS
836
- *
837
- * @param ns `namespaceURI` to associate with the new `HTMLElement`
838
- * @param param `tagName` or object
839
- * @return a new `HTMLElement`
840
- */
841
- export declare const createElementNS: <T extends Element = HTMLElement>(ns: string, param?: string | Partial<T>) => T | undefined;
842
- /**
843
- * Shortcut for the `Element.dispatchEvent(Event)` method.
844
- *
845
- * @param element is the target
846
- * @param event is the `Event` object
847
- */
848
- declare const dispatchEvent$1: (element: EventTarget, event: Event) => boolean;
849
- /**
850
- * JavaScript `Array` distinct.
851
- *
852
- * @see https://codeburst.io/javascript-array-distinct-5edc93501dc4
853
- *
854
- * @example
855
- * ```
856
- * [0,1,1,2].filter(distinct)
857
- * // => [0,1,2]
858
- * ```
859
- * @param value array item value
860
- * @param index array item index
861
- * @param arr a clone of the target array
862
- * @returns the query result
863
- */
864
- export declare const distinct: <T>(value: T, index: number, arr: T[]) => boolean;
865
- /**
866
- * Utility to make sure callbacks are consistently
867
- * called when animation ends.
868
- *
869
- * @param element target
870
- * @param handler `animationend` callback
871
- */
872
- export declare const emulateAnimationEnd: (element: HTMLElement, handler: EventListener) => void;
873
- /**
874
- * Utility to make sure callbacks are consistently
875
- * called when transition ends.
876
- *
877
- * @param element event target
878
- * @param handler `transitionend` callback
879
- */
880
- export declare const emulateTransitionEnd: (element: HTMLElement, handler: EventListener) => void;
881
- /**
882
- * Shortcut for `Float32Array.from()` static method.
883
- *
884
- * @param arr array-like iterable object
885
- * @returns a new Float32Array
886
- */
887
- export declare const Float32ArrayFrom: (arr: ArrayLike<number> | Iterable<number>) => Float32Array;
888
- /**
889
- * Shortcut for `Float64Array.from()` static method.
890
- *
891
- * @param arr array-like iterable object
892
- * @returns a new Float64Array
893
- */
894
- export declare const Float64ArrayFrom: (arr: ArrayLike<number> | Iterable<number>) => Float64Array;
895
- /**
896
- * Shortie for `HTMLElement.focus()` method.
897
- *
898
- * @param element is the target
899
- * @param options allows to pass additional options such as `preventScroll: boolean`
900
- */
901
- declare const focus$1: (element: HTMLOrSVGElement, options?: FocusOptions) => void;
902
- /** A generic function with empty body. */
903
- export declare const noop: () => void;
904
- /**
905
- * Utility to normalize component options.
906
- *
907
- * @param element target
908
- * @param defaultOps component default options
909
- * @param inputOps component instance options
910
- * @param ns component namespace
911
- * @return normalized component options object
912
- */
913
- export declare const normalizeOptions: <T extends {
914
- [key: string]: unknown;
915
- }>(element: HTMLElement, defaultOps: T, inputOps: Partial<T>, ns?: string) => T;
916
- type Fn = (...args: unknown[]) => unknown;
917
- type NormalValue = boolean | number | string | Fn | null;
918
- /**
919
- * Utility to normalize component options
920
- *
921
- * @param value the input value
922
- * @return the normalized value
923
- */
924
- export declare const normalizeValue: (value?: unknown) => NormalValue;
925
- declare function ObjectAssignTyped<T, U>(target: T, source: U): T & U;
926
- declare function ObjectAssignTyped<T, U, V>(target: T, source1: U, source2: V): T & U & V;
927
- declare function ObjectAssignTyped<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
928
- declare function ObjectAssignTyped<T, U, V, W, Q>(target: T, source1: U, source2: V, source3: W, source4: Q): T & U & V & W & Q;
929
- declare function ObjectAssignTyped<T, U, V, W, Q, R>(target: T, source1: U, source2: V, source3: W, source4: Q, source5: R): T & U & V & W & Q & R;
930
- declare function ObjectAssignTyped(target: unknown, ...sources: unknown[]): unknown;
931
- /**
932
- * Shortcut for `Object.assign()` static method.
933
- *
934
- * @param obj a target object
935
- * @param source source object(s)
936
- * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
937
- */
938
- export declare const ObjectAssign: typeof ObjectAssignTyped;
939
- /**
940
- * Shortcut for `Object.entries()` static method.
941
- *
942
- * @param obj a target object
943
- * @returns the entries of an object in an array format [key, value][]
944
- * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
945
- */
946
- export declare const ObjectEntries: <O extends Record<keyof O, unknown>>(obj: O) => [
947
- keyof O,
948
- O[keyof O]
949
- ][];
950
- /**
951
- * A shortcut to `Object.hasOwn()` static method to work
952
- * with regular `Object` elements.
953
- *
954
- * @see https://fettblog.eu/typescript-hasownproperty/
955
- * @param obj the target object
956
- * @param prop the property to check
957
- * @returns the query result
958
- */
959
- export declare const ObjectHasOwn: <T extends object, K extends PropertyKey>(obj: T, prop: K) => obj is T & Record<K, unknown>;
960
- /**
961
- * Shortcut for `Object.keys()` static method.
962
- *
963
- * @param obj a target object
964
- * @returns an array with object keys
965
- * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
966
- */
967
- export declare const ObjectKeys: <O extends Record<keyof O, unknown>>(obj: O) => (keyof O)[];
968
- /**
969
- * Shortcut for `Object.values()` static method.
970
- *
971
- * @param obj a target object
972
- * @returns an array with the object values
973
- * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
974
- */
975
- export declare const ObjectValues: <O extends Record<string, unknown>>(obj: O) => O[keyof O][];
976
- /**
977
- * Shortcut for `Object.fromEntries()` static method.
978
- *
979
- * @param entries a target entries object
980
- * @returns a new Object created from the specified entries in array format [key, value][]
981
- * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
982
- */
983
- export declare const ObjectFromEntries: <K extends string, V>(entries: [
984
- K,
985
- V
986
- ][]) => Record<K, V>;
987
- export declare interface OriginalEvent extends CustomEvent<unknown> {
988
- readonly type: string;
989
- relatedTarget?: EventTarget;
990
- }
991
- /**
992
- * Returns a namespaced `CustomEvent` specific to each component.
993
- *
994
- * @param eventType Event.type
995
- * @param config Event.options | Event.properties
996
- * @returns a new namespaced event
997
- */
998
- export declare const createCustomEvent: <O extends unknown & Record<string, unknown>, T extends OriginalEvent>(eventType: string, config?: O) => T;
999
- /**
1000
- * A global namespace for most scroll event listeners.
1001
- */
1002
- export declare const passiveHandler: Partial<AddEventListenerOptions>;
1003
- /**
1004
- * Utility to force re-paint of an `HTMLElement` target.
1005
- *
1006
- * @param element is the target
1007
- * @return the `Element.offsetHeight` value
1008
- */
1009
- export declare const reflow: (element: HTMLElement) => number;
1010
- export declare interface CSS4Declaration extends Exclude<() => string | symbol, CSSStyleDeclaration> {
1011
- [key: string]: string;
1012
- }
1013
- /**
1014
- * Shortcut for multiple uses of `HTMLElement.style.propertyName` method.
1015
- *
1016
- * @param element target element
1017
- * @param styles attribute value
1018
- */
1019
- export declare const setElementStyle: (element: HTMLElement, styles: Partial<CSS4Declaration>) => void;
1020
- /**
1021
- * An interface for one or more `TimerHandler`s per `Element`.
1022
- *
1023
- * @see https://github.com/thednp/navbar/
1024
- */
1025
- export declare const Timer: {
1026
- /**
1027
- * Sets a new timeout timer for an element, or element -> key association.
1028
- *
1029
- * @param element target element
1030
- * @param callback the callback
1031
- * @param delay the execution delay
1032
- * @param key a unique key
1033
- */
1034
- set: (element: HTMLElement, callback: TimerHandler, delay: number, key?: string) => void;
1035
- /**
1036
- * Returns the timer associated with the target.
1037
- *
1038
- * @param element target element
1039
- * @param key a unique
1040
- * @returns the timer
1041
- */
1042
- get: (element: HTMLElement, key?: string) => number | null;
1043
- /**
1044
- * Clears the element's timer.
1045
- *
1046
- * @param element target element
1047
- * @param key a unique key
1048
- */
1049
- clear: (element: HTMLElement, key?: string) => void;
1050
- };
1051
- /**
1052
- * Shortcut for `String.toLowerCase()`.
1053
- *
1054
- * @param source input string
1055
- * @returns lowercase output string
1056
- */
1057
- export declare const toLowerCase: (source: string) => string;
1058
- /**
1059
- * Shortcut for `String.toUpperCase()`.
1060
- *
1061
- * @param source input string
1062
- * @returns uppercase output string
1063
- */
1064
- export declare const toUpperCase: (source: string) => string;
1065
- export type FocusableElement = HTMLAnchorElement | HTMLButtonElement | HTMLInputElement | HTMLTextAreaElement | HTMLDataListElement | HTMLDetailsElement | HTMLSelectElement;
1066
- /**
1067
- * Utility to check if a designated element is affected by focus trap;
1068
- * @param target
1069
- */
1070
- export declare const hasFocusTrap: (target: HTMLElement) => boolean;
1071
- /**
1072
- * Utility to toggle focus trap inside a designated target element;
1073
- * @param target
1074
- */
1075
- export declare const toggleFocusTrap: (target: HTMLElement) => void;
1076
- export declare interface BoundingClientRect {
1077
- width: number;
1078
- height: number;
1079
- top: number;
1080
- left: number;
1081
- right: number;
1082
- bottom: number;
1083
- x: number;
1084
- y: number;
1085
- }
1086
- /**
1087
- * Returns the bounding client rect of a target `HTMLElement`.
1088
- *
1089
- * @see https://github.com/floating-ui/floating-ui
1090
- *
1091
- * @param element event.target
1092
- * @param includeScale when *true*, the target scale is also computed
1093
- * @returns the bounding client rect object
1094
- */
1095
- export declare const getBoundingClientRect: (element: HTMLElement, includeScale?: boolean) => BoundingClientRect;
1096
- /**
1097
- * Returns the `document` or the `#document` element.
1098
- *
1099
- * @see https://github.com/floating-ui/floating-ui
1100
- *
1101
- * @param node the reference node
1102
- * @returns the parent document of the given node
1103
- */
1104
- export declare const getDocument: (node?: Node | Document | Window) => Document;
1105
- /**
1106
- * Returns the `document.body` or the `<body>` element.
1107
- *
1108
- * @param node the reference node
1109
- * @returns the parent `<body>` of the specified node
1110
- */
1111
- export declare const getDocumentBody: (node?: Node | Document | Window) => HTMLElement;
1112
- /**
1113
- * Returns the `document.documentElement` or the `<HTML>` element.
1114
- *
1115
- * @param node the reference node
1116
- * @returns the parent `<HTML>` of the node's parent document
1117
- */
1118
- export declare const getDocumentElement: (node?: Node | Document | Window) => HTMLElement;
1119
- /**
1120
- * Returns the `document.head` or the `<head>` element.
1121
- *
1122
- * @param node the reference node
1123
- * @returns the `<head>` of the node's parent document
1124
- */
1125
- export declare const getDocumentHead: (node?: Node | Document | Window) => HTMLElement & HTMLHeadElement;
1126
- /**
1127
- * Utility to get the computed `animationDuration`
1128
- * from `HTMLElement` in miliseconds.
1129
- *
1130
- * @param element target
1131
- * @return the `animationDuration` value in miliseconds
1132
- */
1133
- export declare const getElementAnimationDuration: (element: HTMLElement) => number;
1134
- /**
1135
- * Utility to get the computed `animationDelay`
1136
- * from Element in miliseconds.
1137
- *
1138
- * @param element target
1139
- * @return the `animationDelay` value in miliseconds
1140
- */
1141
- export declare const getElementAnimationDelay: (element: HTMLElement) => number;
1142
- /**
1143
- * Shortcut for `window.getComputedStyle(element).propertyName`
1144
- * static method.
1145
- *
1146
- * * If `element` parameter is not an `HTMLElement`, `getComputedStyle`
1147
- * throws a `ReferenceError`.
1148
- *
1149
- * @param element target
1150
- * @param property the css property
1151
- * @return the css property value
1152
- */
1153
- export declare const getElementStyle: (element: HTMLElement, property: string) => string;
1154
- /**
1155
- * Utility to get the computed `transitionDuration`
1156
- * from Element in miliseconds.
1157
- *
1158
- * @param element target
1159
- * @return the `transitionDuration` value in miliseconds
1160
- */
1161
- export declare const getElementTransitionDuration: (element: HTMLElement) => number;
1162
- /**
1163
- * Utility to get the computed `transitionDelay`
1164
- * from Element in miliseconds.
1165
- *
1166
- * @param element target
1167
- * @return the `transitionDelay` value in miliseconds
1168
- */
1169
- export declare const getElementTransitionDelay: (element: HTMLElement) => number;
1170
- /**
1171
- * Returns an `{x,y}` object with the target
1172
- * `HTMLElement` / `Node` scroll position.
1173
- *
1174
- * @see https://github.com/floating-ui/floating-ui
1175
- *
1176
- * @param element target node / element
1177
- * @returns the scroll tuple
1178
- */
1179
- export declare const getNodeScroll: (element: HTMLElement | Window) => {
1180
- x: number;
1181
- y: number;
1182
- };
1183
- /**
1184
- * Returns the `parentNode` also going through `ShadowRoot`.
1185
- *
1186
- * @see https://github.com/floating-ui/floating-ui
1187
- *
1188
- * @param {Node} node the target node
1189
- * @returns {Node} the apropriate parent node
1190
- */
1191
- export declare const getParentNode: (node: Node) => Node | ParentNode;
1192
- export declare interface OffsetRect {
1193
- width: number;
1194
- height: number;
1195
- x: number;
1196
- y: number;
1197
- }
1198
- /**
1199
- * Returns the rect relative to a given offset parent and its scroll position.
1200
- *
1201
- * @see https://github.com/floating-ui/floating-ui
1202
- *
1203
- * @param element target
1204
- * @param offsetParent the container / offset parent
1205
- * @param scroll the offsetParent scroll position
1206
- * @returns a DOMRect like object
1207
- */
1208
- export declare const getRectRelativeToOffsetParent: (element: HTMLElement, offsetParent: HTMLElement, scroll: {
1209
- x: number;
1210
- y: number;
1211
- }) => OffsetRect;
1212
- /**
1213
- * Returns a unique identifier for popover, tooltip, scrollspy.
1214
- *
1215
- * @param element target element
1216
- * @param key optional identifier key
1217
- * @returns an existing or new unique ID
1218
- */
1219
- export declare const getUID: (element: HTMLElement, key?: string) => number;
1220
- /**
1221
- * Returns the `Window` object of a target node.
1222
- *
1223
- * @see https://github.com/floating-ui/floating-ui
1224
- *
1225
- * @param node target node
1226
- * @returns the `Window` object
1227
- */
1228
- export declare const getWindow: (node?: Node) => Window;
1229
- /**
1230
- * Shortie for the `Array.isArray()` static method.
1231
- *
1232
- * @param obj array-like iterable object
1233
- * @returns the query result
1234
- */
1235
- export declare const isArray: (obj?: unknown) => obj is unknown[];
1236
- /**
1237
- * Checks if an element is an `HTMLCanvasElement` or `<canvas>`.
1238
- *
1239
- * @param element the target element
1240
- * @returns the query result
1241
- */
1242
- export declare const isCanvas: (element?: unknown) => element is HTMLCanvasElement;
1243
- /**
1244
- * Checks if an object is a `Document`.
1245
- *
1246
- * @see https://dom.spec.whatwg.org/#node
1247
- *
1248
- * @param obj the target object
1249
- * @returns the query result
1250
- */
1251
- export declare const isDocument: (obj?: unknown) => obj is Document;
1252
- export declare interface CustomElement extends HTMLElement {
1253
- shadowRoot: ShadowRoot;
1254
- connectedCallback?: () => void;
1255
- disconnectedCallback?: () => void;
1256
- adoptedCallback?: () => void;
1257
- attributeChangedCallback?: () => void;
1258
- }
1259
- /**
1260
- * Checks if an object is a `CustomElement`.
1261
- *
1262
- * @param element the target object
1263
- * @returns the query result
1264
- */
1265
- export declare const isCustomElement: <T extends CustomElement>(element?: unknown) => element is T;
1266
- /**
1267
- * Checks if an object is an `Element`.
1268
- *
1269
- * @see https://dom.spec.whatwg.org/#node
1270
- *
1271
- * ```
1272
- * ELEMENT_NODE = 1;
1273
- * ATTRIBUTE_NODE = 2;
1274
- * TEXT_NODE = 3;
1275
- * CDATA_SECTION_NODE = 4;
1276
- * ENTITY_REFERENCE_NODE = 5; // legacy
1277
- * ENTITY_NODE = 6; // legacy
1278
- * PROCESSING_INSTRUCTION_NODE = 7;
1279
- * COMMENT_NODE = 8;
1280
- * DOCUMENT_NODE = 9;
1281
- * DOCUMENT_TYPE_NODE = 10;
1282
- * DOCUMENT_FRAGMENT_NODE = 11;
1283
- * ```
1284
- * @param element the target object
1285
- * @returns the query result
1286
- */
1287
- export declare const isElement: (element?: unknown) => element is Element;
1288
- /**
1289
- * Utility to determine if an `HTMLElement`
1290
- * is partially visible in viewport.
1291
- *
1292
- * @param element target
1293
- * @return the query result
1294
- */
1295
- export declare const isElementInScrollRange: (element?: HTMLElement) => boolean;
1296
- /**
1297
- * Utility to determine if an `HTMLElement`
1298
- * is fully visible in the viewport.
1299
- *
1300
- * @param element target
1301
- * @return the query result
1302
- */
1303
- export declare const isElementInViewport: (element?: HTMLElement) => boolean;
1304
- /**
1305
- * Checks if an object is an `Array` in which all items are `Element`.
1306
- *
1307
- * @param obj the target object
1308
- * @returns the query result
1309
- */
1310
- export declare const isElementsArray: (obj?: unknown) => obj is HTMLElement[];
1311
- /**
1312
- * Checks if an object is a `Function`.
1313
- *
1314
- * @param fn the target object
1315
- * @returns the query result
1316
- */
1317
- export declare const isFunction: (fn?: unknown) => fn is Fn;
1318
- /**
1319
- * Checks if a value is an `Object`.
1320
- *
1321
- * @param obj the target object
1322
- * @returns the query result
1323
- */
1324
- export declare const isObject: (obj?: unknown) => obj is object;
1325
- /**
1326
- * Checks if an object is an `HTMLCollection`.
1327
- *
1328
- * @param obj the target object
1329
- * @returns the query result
1330
- */
1331
- export declare const isHTMLCollection: (obj?: unknown) => obj is HTMLCollection;
1332
- /**
1333
- * Checks if an element is an `HTMLElement`.
1334
- *
1335
- * @see https://dom.spec.whatwg.org/#node
1336
- *
1337
- * @param element the target object
1338
- * @returns the query result
1339
- */
1340
- export declare const isHTMLElement: (element?: unknown) => element is HTMLElement;
1341
- /**
1342
- * Check if a target element is an `<img>`.
1343
- *
1344
- * @param element the target element
1345
- * @returns the query result
1346
- */
1347
- export declare const isHTMLImageElement: (element?: unknown) => element is HTMLImageElement;
1348
- /**
1349
- * Checks if a string is a `JSON` string.
1350
- *
1351
- * @param str the target string
1352
- * @returns the query result
1353
- */
1354
- export declare const isJSON: (str?: string) => boolean;
1355
- /**
1356
- * Checks if an element is a `Map`.
1357
- *
1358
- * @param obj the target object
1359
- * @returns the query result
1360
- */
1361
- export declare const isMap: (obj?: unknown) => obj is Map<unknown, unknown>;
1362
- /**
1363
- * Checks if an element is a `WeakMap`.
1364
- *
1365
- * @param obj the target object
1366
- * @returns the query result
1367
- */
1368
- export declare const isWeakMap: (obj?: unknown) => obj is WeakMap<WeakKey, unknown>;
1369
- /**
1370
- * Checks if an element is an `<svg>` (or any type of SVG element),
1371
- * `<img>`, `<video>` or `<canvas>`.
1372
- *
1373
- * *Tooltip* / *Popover* works different with media elements.
1374
- *
1375
- * @param element the target element
1376
- * @returns the query result
1377
- */
1378
- export declare const isMedia: (element?: unknown) => element is SVGElement | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement;
1379
- /**
1380
- * Checks if an object is a `Node`.
1381
- *
1382
- * @param node the target object
1383
- * @returns the query result
1384
- */
1385
- export declare const isNode: (node?: unknown) => node is Node;
1386
- /**
1387
- * Checks if an object is a `NodeList`.
1388
- * => equivalent to `object instanceof NodeList`
1389
- *
1390
- * @param obj the target object
1391
- * @returns the query result
1392
- */
1393
- export declare const isNodeList: (obj?: unknown) => obj is NodeList;
1394
- /**
1395
- * Shortie for `typeof SOMETHING === "number"`.
1396
- *
1397
- * @param num input value
1398
- * @returns the query result
1399
- */
1400
- export declare const isNumber: (num?: unknown) => num is number;
1401
- /**
1402
- * Checks if a page is Right To Left.
1403
- *
1404
- * @param node the target
1405
- * @returns the query result
1406
- */
1407
- export declare const isRTL: (node?: Node) => boolean;
1408
- /**
1409
- * Checks if a target `HTMLElement` is affected by scale.
1410
- *
1411
- * @see https://github.com/floating-ui/floating-ui
1412
- *
1413
- * @param element target
1414
- * @returns the query result
1415
- */
1416
- export declare const isScaledElement: (element?: HTMLElement) => boolean;
1417
- /**
1418
- * Check if target is a `ShadowRoot`.
1419
- *
1420
- * @param element target
1421
- * @returns the query result
1422
- */
1423
- export declare const isShadowRoot: (element?: unknown) => element is ShadowRoot;
1424
- /**
1425
- * Shortie for `typeof SOMETHING === "string"`.
1426
- *
1427
- * @param str input value
1428
- * @returns the query result
1429
- */
1430
- export declare const isString: (str?: unknown) => str is string;
1431
- /**
1432
- * Check if an element is an `<svg>` or any other SVG element,
1433
- * an equivalent to `SOMETHING instanceof SVGElement`.
1434
- *
1435
- * @param element the target element
1436
- * @returns the query result
1437
- */
1438
- export declare const isSVGElement: (element?: unknown) => element is SVGElement;
1439
- /**
1440
- * Check if a target element is a `<table>`, `<td>` or `<th>`.
1441
- * This specific check is important for determining
1442
- * the `offsetParent` of a given element.
1443
- *
1444
- * @param element the target element
1445
- * @returns the query result
1446
- */
1447
- export declare const isTableElement: (element?: unknown) => element is HTMLTableElement | HTMLTableCellElement;
1448
- /**
1449
- * Check if a target object is `Window`.
1450
- * => equivalent to `object instanceof Window`
1451
- *
1452
- * @param obj the target object
1453
- * @returns the query result
1454
- */
1455
- export declare const isWindow: (obj?: unknown) => obj is Window;
1456
- /**
1457
- * Shortcut for `HTMLElement.closest` method which also works
1458
- * with children of `ShadowRoot`. The order of the parameters
1459
- * is intentional since they're both required.
1460
- *
1461
- * @see https://stackoverflow.com/q/54520554/803358
1462
- *
1463
- * @param element Element to look into
1464
- * @param selector the selector name
1465
- * @return the query result
1466
- */
1467
- export declare const closest: <T extends Element = HTMLElement>(element: T, selector: string) => HTMLElement | null;
1468
- /**
1469
- * Utility to check if target is typeof `HTMLElement`, `Element`, `Node`
1470
- * or find one that matches a selector.
1471
- *
1472
- * @param selector the input selector or target element
1473
- * @param parent optional node to look into
1474
- * @return the `HTMLElement` or `querySelector` result
1475
- */
1476
- export declare const querySelector: <T extends HTMLElement>(selector: HTMLElement | string, parent?: ParentNode) => T | null;
1477
- /**
1478
- * Returns an `Array` of `Node` elements that are registered as
1479
- * `CustomElement`.
1480
- *
1481
- * @see https://stackoverflow.com/questions/27334365/how-to-get-list-of-registered-custom-elements
1482
- *
1483
- * @param parent parent to look into
1484
- * @returns the query result
1485
- */
1486
- export declare const getCustomElements: (parent?: ParentNode) => CustomElement[];
1487
- /**
1488
- * Returns an `HTMLElement` that matches the id in the document.
1489
- * Within multiple <iframe> elements, a `parent` parameter
1490
- * would decisively locate the correct element.
1491
- *
1492
- * @param id the ID selector
1493
- * @param context an element in it's document or document
1494
- * @returns the requested element
1495
- */
1496
- export declare const getElementById: <T extends HTMLElement>(id: string, context?: Node) => T;
1497
- /**
1498
- * A shortcut for `(document|Element).querySelectorAll`.
1499
- *
1500
- * @param selector the input selector
1501
- * @param parent optional node to look into
1502
- * @return the query result
1503
- */
1504
- export declare const querySelectorAll: <T extends HTMLElement>(selector: string, parent?: ParentNode) => NodeListOf<T>;
1505
- /**
1506
- * Shortcut for `HTMLElement.getElementsByTagName` method. Some `Node` elements
1507
- * like `ShadowRoot` do not support `getElementsByTagName`.
1508
- *
1509
- * @param selector the tag name
1510
- * @param parent optional Element to look into
1511
- * @return the 'HTMLCollection'
1512
- */
1513
- export declare const getElementsByTagName: <T extends HTMLElement>(selector: string, parent?: ParentNode) => HTMLCollectionOf<T>;
1514
- /**
1515
- * Shortcut for `HTMLElement.getElementsByClassName` method. Some `Node` elements
1516
- * like `ShadowRoot` do not support `getElementsByClassName`.
1517
- *
1518
- * @param selector the class name
1519
- * @param parent optional Element to look into
1520
- * @return the 'HTMLCollection'
1521
- */
1522
- export declare const getElementsByClassName: <T extends HTMLElement>(selector: string, parent?: ParentNode) => HTMLCollectionOf<T>;
1523
- /**
1524
- * Check if element matches a CSS selector.
1525
- *
1526
- * @param target the target element
1527
- * @param selector the selector to match
1528
- * @returns the query result
1529
- */
1530
- export declare const matches: (target: Element, selector: string) => boolean;
1531
- type NativeAnimationEvent = AnimationEvent$1;
1532
- type NativeClipboardEvent = ClipboardEvent$1;
1533
- type NativeCompositionEvent = CompositionEvent$1;
1534
- type NativeDragEvent = DragEvent$1;
1535
- type NativeFocusEvent = FocusEvent$1;
1536
- type NativeKeyboardEvent = KeyboardEvent$1;
1537
- type NativeMouseEvent = MouseEvent$1;
1538
- type NativeTouchEvent = TouchEvent$1;
1539
- type NativePointerEvent = PointerEvent$1;
1540
- type NativeTransitionEvent = TransitionEvent$1;
1541
- type NativeUIEvent = UIEvent$1;
1542
- type NativeWheelEvent = WheelEvent$1;
1543
- interface AbstractView {
1544
- styleMedia: StyleMedia;
1545
- document: Document;
1546
- }
1547
- interface BaseEvent<E = Event, C = unknown, T = unknown> {
1548
- nativeEvent: E;
1549
- currentTarget: C | null;
1550
- target: T & EventTarget;
1551
- bubbles: boolean;
1552
- cancelable: boolean;
1553
- defaultPrevented: boolean;
1554
- eventPhase: number;
1555
- isTrusted: boolean;
1556
- preventDefault(): void;
1557
- isDefaultPrevented(): boolean;
1558
- stopPropagation(): void;
1559
- isPropagationStopped(): boolean;
1560
- persist(): void;
1561
- timeStamp: number;
1562
- type: string;
1563
- }
1564
- /**
1565
- * currentTarget - a reference to the element on which the event listener is registered.
1566
- *
1567
- * target - a reference to the element from which the event was originally dispatched.
1568
- * This might be a child element to the element on which the event listener is registered.
1569
- * If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11508#issuecomment-256045682
1570
- */
1571
- export type NativeEvent<T = Element, E = Event> = BaseEvent<E, T, T>;
1572
- interface ClipboardEvent$1<T = Element> extends NativeEvent<T, NativeClipboardEvent> {
1573
- clipboardData: DataTransfer;
1574
- }
1575
- interface CompositionEvent$1<T = Element> extends NativeEvent<T, NativeCompositionEvent> {
1576
- data: string;
1577
- }
1578
- interface DragEvent$1<T = Element> extends MouseEvent$1<T, NativeDragEvent> {
1579
- dataTransfer: DataTransfer;
1580
- }
1581
- interface PointerEvent$1<T = Element> extends MouseEvent$1<T, NativePointerEvent> {
1582
- pointerId: number;
1583
- pressure: number;
1584
- tangentialPressure: number;
1585
- tiltX: number;
1586
- tiltY: number;
1587
- twist: number;
1588
- width: number;
1589
- height: number;
1590
- pointerType: "mouse" | "pen" | "touch";
1591
- isPrimary: boolean;
1592
- }
1593
- interface FocusEvent$1<T = Element, R = Element> extends NativeEvent<T, NativeFocusEvent> {
1594
- relatedTarget: (EventTarget & R) | null;
1595
- target: EventTarget & T;
1596
- }
1597
- type FormControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
1598
- export type FormEvent<T = FormControl> = NativeEvent<T>;
1599
- export interface ChangeEvent<T = FormControl> extends FormEvent<T> {
1600
- target: EventTarget & T;
1601
- }
1602
- type ModifierKey = "Alt" | "AltGraph" | "CapsLock" | "Control" | "Fn" | "FnLock" | "Hyper" | "Meta" | "NumLock" | "ScrollLock" | "Shift" | "Super" | "Symbol" | "SymbolLock";
1603
- interface KeyboardEvent$1<T = Element> extends UIEvent$1<T, NativeKeyboardEvent> {
1604
- altKey: boolean;
1605
- /** @deprecated */
1606
- charCode: number;
1607
- ctrlKey: boolean;
1608
- code: string;
1609
- /**
1610
- * See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
1611
- */
1612
- getModifierState(key: ModifierKey): boolean;
1613
- /**
1614
- * See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
1615
- */
1616
- key: string;
1617
- /** @deprecated */
1618
- keyCode: number;
1619
- locale: string;
1620
- location: number;
1621
- metaKey: boolean;
1622
- repeat: boolean;
1623
- shiftKey: boolean;
1624
- /** @deprecated */
1625
- which: number;
1626
- }
1627
- interface MouseEvent$1<T = Element, E = NativeMouseEvent> extends UIEvent$1<T, E> {
1628
- altKey: boolean;
1629
- button: number;
1630
- buttons: number;
1631
- clientX: number;
1632
- clientY: number;
1633
- ctrlKey: boolean;
1634
- /**
1635
- * See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
1636
- */
1637
- getModifierState(key: ModifierKey): boolean;
1638
- metaKey: boolean;
1639
- movementX: number;
1640
- movementY: number;
1641
- pageX: number;
1642
- pageY: number;
1643
- relatedTarget: EventTarget | null;
1644
- screenX: number;
1645
- screenY: number;
1646
- shiftKey: boolean;
1647
- }
1648
- interface TouchEvent$1<T = Element> extends UIEvent$1<T, NativeTouchEvent> {
1649
- altKey: boolean;
1650
- changedTouches: TouchList;
1651
- ctrlKey: boolean;
1652
- /**
1653
- * See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
1654
- */
1655
- getModifierState(key: ModifierKey): boolean;
1656
- metaKey: boolean;
1657
- shiftKey: boolean;
1658
- targetTouches: TouchList;
1659
- touches: TouchList;
1660
- }
1661
- interface UIEvent$1<T = Element, E = NativeUIEvent> extends NativeEvent<T, E> {
1662
- detail: number;
1663
- view: AbstractView;
1664
- }
1665
- interface WheelEvent$1<T = Element> extends MouseEvent$1<T, NativeWheelEvent> {
1666
- deltaMode: number;
1667
- deltaX: number;
1668
- deltaY: number;
1669
- deltaZ: number;
1670
- }
1671
- interface AnimationEvent$1<T = Element> extends NativeEvent<T, NativeAnimationEvent> {
1672
- animationName: string;
1673
- elapsedTime: number;
1674
- pseudoElement: string;
1675
- }
1676
- interface TransitionEvent$1<T = Element> extends NativeEvent<T, NativeTransitionEvent> {
1677
- elapsedTime: number;
1678
- propertyName: string;
1679
- pseudoElement: string;
1680
- }
1681
- type EventHandler<T = Element, E = Event | NativeEvent<T>> = (event: E) => void;
1682
- export type NativeEventHandler<T = Element> = EventHandler<T, NativeEvent<T>>;
1683
- export type ClipboardEventHandler<T = Element> = EventHandler<T, ClipboardEvent$1<T>>;
1684
- export type CompositionEventHandler<T = Element> = EventHandler<T, CompositionEvent$1<T>>;
1685
- export type DragEventHandler<T = Element> = EventHandler<T, DragEvent$1<T>>;
1686
- export type FocusEventHandler<T = Element> = EventHandler<T, FocusEvent$1<T>>;
1687
- export type FormEventHandler<T = Element> = EventHandler<T, FormEvent<T>>;
1688
- export type ChangeEventHandler<T = Element> = EventHandler<T, ChangeEvent<T>>;
1689
- export type KeyboardEventHandler<T = Element> = EventHandler<T, KeyboardEvent$1<T>>;
1690
- export type MouseEventHandler<T = Element> = EventHandler<T, MouseEvent$1<T>>;
1691
- export type TouchEventHandler<T = Element> = EventHandler<T, TouchEvent$1<T>>;
1692
- export type PointerEventHandler<T = Element> = EventHandler<T, PointerEvent$1<T>>;
1693
- export type UIEventHandler<T = Element> = EventHandler<T, UIEvent$1<T>>;
1694
- export type WheelEventHandler<T = Element> = EventHandler<T, WheelEvent$1<T>>;
1695
- export type AnimationEventHandler<T = Element> = EventHandler<T, AnimationEvent$1<T>>;
1696
- export type TransitionEventHandler<T = Element> = EventHandler<T, TransitionEvent$1<T>>;
1697
- export type PossibleEventTarget = EventTarget & (Element | Document | Window);
1698
-
1699
- export {
1700
- AnimationEvent$1 as AnimationEvent,
1701
- ClipboardEvent$1 as ClipboardEvent,
1702
- CompositionEvent$1 as CompositionEvent,
1703
- DragEvent$1 as DragEvent,
1704
- FocusEvent$1 as FocusEvent,
1705
- KeyboardEvent$1 as KeyboardEvent,
1706
- MouseEvent$1 as MouseEvent,
1707
- PointerEvent$1 as PointerEvent,
1708
- TouchEvent$1 as TouchEvent,
1709
- TransitionEvent$1 as TransitionEvent,
1710
- UIEvent$1 as UIEvent,
1711
- WheelEvent$1 as WheelEvent,
1712
- addEventListener$1 as addEventListener,
1713
- dispatchEvent$1 as dispatchEvent,
1714
- focus$1 as focus,
1715
- removeEventListener$1 as removeEventListener,
1716
- };
1717
-
1718
- export as namespace SHORTY;
1719
-
1720
- export {};
1
+ import { version } from '../package.json';
2
+
3
+ /**
4
+ * A global namespace for `abort` event.
5
+ */
6
+ export declare const abortEvent = "abort";
7
+
8
+ declare interface AbstractView {
9
+ styleMedia: StyleMedia;
10
+ document: Document;
11
+ }
12
+
13
+ /**
14
+ * Add one or more CSS classes to `HTMLElement.classList`.
15
+ *
16
+ * @param element target
17
+ * @param classNAME to add
18
+ */
19
+ export declare const addClass: (element: HTMLElement, ...classNAME: string[]) => void;
20
+
21
+ /**
22
+ * A global namespace for 'addEventListener' string.
23
+ */
24
+ declare const addEventListener_2 = "addEventListener";
25
+ export { addEventListener_2 as addEventListener }
26
+
27
+ /**
28
+ * A global namespace for 'animationDelay' string.
29
+ */
30
+ export declare const animationDelay = "animationDelay";
31
+
32
+ /**
33
+ * A global namespace for 'animationDuration' string.
34
+ */
35
+ export declare const animationDuration = "animationDuration";
36
+
37
+ /**
38
+ * A global namespace for 'animationend' string.
39
+ */
40
+ export declare const animationEndEvent = "animationend";
41
+
42
+ declare interface AnimationEvent_2<T = Element>
43
+ extends NativeEvent<T, NativeAnimationEvent> {
44
+ animationName: string;
45
+ elapsedTime: number;
46
+ pseudoElement: string;
47
+ }
48
+ export { AnimationEvent_2 as AnimationEvent }
49
+
50
+ export declare type AnimationEventHandler<T = Element> = EventHandler<T, AnimationEvent_2<T>>;
51
+
52
+ /**
53
+ * A global namespace for 'animationName' string.
54
+ */
55
+ export declare const animationName = "animationName";
56
+
57
+ /**
58
+ * A global namespace for aria-checked.
59
+ */
60
+ export declare const ariaChecked = "aria-checked";
61
+
62
+ /**
63
+ * A global namespace for aria-describedby.
64
+ */
65
+ export declare const ariaDescribedBy = "aria-describedby";
66
+
67
+ /**
68
+ * A global namespace for aria-description.
69
+ */
70
+ export declare const ariaDescription = "aria-description";
71
+
72
+ /**
73
+ * A global namespace for aria-expanded.
74
+ */
75
+ export declare const ariaExpanded = "aria-expanded";
76
+
77
+ /**
78
+ * A global namespace for aria-haspopup.
79
+ */
80
+ export declare const ariaHasPopup = "aria-haspopup";
81
+
82
+ /**
83
+ * A global namespace for aria-hidden.
84
+ */
85
+ export declare const ariaHidden = "aria-hidden";
86
+
87
+ /**
88
+ * A global namespace for aria-label.
89
+ */
90
+ export declare const ariaLabel = "aria-label";
91
+
92
+ /**
93
+ * A global namespace for aria-labelledby.
94
+ */
95
+ export declare const ariaLabelledBy = "aria-labelledby";
96
+
97
+ /**
98
+ * A global namespace for aria-modal.
99
+ */
100
+ export declare const ariaModal = "aria-modal";
101
+
102
+ /**
103
+ * A global namespace for aria-pressed.
104
+ */
105
+ export declare const ariaPressed = "aria-pressed";
106
+
107
+ /**
108
+ * A global namespace for aria-selected.
109
+ */
110
+ export declare const ariaSelected = "aria-selected";
111
+
112
+ /**
113
+ * A global namespace for aria-valuemax.
114
+ */
115
+ export declare const ariaValueMax = "aria-valuemax";
116
+
117
+ /**
118
+ * A global namespace for aria-valuemin.
119
+ */
120
+ export declare const ariaValueMin = "aria-valuemin";
121
+
122
+ /**
123
+ * A global namespace for aria-valuenow.
124
+ */
125
+ export declare const ariaValueNow = "aria-valuenow";
126
+
127
+ /**
128
+ * A global namespace for aria-valuetext.
129
+ */
130
+ export declare const ariaValueText = "aria-valuetext";
131
+
132
+ /**
133
+ * Shortie for `Array.from()` static method.
134
+ * The utility should also work with any typed arrays
135
+ * like Float64Array or Int32Array.
136
+ *
137
+ * @param arr array-like iterable object
138
+ * @returns a new array from iterable object
139
+ */
140
+ export declare const ArrayFrom: <T>(arr: ArrayLike<T> | Iterable<T>) => T[];
141
+
142
+ declare interface BaseEvent<E = Event, C = unknown, T = unknown> {
143
+ nativeEvent: E;
144
+ currentTarget: C | null;
145
+ target: T & EventTarget;
146
+ bubbles: boolean;
147
+ cancelable: boolean;
148
+ defaultPrevented: boolean;
149
+ eventPhase: number;
150
+ isTrusted: boolean;
151
+ preventDefault(): void;
152
+ isDefaultPrevented(): boolean;
153
+ stopPropagation(): void;
154
+ isPropagationStopped(): boolean;
155
+ persist(): void;
156
+ timeStamp: number;
157
+ type: string;
158
+ }
159
+
160
+ /**
161
+ * A global namespace for `beforeunload` event.
162
+ */
163
+ export declare const beforeunloadEvent = "beforeunload";
164
+
165
+ /**
166
+ * A global namespace for predefined
167
+ * CSS3 'cubic-bezier()' easing functions.
168
+ */
169
+ export declare const bezierEasings: {
170
+ linear: string;
171
+ easingSinusoidalIn: string;
172
+ easingSinusoidalOut: string;
173
+ easingSinusoidalInOut: string;
174
+ easingQuadraticIn: string;
175
+ easingQuadraticOut: string;
176
+ easingQuadraticInOut: string;
177
+ easingCubicIn: string;
178
+ easingCubicOut: string;
179
+ easingCubicInOut: string;
180
+ easingQuarticIn: string;
181
+ easingQuarticOut: string;
182
+ easingQuarticInOut: string;
183
+ easingQuinticIn: string;
184
+ easingQuinticOut: string;
185
+ easingQuinticInOut: string;
186
+ easingExponentialIn: string;
187
+ easingExponentialOut: string;
188
+ easingExponentialInOut: string;
189
+ easingCircularIn: string;
190
+ easingCircularOut: string;
191
+ easingCircularInOut: string;
192
+ easingBackIn: string;
193
+ easingBackOut: string;
194
+ easingBackInOut: string;
195
+ };
196
+
197
+ /**
198
+ * A global namespace for `blur` event.
199
+ */
200
+ export declare const blurEvent = "blur";
201
+
202
+ export declare interface BoundingClientRect {
203
+ width: number;
204
+ height: number;
205
+ top: number;
206
+ left: number;
207
+ right: number;
208
+ bottom: number;
209
+ x: number;
210
+ y: number;
211
+ }
212
+
213
+ export declare interface ChangeEvent<T = FormControl> extends FormEvent<T> {
214
+ target: EventTarget & T;
215
+ }
216
+
217
+ /**
218
+ * A global namespace for `change` event.
219
+ */
220
+ export declare const changeEvent = "change";
221
+
222
+ export declare type ChangeEventHandler<T = Element> = EventHandler<T, ChangeEvent<T>>;
223
+
224
+ declare interface ClipboardEvent_2<T = Element>
225
+ extends NativeEvent<T, NativeClipboardEvent> {
226
+ clipboardData: DataTransfer;
227
+ }
228
+ export { ClipboardEvent_2 as ClipboardEvent }
229
+
230
+ export declare type ClipboardEventHandler<T = Element> = EventHandler<T, ClipboardEvent_2<T>>;
231
+
232
+ /**
233
+ * Shortcut for `HTMLElement.closest` method which also works
234
+ * with children of `ShadowRoot`. The order of the parameters
235
+ * is intentional since they're both required.
236
+ *
237
+ * @see https://stackoverflow.com/q/54520554/803358
238
+ *
239
+ * @param element Element to look into
240
+ * @param selector the selector name
241
+ * @return the query result
242
+ */
243
+ export declare const closest: <T extends Element = HTMLElement>(element: T, selector: string) => HTMLElement | null;
244
+
245
+ declare interface CompositionEvent_2<T = Element>
246
+ extends NativeEvent<T, NativeCompositionEvent> {
247
+ data: string;
248
+ }
249
+ export { CompositionEvent_2 as CompositionEvent }
250
+
251
+ export declare type CompositionEventHandler<T = Element> = EventHandler<
252
+ T,
253
+ CompositionEvent_2<T>
254
+ >;
255
+
256
+ /**
257
+ * A global namespace for `contextmenu` event.
258
+ */
259
+ export declare const contextmenuEvent = "contextmenu";
260
+
261
+ /**
262
+ * Returns a namespaced `CustomEvent` specific to each component.
263
+ *
264
+ * @param eventType Event.type
265
+ * @param config Event.options | Event.properties
266
+ * @returns a new namespaced event
267
+ */
268
+ export declare const createCustomEvent: <O extends unknown & Record<string, unknown>, T extends OriginalEvent>(eventType: string, config?: O) => T;
269
+
270
+ /**
271
+ * Shortie for `document.createElement` method
272
+ * which allows you to create a new `HTMLElement` for a given `tagName`
273
+ * or based on an object with specific non-readonly attributes with string values:
274
+ * `id`, `className`, `textContent`, `style`, etc.
275
+ *
276
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
277
+ *
278
+ * @param param `tagName` or object
279
+ * @return a new `HTMLElement`
280
+ */
281
+ export declare const createElement: <T extends HTMLElement>(param?: string | Partial<T>) => T | undefined;
282
+
283
+ /**
284
+ * Shortie for `document.createElementNS` method
285
+ * which allows you to create a new `HTMLElement` for a given `tagName`
286
+ * or based on an object with specific non-readonly attributes with string values:
287
+ * `id`, `className`, `textContent`, `style`, etc.
288
+ * Note: some elements resulted from this function call may not be compatible with
289
+ * some attributes.
290
+ *
291
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS
292
+ *
293
+ * @param ns `namespaceURI` to associate with the new `HTMLElement`
294
+ * @param param `tagName` or object
295
+ * @return a new `HTMLElement`
296
+ */
297
+ export declare const createElementNS: <T extends Element = HTMLElement>(ns: string, param?: string | Partial<T>) => T | undefined;
298
+
299
+ export declare interface CSS4Declaration
300
+ extends Exclude<() => string | symbol, CSSStyleDeclaration> {
301
+ [key: string]: string;
302
+ }
303
+
304
+ export declare interface CustomElement extends HTMLElement {
305
+ shadowRoot: ShadowRoot;
306
+ connectedCallback?: () => void;
307
+ disconnectedCallback?: () => void;
308
+ adoptedCallback?: () => void;
309
+ attributeChangedCallback?: () => void;
310
+ // [key: PropertyKey]: any;
311
+ }
312
+
313
+ /**
314
+ * An interface for web components background data.
315
+ *
316
+ * @see https://github.com/thednp/bootstrap.native/blob/master/src/components/base-component.js
317
+ */
318
+ export declare const Data: {
319
+ data: Map<string, Map<HTMLElement, unknown>>;
320
+ /**
321
+ * Sets web components data.
322
+ *
323
+ * @param element target element
324
+ * @param component the component's name or a unique key
325
+ * @param instance the component instance
326
+ */
327
+ set: <T>(element: HTMLElement, component: string, instance: T) => void;
328
+ /**
329
+ * Returns all instances for specified component.
330
+ *
331
+ * @param component the component's name or a unique key
332
+ * @returns all the component instances
333
+ */
334
+ getAllFor: <T>(component: string) => Map<HTMLElement, T> | null;
335
+ /**
336
+ * Returns the instance associated with the target.
337
+ *
338
+ * @param element target element
339
+ * @param component the component's name or a unique key
340
+ * @returns the instance
341
+ */
342
+ get: <T>(element: HTMLElement, component: string) => T | null;
343
+ /**
344
+ * Removes web components data.
345
+ *
346
+ * @param element target element
347
+ * @param component the component's name or a unique key
348
+ */
349
+ remove: <T>(element: HTMLElement, component: string) => void;
350
+ };
351
+
352
+ /**
353
+ * Shortcut for the `Element.dispatchEvent(Event)` method.
354
+ *
355
+ * @param element is the target
356
+ * @param event is the `Event` object
357
+ */
358
+ declare const dispatchEvent_2: (element: EventTarget, event: Event) => boolean;
359
+ export { dispatchEvent_2 as dispatchEvent }
360
+
361
+ /**
362
+ * JavaScript `Array` distinct.
363
+ *
364
+ * @see https://codeburst.io/javascript-array-distinct-5edc93501dc4
365
+ *
366
+ * @example
367
+ * ```
368
+ * [0,1,1,2].filter(distinct)
369
+ * // => [0,1,2]
370
+ * ```
371
+ * @param value array item value
372
+ * @param index array item index
373
+ * @param arr a clone of the target array
374
+ * @returns the query result
375
+ */
376
+ export declare const distinct: <T>(value: T, index: number, arr: T[]) => boolean;
377
+
378
+ /**
379
+ * A global namespace for `document.body`.
380
+ */
381
+ export declare const documentBody: HTMLElement;
382
+
383
+ /**
384
+ * A global namespace for `document.documentElement` or the `<HTML>`.
385
+ */
386
+ export declare const documentElement: HTMLElement;
387
+
388
+ /**
389
+ * A global namespace for `document.head`.
390
+ */
391
+ export declare const documentHead: HTMLHeadElement;
392
+
393
+ /**
394
+ * A global namespace for `DOMContentLoaded` event.
395
+ */
396
+ export declare const DOMContentLoadedEvent = "DOMContentLoaded";
397
+
398
+ /**
399
+ * A global namespace for `DOMMouseScroll` event.
400
+ */
401
+ export declare const DOMMouseScrollEvent = "DOMMouseScroll";
402
+
403
+ /**
404
+ * A global namespace for `dragend` event.
405
+ */
406
+ export declare const dragendEvent = "dragend";
407
+
408
+ /**
409
+ * A global namespace for `dragenter` event.
410
+ */
411
+ export declare const dragenterEvent = "dragenter";
412
+
413
+ /**
414
+ * A global namespace for `drag` event.
415
+ */
416
+ export declare const dragEvent = "drag";
417
+
418
+ declare interface DragEvent_2<T = Element> extends MouseEvent_2<T, NativeDragEvent> {
419
+ dataTransfer: DataTransfer;
420
+ }
421
+ export { DragEvent_2 as DragEvent }
422
+
423
+ export declare type DragEventHandler<T = Element> = EventHandler<T, DragEvent_2<T>>;
424
+
425
+ /**
426
+ * A global namespace for `dragleave` event.
427
+ */
428
+ export declare const dragleaveEvent = "dragleave";
429
+
430
+ /**
431
+ * A global namespace for `dragover` event.
432
+ */
433
+ export declare const dragoverEvent = "dragover";
434
+
435
+ /**
436
+ * A global namespace for `dragstart` event.
437
+ */
438
+ export declare const dragstartEvent = "dragstart";
439
+
440
+ /**
441
+ * Utility to make sure callbacks are consistently
442
+ * called when animation ends.
443
+ *
444
+ * @param element target
445
+ * @param handler `animationend` callback
446
+ */
447
+ export declare const emulateAnimationEnd: (element: HTMLElement, handler: EventListener) => void;
448
+
449
+ /**
450
+ * Utility to make sure callbacks are consistently
451
+ * called when transition ends.
452
+ *
453
+ * @param element event target
454
+ * @param handler `transitionend` callback
455
+ */
456
+ export declare const emulateTransitionEnd: (element: HTMLElement, handler: EventListener) => void;
457
+
458
+ /**
459
+ * A global namespace for `error` event.
460
+ */
461
+ export declare const errorEvent = "error";
462
+
463
+ declare type EventHandler<T = Element, E = Event | NativeEvent<T>> = (event: E) => void;
464
+
465
+ /**
466
+ * Shortcut for `Float32Array.from()` static method.
467
+ *
468
+ * @param arr array-like iterable object
469
+ * @returns a new Float32Array
470
+ */
471
+ export declare const Float32ArrayFrom: (arr: ArrayLike<number> | Iterable<number>) => Float32Array;
472
+
473
+ /**
474
+ * Shortcut for `Float64Array.from()` static method.
475
+ *
476
+ * @param arr array-like iterable object
477
+ * @returns a new Float64Array
478
+ */
479
+ export declare const Float64ArrayFrom: (arr: ArrayLike<number> | Iterable<number>) => Float64Array;
480
+
481
+ declare type Fn = (...args: unknown[]) => unknown;
482
+
483
+ /**
484
+ * Shortie for `HTMLElement.focus()` method.
485
+ *
486
+ * @param element is the target
487
+ * @param options allows to pass additional options such as `preventScroll: boolean`
488
+ */
489
+ declare const focus_2: (element: HTMLOrSVGElement, options?: FocusOptions) => void;
490
+ export { focus_2 as focus }
491
+
492
+ export declare type FocusableElement = HTMLAnchorElement | HTMLButtonElement | HTMLInputElement | HTMLTextAreaElement | HTMLDataListElement | HTMLDetailsElement | HTMLSelectElement;
493
+
494
+ export declare const focusableSelector = "a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]";
495
+
496
+ /**
497
+ * A global namespace for `focus` event.
498
+ */
499
+ export declare const focusEvent = "focus";
500
+
501
+ declare interface FocusEvent_2<T = Element, R = Element>
502
+ extends NativeEvent<T, NativeFocusEvent> {
503
+ relatedTarget: (EventTarget & R) | null;
504
+ target: EventTarget & T;
505
+ }
506
+ export { FocusEvent_2 as FocusEvent }
507
+
508
+ export declare type FocusEventHandler<T = Element> = EventHandler<T, FocusEvent_2<T>>;
509
+
510
+ /**
511
+ * A global namespace for focus event names.
512
+ */
513
+ export declare const focusEvents: {
514
+ in: string;
515
+ out: string;
516
+ };
517
+
518
+ /**
519
+ * A global namespace for `focusin` event.
520
+ */
521
+ export declare const focusinEvent = "focusin";
522
+
523
+ /**
524
+ * A global namespace for `focusout` event.
525
+ */
526
+ export declare const focusoutEvent = "focusout";
527
+
528
+ declare type FormControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
529
+
530
+ export declare type FormEvent<T = FormControl> = NativeEvent<T>;
531
+
532
+ export declare type FormEventHandler<T = Element> = EventHandler<T, FormEvent<T>>;
533
+
534
+ /**
535
+ * A global namespace for `gesturechange` event.
536
+ */
537
+ export declare const gesturechangeEvent = "gesturechange";
538
+
539
+ /**
540
+ * A global namespace for `gestureend` event.
541
+ */
542
+ export declare const gestureendEvent = "gestureend";
543
+
544
+ /**
545
+ * A global namespace for `gesturestart` event.
546
+ */
547
+ export declare const gesturestartEvent = "gesturestart";
548
+
549
+ /**
550
+ * Shortcut for `HTMLElement.getAttribute()` method.
551
+ *
552
+ * @param element target element
553
+ * @param att attribute name
554
+ * @returns attribute value
555
+ */
556
+ export declare const getAttribute: (element: HTMLElement, att: string) => string | null;
557
+
558
+ /**
559
+ * Shortcut for `HTMLElement.getAttributeNS()` method.
560
+ *
561
+ * @param ns attribute namespace
562
+ * @param element target element
563
+ * @param att attribute name
564
+ * @returns attribute value
565
+ */
566
+ export declare const getAttributeNS: (ns: string, element: HTMLElement, att: string) => string | null;
567
+
568
+ /**
569
+ * Returns the bounding client rect of a target `HTMLElement`.
570
+ *
571
+ * @see https://github.com/floating-ui/floating-ui
572
+ *
573
+ * @param element event.target
574
+ * @param includeScale when *true*, the target scale is also computed
575
+ * @returns the bounding client rect object
576
+ */
577
+ export declare const getBoundingClientRect: (element: HTMLElement, includeScale?: boolean) => BoundingClientRect;
578
+
579
+ /**
580
+ * Returns an `Array` of `Node` elements that are registered as
581
+ * `CustomElement`.
582
+ *
583
+ * @see https://stackoverflow.com/questions/27334365/how-to-get-list-of-registered-custom-elements
584
+ *
585
+ * @param parent parent to look into
586
+ * @returns the query result
587
+ */
588
+ export declare const getCustomElements: (parent?: ParentNode) => CustomElement[];
589
+
590
+ /**
591
+ * Returns the `document` or the `#document` element.
592
+ *
593
+ * @see https://github.com/floating-ui/floating-ui
594
+ *
595
+ * @param node the reference node
596
+ * @returns the parent document of the given node
597
+ */
598
+ export declare const getDocument: (node?: Node | Document | Window) => Document;
599
+
600
+ /**
601
+ * Returns the `document.body` or the `<body>` element.
602
+ *
603
+ * @param node the reference node
604
+ * @returns the parent `<body>` of the specified node
605
+ */
606
+ export declare const getDocumentBody: (node?: Node | Document | Window) => HTMLElement;
607
+
608
+ /**
609
+ * Returns the `document.documentElement` or the `<HTML>` element.
610
+ *
611
+ * @param node the reference node
612
+ * @returns the parent `<HTML>` of the node's parent document
613
+ */
614
+ export declare const getDocumentElement: (node?: Node | Document | Window) => HTMLElement;
615
+
616
+ /**
617
+ * Returns the `document.head` or the `<head>` element.
618
+ *
619
+ * @param node the reference node
620
+ * @returns the `<head>` of the node's parent document
621
+ */
622
+ export declare const getDocumentHead: (node?: Node | Document | Window) => HTMLElement & HTMLHeadElement;
623
+
624
+ /**
625
+ * Utility to get the computed `animationDelay`
626
+ * from Element in miliseconds.
627
+ *
628
+ * @param element target
629
+ * @return the `animationDelay` value in miliseconds
630
+ */
631
+ export declare const getElementAnimationDelay: (element: HTMLElement) => number;
632
+
633
+ /**
634
+ * Utility to get the computed `animationDuration`
635
+ * from `HTMLElement` in miliseconds.
636
+ *
637
+ * @param element target
638
+ * @return the `animationDuration` value in miliseconds
639
+ */
640
+ export declare const getElementAnimationDuration: (element: HTMLElement) => number;
641
+
642
+ /**
643
+ * Returns an `HTMLElement` that matches the id in the document.
644
+ * Within multiple <iframe> elements, a `parent` parameter
645
+ * would decisively locate the correct element.
646
+ *
647
+ * @param id the ID selector
648
+ * @param context an element in it's document or document
649
+ * @returns the requested element
650
+ */
651
+ export declare const getElementById: <T extends HTMLElement>(id: string, context?: Node) => T;
652
+
653
+ /**
654
+ * Shortcut for `HTMLElement.getElementsByClassName` method. Some `Node` elements
655
+ * like `ShadowRoot` do not support `getElementsByClassName`.
656
+ *
657
+ * @param selector the class name
658
+ * @param parent optional Element to look into
659
+ * @return the 'HTMLCollection'
660
+ */
661
+ export declare const getElementsByClassName: <T extends HTMLElement>(selector: string, parent?: ParentNode) => HTMLCollectionOf<T>;
662
+
663
+ /**
664
+ * Shortcut for `HTMLElement.getElementsByTagName` method. Some `Node` elements
665
+ * like `ShadowRoot` do not support `getElementsByTagName`.
666
+ *
667
+ * @param selector the tag name
668
+ * @param parent optional Element to look into
669
+ * @return the 'HTMLCollection'
670
+ */
671
+ export declare const getElementsByTagName: <T extends HTMLElement>(selector: string, parent?: ParentNode) => HTMLCollectionOf<T>;
672
+
673
+ /**
674
+ * Shortcut for `window.getComputedStyle(element).propertyName`
675
+ * static method.
676
+ *
677
+ * * If `element` parameter is not an `HTMLElement`, `getComputedStyle`
678
+ * throws a `ReferenceError`.
679
+ *
680
+ * @param element target
681
+ * @param property the css property
682
+ * @return the css property value
683
+ */
684
+ export declare const getElementStyle: (element: HTMLElement, property: string) => string;
685
+
686
+ /**
687
+ * Utility to get the computed `transitionDelay`
688
+ * from Element in miliseconds.
689
+ *
690
+ * @param element target
691
+ * @return the `transitionDelay` value in miliseconds
692
+ */
693
+ export declare const getElementTransitionDelay: (element: HTMLElement) => number;
694
+
695
+ /**
696
+ * Utility to get the computed `transitionDuration`
697
+ * from Element in miliseconds.
698
+ *
699
+ * @param element target
700
+ * @return the `transitionDuration` value in miliseconds
701
+ */
702
+ export declare const getElementTransitionDuration: (element: HTMLElement) => number;
703
+
704
+ /**
705
+ * An alias for `Data.get()`.
706
+ */
707
+ export declare const getInstance: <T>(target: HTMLElement, component: string) => T | null;
708
+
709
+ /**
710
+ * Returns an `{x,y}` object with the target
711
+ * `HTMLElement` / `Node` scroll position.
712
+ *
713
+ * @see https://github.com/floating-ui/floating-ui
714
+ *
715
+ * @param element target node / element
716
+ * @returns the scroll tuple
717
+ */
718
+ export declare const getNodeScroll: (element: HTMLElement | Window) => {
719
+ x: number;
720
+ y: number;
721
+ };
722
+
723
+ /**
724
+ * Returns the `parentNode` also going through `ShadowRoot`.
725
+ *
726
+ * @see https://github.com/floating-ui/floating-ui
727
+ *
728
+ * @param {Node} node the target node
729
+ * @returns {Node} the apropriate parent node
730
+ */
731
+ export declare const getParentNode: (node: Node) => Node | ParentNode;
732
+
733
+ /**
734
+ * Returns the rect relative to a given offset parent and its scroll position.
735
+ *
736
+ * @see https://github.com/floating-ui/floating-ui
737
+ *
738
+ * @param element target
739
+ * @param offsetParent the container / offset parent
740
+ * @param scroll the offsetParent scroll position
741
+ * @returns a DOMRect like object
742
+ */
743
+ export declare const getRectRelativeToOffsetParent: (element: HTMLElement, offsetParent: HTMLElement, scroll: {
744
+ x: number;
745
+ y: number;
746
+ }) => OffsetRect;
747
+
748
+ /**
749
+ * Returns a unique identifier for popover, tooltip, scrollspy.
750
+ *
751
+ * @param element target element
752
+ * @param key optional identifier key
753
+ * @returns an existing or new unique ID
754
+ */
755
+ export declare const getUID: (element: HTMLElement, key?: string) => number;
756
+
757
+ /**
758
+ * Returns the `Window` object of a target node.
759
+ *
760
+ * @see https://github.com/floating-ui/floating-ui
761
+ *
762
+ * @param node target node
763
+ * @returns the `Window` object
764
+ */
765
+ export declare const getWindow: (node?: Node) => Window;
766
+
767
+ /**
768
+ * Shortcut for `HTMLElement.hasAttribute()` method.
769
+ *
770
+ * @param element target element
771
+ * @param att attribute name
772
+ * @returns the query result
773
+ */
774
+ export declare const hasAttribute: (element: HTMLElement, att: string) => boolean;
775
+
776
+ /**
777
+ * Shortcut for `HTMLElement.hasAttributeNS()` method.
778
+ *
779
+ * @param ns attribute namespace
780
+ * @param element target element
781
+ * @param att attribute name
782
+ * @returns the query result
783
+ */
784
+ export declare const hasAttributeNS: (ns: string, element: HTMLElement, att: string) => boolean;
785
+
786
+ /**
787
+ * Check class in `HTMLElement.classList`.
788
+ *
789
+ * @param element target
790
+ * @param classNAME to check
791
+ */
792
+ export declare const hasClass: (element: HTMLElement, classNAME: string) => boolean;
793
+
794
+ /**
795
+ * Utility to check if a designated element is affected by focus trap;
796
+ * @param target
797
+ */
798
+ export declare const hasFocusTrap: (target: HTMLElement) => boolean;
799
+
800
+ /**
801
+ * A global `boolean` getter for Apple browsers.
802
+ */
803
+ export declare const isApple: () => boolean;
804
+
805
+ /**
806
+ * Shortie for the `Array.isArray()` static method.
807
+ *
808
+ * @param obj array-like iterable object
809
+ * @returns the query result
810
+ */
811
+ export declare const isArray: (obj?: unknown) => obj is unknown[];
812
+
813
+ /**
814
+ * Checks if an element is an `HTMLCanvasElement` or `<canvas>`.
815
+ *
816
+ * @param element the target element
817
+ * @returns the query result
818
+ */
819
+ export declare const isCanvas: (element?: unknown) => element is HTMLCanvasElement;
820
+
821
+ /**
822
+ * Checks if an object is a `CustomElement`.
823
+ *
824
+ * @param element the target object
825
+ * @returns the query result
826
+ */
827
+ export declare const isCustomElement: <T extends CustomElement>(element?: unknown) => element is T;
828
+
829
+ /**
830
+ * Checks if an object is a `Document`.
831
+ *
832
+ * @see https://dom.spec.whatwg.org/#node
833
+ *
834
+ * @param obj the target object
835
+ * @returns the query result
836
+ */
837
+ export declare const isDocument: (obj?: unknown) => obj is Document;
838
+
839
+ /**
840
+ * Checks if an object is an `Element`.
841
+ *
842
+ * @see https://dom.spec.whatwg.org/#node
843
+ *
844
+ * ```
845
+ * ELEMENT_NODE = 1;
846
+ * ATTRIBUTE_NODE = 2;
847
+ * TEXT_NODE = 3;
848
+ * CDATA_SECTION_NODE = 4;
849
+ * ENTITY_REFERENCE_NODE = 5; // legacy
850
+ * ENTITY_NODE = 6; // legacy
851
+ * PROCESSING_INSTRUCTION_NODE = 7;
852
+ * COMMENT_NODE = 8;
853
+ * DOCUMENT_NODE = 9;
854
+ * DOCUMENT_TYPE_NODE = 10;
855
+ * DOCUMENT_FRAGMENT_NODE = 11;
856
+ * ```
857
+ * @param element the target object
858
+ * @returns the query result
859
+ */
860
+ export declare const isElement: (element?: unknown) => element is Element;
861
+
862
+ /**
863
+ * Utility to determine if an `HTMLElement`
864
+ * is partially visible in viewport.
865
+ *
866
+ * @param element target
867
+ * @return the query result
868
+ */
869
+ export declare const isElementInScrollRange: (element?: HTMLElement) => boolean;
870
+
871
+ /**
872
+ * Utility to determine if an `HTMLElement`
873
+ * is fully visible in the viewport.
874
+ *
875
+ * @param element target
876
+ * @return the query result
877
+ */
878
+ export declare const isElementInViewport: (element?: HTMLElement) => boolean;
879
+
880
+ /**
881
+ * Checks if an object is an `Array` in which all items are `Element`.
882
+ *
883
+ * @param obj the target object
884
+ * @returns the query result
885
+ */
886
+ export declare const isElementsArray: (obj?: unknown) => obj is HTMLElement[];
887
+
888
+ /**
889
+ * A global boolean for Gecko browsers. When writing this file,
890
+ * Gecko was not supporting `userAgentData`.
891
+ */
892
+ export declare const isFirefox: () => boolean;
893
+
894
+ /**
895
+ * Checks if an object is a `Function`.
896
+ *
897
+ * @param fn the target object
898
+ * @returns the query result
899
+ */
900
+ export declare const isFunction: (fn?: unknown) => fn is Fn;
901
+
902
+ /**
903
+ * Checks if an object is an `HTMLCollection`.
904
+ *
905
+ * @param obj the target object
906
+ * @returns the query result
907
+ */
908
+ export declare const isHTMLCollection: (obj?: unknown) => obj is HTMLCollection;
909
+
910
+ /**
911
+ * Checks if an element is an `HTMLElement`.
912
+ *
913
+ * @see https://dom.spec.whatwg.org/#node
914
+ *
915
+ * @param element the target object
916
+ * @returns the query result
917
+ */
918
+ export declare const isHTMLElement: (element?: unknown) => element is HTMLElement;
919
+
920
+ /**
921
+ * Check if a target element is an `<img>`.
922
+ *
923
+ * @param element the target element
924
+ * @returns the query result
925
+ */
926
+ export declare const isHTMLImageElement: (element?: unknown) => element is HTMLImageElement;
927
+
928
+ /**
929
+ * Checks if a string is a `JSON` string.
930
+ *
931
+ * @param str the target string
932
+ * @returns the query result
933
+ */
934
+ export declare const isJSON: (str?: string) => boolean;
935
+
936
+ /**
937
+ * Checks if an element is a `Map`.
938
+ *
939
+ * @param obj the target object
940
+ * @returns the query result
941
+ */
942
+ export declare const isMap: (obj?: unknown) => obj is Map<unknown, unknown>;
943
+
944
+ /**
945
+ * Checks if an element is an `<svg>` (or any type of SVG element),
946
+ * `<img>`, `<video>` or `<canvas>`.
947
+ *
948
+ * *Tooltip* / *Popover* works different with media elements.
949
+ *
950
+ * @param element the target element
951
+ * @returns the query result
952
+ */
953
+ export declare const isMedia: (element?: unknown) => element is SVGElement | HTMLImageElement | HTMLVideoElement | HTMLCanvasElement;
954
+
955
+ /**
956
+ * A global `boolean` for mobile detection.
957
+ */
958
+ export declare const isMobile: () => boolean;
959
+
960
+ /**
961
+ * Checks if an object is a `Node`.
962
+ *
963
+ * @param node the target object
964
+ * @returns the query result
965
+ */
966
+ export declare const isNode: (node?: unknown) => node is Node;
967
+
968
+ /**
969
+ * Checks if an object is a `NodeList`.
970
+ * => equivalent to `object instanceof NodeList`
971
+ *
972
+ * @param obj the target object
973
+ * @returns the query result
974
+ */
975
+ export declare const isNodeList: (obj?: unknown) => obj is NodeList;
976
+
977
+ /**
978
+ * Shortie for `typeof SOMETHING === "number"`.
979
+ *
980
+ * @param num input value
981
+ * @returns the query result
982
+ */
983
+ export declare const isNumber: (num?: unknown) => num is number;
984
+
985
+ /**
986
+ * Checks if a value is an `Object`.
987
+ *
988
+ * @param obj the target object
989
+ * @returns the query result
990
+ */
991
+ export declare const isObject: (obj?: unknown) => obj is object;
992
+
993
+ /**
994
+ * Checks if a page is Right To Left.
995
+ *
996
+ * @param node the target
997
+ * @returns the query result
998
+ */
999
+ export declare const isRTL: (node?: Node) => boolean;
1000
+
1001
+ /**
1002
+ * Checks if a target `HTMLElement` is affected by scale.
1003
+ *
1004
+ * @see https://github.com/floating-ui/floating-ui
1005
+ *
1006
+ * @param element target
1007
+ * @returns the query result
1008
+ */
1009
+ export declare const isScaledElement: (element?: HTMLElement) => boolean;
1010
+
1011
+ /**
1012
+ * Check if target is a `ShadowRoot`.
1013
+ *
1014
+ * @param element target
1015
+ * @returns the query result
1016
+ */
1017
+ export declare const isShadowRoot: (element?: unknown) => element is ShadowRoot;
1018
+
1019
+ /**
1020
+ * Shortie for `typeof SOMETHING === "string"`.
1021
+ *
1022
+ * @param str input value
1023
+ * @returns the query result
1024
+ */
1025
+ export declare const isString: (str?: unknown) => str is string;
1026
+
1027
+ /**
1028
+ * Check if an element is an `<svg>` or any other SVG element,
1029
+ * an equivalent to `SOMETHING instanceof SVGElement`.
1030
+ *
1031
+ * @param element the target element
1032
+ * @returns the query result
1033
+ */
1034
+ export declare const isSVGElement: (element?: unknown) => element is SVGElement;
1035
+
1036
+ /**
1037
+ * Check if a target element is a `<table>`, `<td>` or `<th>`.
1038
+ * This specific check is important for determining
1039
+ * the `offsetParent` of a given element.
1040
+ *
1041
+ * @param element the target element
1042
+ * @returns the query result
1043
+ */
1044
+ export declare const isTableElement: (element?: unknown) => element is HTMLTableElement | HTMLTableCellElement;
1045
+
1046
+ /**
1047
+ * Checks if an element is a `WeakMap`.
1048
+ *
1049
+ * @param obj the target object
1050
+ * @returns the query result
1051
+ */
1052
+ export declare const isWeakMap: (obj?: unknown) => obj is WeakMap<WeakKey, unknown>;
1053
+
1054
+ /**
1055
+ * Check if a target object is `Window`.
1056
+ * => equivalent to `object instanceof Window`
1057
+ *
1058
+ * @param obj the target object
1059
+ * @returns the query result
1060
+ */
1061
+ export declare const isWindow: (obj?: unknown) => obj is Window;
1062
+
1063
+ /**
1064
+ * A global namespace for `Alt` key.
1065
+ * e.which = 18
1066
+ */
1067
+ export declare const keyAlt = "Alt";
1068
+
1069
+ /**
1070
+ * A global namespace for `ArrowDown` key.
1071
+ * e.which = 40 equivalent
1072
+ */
1073
+ export declare const keyArrowDown = "ArrowDown";
1074
+
1075
+ /**
1076
+ * A global namespace for `ArrowLeft` key.
1077
+ * e.which = 37 equivalent
1078
+ */
1079
+ export declare const keyArrowLeft = "ArrowLeft";
1080
+
1081
+ /**
1082
+ * A global namespace for `ArrowRight` key.
1083
+ * e.which = 39 equivalent
1084
+ */
1085
+ export declare const keyArrowRight = "ArrowRight";
1086
+
1087
+ /**
1088
+ * A global namespace for `ArrowUp` key.
1089
+ * e.which = 38 equivalent
1090
+ */
1091
+ export declare const keyArrowUp = "ArrowUp";
1092
+
1093
+ /**
1094
+ * A global namespace for `Backspace` key.
1095
+ * e.which === 8 equivalent
1096
+ */
1097
+ export declare const keyBackspace = "Backspace";
1098
+
1099
+ declare interface KeyboardEvent_2<T = Element> extends UIEvent_2<T, NativeKeyboardEvent> {
1100
+ altKey: boolean;
1101
+ /** @deprecated */
1102
+ charCode: number;
1103
+ ctrlKey: boolean;
1104
+ code: string;
1105
+ /**
1106
+ * See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
1107
+ */
1108
+ getModifierState(key: ModifierKey): boolean;
1109
+ /**
1110
+ * See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
1111
+ */
1112
+ key: string;
1113
+ /** @deprecated */
1114
+ keyCode: number;
1115
+ locale: string;
1116
+ location: number;
1117
+ metaKey: boolean;
1118
+ repeat: boolean;
1119
+ shiftKey: boolean;
1120
+ /** @deprecated */
1121
+ which: number;
1122
+ }
1123
+ export { KeyboardEvent_2 as KeyboardEvent }
1124
+
1125
+ export declare type KeyboardEventHandler<T = Element> = EventHandler<T, KeyboardEvent_2<T>>;
1126
+
1127
+ /**
1128
+ * A global namespace for keyboard event keys.
1129
+ */
1130
+ export declare const keyboardEventKeys: {
1131
+ Backspace: string;
1132
+ Tab: string;
1133
+ Enter: string;
1134
+ Shift: string;
1135
+ Control: string;
1136
+ Alt: string;
1137
+ Pause: string;
1138
+ CapsLock: string;
1139
+ Escape: string;
1140
+ Scape: string;
1141
+ ArrowLeft: string;
1142
+ ArrowUp: string;
1143
+ ArrowRight: string;
1144
+ ArrowDown: string;
1145
+ Insert: string;
1146
+ Delete: string;
1147
+ Meta: string;
1148
+ ContextMenu: string;
1149
+ ScrollLock: string;
1150
+ };
1151
+
1152
+ /**
1153
+ * A global namespace for `CapsLock` key.
1154
+ * e.which = 20 equivalent
1155
+ */
1156
+ export declare const keyCapsLock = "CapsLock";
1157
+
1158
+ /**
1159
+ * A global namespace for `Control` key.
1160
+ * e.which = 17
1161
+ */
1162
+ export declare const keyControl = "Control";
1163
+
1164
+ /**
1165
+ * A global namespace for `Delete` key.
1166
+ * e.which = 46 equivalent
1167
+ */
1168
+ export declare const keyDelete = "Delete";
1169
+
1170
+ /**
1171
+ * A global namespace for `keydown` event.
1172
+ */
1173
+ export declare const keydownEvent = "keydown";
1174
+
1175
+ /**
1176
+ * A global namespace for `Enter` key.
1177
+ * e.which = 13 equivalent
1178
+ */
1179
+ export declare const keyEnter = "Enter";
1180
+
1181
+ /**
1182
+ * A global namespace for `Escape` key.
1183
+ * e.which = 27 equivalent
1184
+ */
1185
+ export declare const keyEscape = "Escape";
1186
+
1187
+ /**
1188
+ * A global namespace for `Insert` key.
1189
+ * e.which = 45 equivalent
1190
+ */
1191
+ export declare const keyInsert = "Insert";
1192
+
1193
+ /**
1194
+ * A global namespace for `Meta` key.
1195
+ * e.which = 93 equivalent
1196
+ */
1197
+ export declare const keyMeta = "Meta";
1198
+
1199
+ /**
1200
+ * A global namespace for `Enter` key.
1201
+ * e.which = 13 equivalent
1202
+ */
1203
+ export declare const keyNumpadEnter = "NumpadEnter";
1204
+
1205
+ /**
1206
+ * A global namespace for `Pause` key.
1207
+ * e.which = 19
1208
+ */
1209
+ export declare const keyPause = "Pause";
1210
+
1211
+ /**
1212
+ * A global namespace for `keypress` event.
1213
+ */
1214
+ export declare const keypressEvent = "keypress";
1215
+
1216
+ /**
1217
+ * A global namespace for `ScrollLock` key.
1218
+ * e.which = 145 equivalent
1219
+ */
1220
+ export declare const keyScrollLock = "ScrollLock";
1221
+
1222
+ /**
1223
+ * A global namespace for `Shift` key.
1224
+ * e.which = 16
1225
+ */
1226
+ export declare const keyShift = "Shift";
1227
+
1228
+ /**
1229
+ * A global namespace for `Space` key.
1230
+ * e.which = 32 equivalent
1231
+ */
1232
+ export declare const keySpace = "Space";
1233
+
1234
+ /**
1235
+ * A global namespace for `Tab` key.
1236
+ * e.which = 9 equivalent
1237
+ */
1238
+ export declare const keyTab = "Tab";
1239
+
1240
+ /**
1241
+ * A global namespace for `keyup` event.
1242
+ */
1243
+ export declare const keyupEvent = "keyup";
1244
+
1245
+ /**
1246
+ * A global namespace for `load` event.
1247
+ */
1248
+ export declare const loadEvent = "load";
1249
+
1250
+ /**
1251
+ * A global namespace for `loadstart` event.
1252
+ */
1253
+ export declare const loadstartEvent = "loadstart";
1254
+
1255
+ /**
1256
+ * Check if element matches a CSS selector.
1257
+ *
1258
+ * @param target the target element
1259
+ * @param selector the selector to match
1260
+ * @returns the query result
1261
+ */
1262
+ export declare const matches: (target: Element, selector: string) => boolean;
1263
+
1264
+ declare type ModifierKey =
1265
+ | "Alt"
1266
+ | "AltGraph"
1267
+ | "CapsLock"
1268
+ | "Control"
1269
+ | "Fn"
1270
+ | "FnLock"
1271
+ | "Hyper"
1272
+ | "Meta"
1273
+ | "NumLock"
1274
+ | "ScrollLock"
1275
+ | "Shift"
1276
+ | "Super"
1277
+ | "Symbol"
1278
+ | "SymbolLock";
1279
+
1280
+ /**
1281
+ * A global namespace for `click` event.
1282
+ */
1283
+ export declare const mouseclickEvent = "click";
1284
+
1285
+ /**
1286
+ * A global namespace for mouse click events.
1287
+ */
1288
+ export declare const mouseClickEvents: {
1289
+ down: string;
1290
+ up: string;
1291
+ };
1292
+
1293
+ /**
1294
+ * A global namespace for `dblclick` event.
1295
+ */
1296
+ export declare const mousedblclickEvent = "dblclick";
1297
+
1298
+ /**
1299
+ * A global namespace for `mousedown` event.
1300
+ */
1301
+ export declare const mousedownEvent = "mousedown";
1302
+
1303
+ /**
1304
+ * A global namespace for `mouseenter` event.
1305
+ */
1306
+ export declare const mouseenterEvent = "mouseenter";
1307
+
1308
+ declare interface MouseEvent_2<T = Element, E = NativeMouseEvent> extends UIEvent_2<T, E> {
1309
+ altKey: boolean;
1310
+ button: number;
1311
+ buttons: number;
1312
+ clientX: number;
1313
+ clientY: number;
1314
+ ctrlKey: boolean;
1315
+ /**
1316
+ * See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
1317
+ */
1318
+ getModifierState(key: ModifierKey): boolean;
1319
+ metaKey: boolean;
1320
+ movementX: number;
1321
+ movementY: number;
1322
+ pageX: number;
1323
+ pageY: number;
1324
+ relatedTarget: EventTarget | null;
1325
+ screenX: number;
1326
+ screenY: number;
1327
+ shiftKey: boolean;
1328
+ }
1329
+ export { MouseEvent_2 as MouseEvent }
1330
+
1331
+ export declare type MouseEventHandler<T = Element> = EventHandler<T, MouseEvent_2<T>>;
1332
+
1333
+ /**
1334
+ * A global namespace for `hover` event.
1335
+ */
1336
+ export declare const mousehoverEvent = "hover";
1337
+
1338
+ /**
1339
+ * A global namespace for mouse hover events.
1340
+ */
1341
+ export declare const mouseHoverEvents: string[];
1342
+
1343
+ /**
1344
+ * A global namespace for `mousein` event.
1345
+ */
1346
+ export declare const mouseinEvent = "mousein";
1347
+
1348
+ /**
1349
+ * A global namespace for `mouseleave` event.
1350
+ */
1351
+ export declare const mouseleaveEvent = "mouseleave";
1352
+
1353
+ /**
1354
+ * A global namespace for `mousemove` event.
1355
+ */
1356
+ export declare const mousemoveEvent = "mousemove";
1357
+
1358
+ /**
1359
+ * A global namespace for `mouseout` event.
1360
+ */
1361
+ export declare const mouseoutEvent = "mouseout";
1362
+
1363
+ /**
1364
+ * A global namespace for `mouseover` event.
1365
+ */
1366
+ export declare const mouseoverEvent = "mouseover";
1367
+
1368
+ /**
1369
+ * A global namespace for mouse events equivalent to touch events.
1370
+ */
1371
+ export declare const mouseSwipeEvents: {
1372
+ start: string;
1373
+ end: string;
1374
+ move: string;
1375
+ cancel: string;
1376
+ };
1377
+
1378
+ /**
1379
+ * A global namespace for `mouseup` event.
1380
+ */
1381
+ export declare const mouseupEvent = "mouseup";
1382
+
1383
+ /**
1384
+ * A global namespace for `mousewheel` event.
1385
+ */
1386
+ export declare const mousewheelEvent = "mousewheel";
1387
+
1388
+ /**
1389
+ * A global namespace for `move` event.
1390
+ */
1391
+ export declare const moveEvent = "move";
1392
+
1393
+ /**
1394
+ * Type definitions addapted from React 18.2
1395
+ * Project: https://react.dev/
1396
+ */
1397
+
1398
+ declare type NativeAnimationEvent = AnimationEvent_2;
1399
+
1400
+ declare type NativeClipboardEvent = ClipboardEvent_2;
1401
+
1402
+ declare type NativeCompositionEvent = CompositionEvent_2;
1403
+
1404
+ declare type NativeDragEvent = DragEvent_2;
1405
+
1406
+ /**
1407
+ * currentTarget - a reference to the element on which the event listener is registered.
1408
+ *
1409
+ * target - a reference to the element from which the event was originally dispatched.
1410
+ * This might be a child element to the element on which the event listener is registered.
1411
+ * If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11508#issuecomment-256045682
1412
+ */
1413
+ export declare type NativeEvent<T = Element, E = Event> = BaseEvent<E, T, T>;
1414
+
1415
+ export declare type NativeEventHandler<T = Element> = EventHandler<T, NativeEvent<T>>;
1416
+
1417
+ /**
1418
+ * A global namespace for all browser native events.
1419
+ */
1420
+ export declare const nativeEvents: {
1421
+ DOMContentLoaded: string;
1422
+ DOMMouseScroll: string;
1423
+ abort: string;
1424
+ beforeunload: string;
1425
+ blur: string;
1426
+ change: string;
1427
+ click: string;
1428
+ contextmenu: string;
1429
+ dblclick: string;
1430
+ error: string;
1431
+ focus: string;
1432
+ focusin: string;
1433
+ focusout: string;
1434
+ gesturechange: string;
1435
+ gestureend: string;
1436
+ gesturestart: string;
1437
+ hover: string;
1438
+ keydown: string;
1439
+ keypress: string;
1440
+ keyup: string;
1441
+ load: string;
1442
+ mousedown: string;
1443
+ mousemove: string;
1444
+ mousein: string;
1445
+ mouseout: string;
1446
+ mouseenter: string;
1447
+ mouseleave: string;
1448
+ mouseover: string;
1449
+ mouseup: string;
1450
+ mousewheel: string;
1451
+ move: string;
1452
+ orientationchange: string;
1453
+ pointercancel: string;
1454
+ pointerdown: string;
1455
+ pointerleave: string;
1456
+ pointermove: string;
1457
+ pointerup: string;
1458
+ readystatechange: string;
1459
+ reset: string;
1460
+ resize: string;
1461
+ scroll: string;
1462
+ select: string;
1463
+ selectend: string;
1464
+ selectstart: string;
1465
+ submit: string;
1466
+ touchcancel: string;
1467
+ touchend: string;
1468
+ touchmove: string;
1469
+ touchstart: string;
1470
+ unload: string;
1471
+ };
1472
+
1473
+ declare type NativeFocusEvent = FocusEvent_2;
1474
+
1475
+ declare type NativeKeyboardEvent = KeyboardEvent_2;
1476
+
1477
+ declare type NativeMouseEvent = MouseEvent_2;
1478
+
1479
+ declare type NativePointerEvent = PointerEvent_2;
1480
+
1481
+ declare type NativeTouchEvent = TouchEvent_2;
1482
+
1483
+ declare type NativeTransitionEvent = TransitionEvent_2;
1484
+
1485
+ declare type NativeUIEvent = UIEvent_2;
1486
+
1487
+ declare type NativeWheelEvent = WheelEvent_2;
1488
+
1489
+ export declare interface NavigatorUA extends Navigator {
1490
+ readonly userAgentData: NavigatorUAData;
1491
+ }
1492
+
1493
+ export declare interface NavigatorUABrand {
1494
+ readonly brand: string;
1495
+ readonly version: string;
1496
+ }
1497
+
1498
+ export declare interface NavigatorUAData {
1499
+ readonly brands: NavigatorUABrand[];
1500
+ readonly mobile: boolean;
1501
+ readonly platform: string;
1502
+ }
1503
+
1504
+ /** A generic function with empty body. */
1505
+ export declare const noop: () => void;
1506
+
1507
+ /**
1508
+ * Utility to normalize component options.
1509
+ *
1510
+ * @param element target
1511
+ * @param defaultOps component default options
1512
+ * @param inputOps component instance options
1513
+ * @param ns component namespace
1514
+ * @return normalized component options object
1515
+ */
1516
+ export declare const normalizeOptions: <T extends {
1517
+ [key: string]: unknown;
1518
+ }>(element: HTMLElement, defaultOps: T, inputOps: Partial<T>, ns?: string) => T;
1519
+
1520
+ /**
1521
+ * Utility to normalize component options
1522
+ *
1523
+ * @param value the input value
1524
+ * @return the normalized value
1525
+ */
1526
+ export declare const normalizeValue: (value?: unknown) => NormalValue;
1527
+
1528
+ declare type NormalValue = boolean | number | string | Fn | null;
1529
+
1530
+ /**
1531
+ * Shortcut for `Object.assign()` static method.
1532
+ *
1533
+ * @param obj a target object
1534
+ * @param source source object(s)
1535
+ * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
1536
+ */
1537
+ export declare const ObjectAssign: typeof ObjectAssignTyped;
1538
+
1539
+ /**
1540
+ * Overloads for Object.assign.
1541
+ *
1542
+ * @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/object-assign/index.d.ts
1543
+ */
1544
+ declare function ObjectAssignTyped<T, U>(target: T, source: U): T & U;
1545
+
1546
+ declare function ObjectAssignTyped<T, U, V>(target: T, source1: U, source2: V): T & U & V;
1547
+
1548
+ declare function ObjectAssignTyped<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
1549
+
1550
+ declare function ObjectAssignTyped<T, U, V, W, Q>(target: T, source1: U, source2: V, source3: W, source4: Q): T & U & V & W & Q;
1551
+
1552
+ declare function ObjectAssignTyped<T, U, V, W, Q, R>(target: T, source1: U, source2: V, source3: W, source4: Q, source5: R): T & U & V & W & Q & R;
1553
+
1554
+ declare function ObjectAssignTyped(target: unknown, ...sources: unknown[]): unknown;
1555
+
1556
+ /**
1557
+ * Shortcut for `Object.entries()` static method.
1558
+ *
1559
+ * @param obj a target object
1560
+ * @returns the entries of an object in an array format [key, value][]
1561
+ * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
1562
+ */
1563
+ export declare const ObjectEntries: <O extends Record<keyof O, unknown>>(obj: O) => [keyof O, O[keyof O]][];
1564
+
1565
+ /**
1566
+ * Shortcut for `Object.fromEntries()` static method.
1567
+ *
1568
+ * @param entries a target entries object
1569
+ * @returns a new Object created from the specified entries in array format [key, value][]
1570
+ * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
1571
+ */
1572
+ export declare const ObjectFromEntries: <K extends string, V>(entries: [K, V][]) => Record<K, V>;
1573
+
1574
+ /**
1575
+ * A shortcut to `Object.hasOwn()` static method to work
1576
+ * with regular `Object` elements.
1577
+ *
1578
+ * @see https://fettblog.eu/typescript-hasownproperty/
1579
+ * @param obj the target object
1580
+ * @param prop the property to check
1581
+ * @returns the query result
1582
+ */
1583
+ export declare const ObjectHasOwn: <T extends object, K extends PropertyKey>(obj: T, prop: K) => obj is T & Record<K, unknown>;
1584
+
1585
+ /**
1586
+ * Shortcut for `Object.keys()` static method.
1587
+ *
1588
+ * @param obj a target object
1589
+ * @returns an array with object keys
1590
+ * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
1591
+ */
1592
+ export declare const ObjectKeys: <O extends Record<keyof O, unknown>>(obj: O) => (keyof O)[];
1593
+
1594
+ /**
1595
+ * Shortcut for `Object.values()` static method.
1596
+ *
1597
+ * @param obj a target object
1598
+ * @returns an array with the object values
1599
+ * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
1600
+ */
1601
+ export declare const ObjectValues: <O extends Record<string, unknown>>(obj: O) => O[keyof O][];
1602
+
1603
+ /**
1604
+ * Remove eventListener from an `EventTarget` object.
1605
+ */
1606
+ export declare const off: <T extends EventTarget, L = EventListener>(element: T, eventName: string, listener: L, options?: AddEventListenerOptions) => void;
1607
+
1608
+ /**
1609
+ * A global namespace for `offsetHeight` property.
1610
+ */
1611
+ export declare const offsetHeight = "offsetHeight";
1612
+
1613
+ export declare interface OffsetRect {
1614
+ width: number;
1615
+ height: number;
1616
+ x: number;
1617
+ y: number;
1618
+ }
1619
+
1620
+ /**
1621
+ * A global namespace for `offsetWidth` property.
1622
+ */
1623
+ export declare const offsetWidth = "offsetWidth";
1624
+
1625
+ /**
1626
+ * Add eventListener to an `EventTarget` object.
1627
+ */
1628
+ export declare const on: <T extends EventTarget, L = EventListener>(element: T, eventName: string, listener: L, options?: AddEventListenerOptions) => void;
1629
+
1630
+ /**
1631
+ * Add an `eventListener` to an `EventTarget`
1632
+ * element and remove it once callback is called.
1633
+ */
1634
+ export declare const one: <T extends EventTarget, L = EventListener>(element: T, eventName: string, listener: L, options?: AddEventListenerOptions) => void;
1635
+
1636
+ /**
1637
+ * A global namespace for `orientationchange` event.
1638
+ */
1639
+ export declare const orientationchangeEvent = "orientationchange";
1640
+
1641
+ export declare interface OriginalEvent extends CustomEvent<unknown> {
1642
+ readonly type: string;
1643
+ relatedTarget?: EventTarget;
1644
+ }
1645
+
1646
+ /**
1647
+ * A global namespace for most scroll event listeners.
1648
+ */
1649
+ export declare const passiveHandler: Partial<AddEventListenerOptions>;
1650
+
1651
+ /**
1652
+ * A global namespace for `pointercancel` event.
1653
+ */
1654
+ export declare const pointercancelEvent = "pointercancel";
1655
+
1656
+ /**
1657
+ * A global namespace for `pointerdown` event.
1658
+ */
1659
+ export declare const pointerdownEvent = "pointerdown";
1660
+
1661
+ declare interface PointerEvent_2<T = Element> extends MouseEvent_2<T, NativePointerEvent> {
1662
+ pointerId: number;
1663
+ pressure: number;
1664
+ tangentialPressure: number;
1665
+ tiltX: number;
1666
+ tiltY: number;
1667
+ twist: number;
1668
+ width: number;
1669
+ height: number;
1670
+ pointerType: "mouse" | "pen" | "touch";
1671
+ isPrimary: boolean;
1672
+ }
1673
+ export { PointerEvent_2 as PointerEvent }
1674
+
1675
+ export declare type PointerEventHandler<T = Element> = EventHandler<T, PointerEvent_2<T>>;
1676
+
1677
+ /**
1678
+ * A global namespace for `pointerleave` event.
1679
+ */
1680
+ export declare const pointerleaveEvent = "pointerleave";
1681
+
1682
+ /**
1683
+ * A global namespace for `pointermove` event.
1684
+ */
1685
+ export declare const pointermoveEvent = "pointermove";
1686
+
1687
+ /**
1688
+ * A global namespace for `pointerup` event.
1689
+ */
1690
+ export declare const pointerupEvent = "pointerup";
1691
+
1692
+ export declare type PossibleEventTarget = EventTarget & (Element | Document | Window);
1693
+
1694
+ /**
1695
+ * Utility to check if target is typeof `HTMLElement`, `Element`, `Node`
1696
+ * or find one that matches a selector.
1697
+ *
1698
+ * @param selector the input selector or target element
1699
+ * @param parent optional node to look into
1700
+ * @return the `HTMLElement` or `querySelector` result
1701
+ */
1702
+ export declare const querySelector: <T extends HTMLElement>(selector: HTMLElement | string, parent?: ParentNode) => T | null;
1703
+
1704
+ /**
1705
+ * A shortcut for `(document|Element).querySelectorAll`.
1706
+ *
1707
+ * @param selector the input selector
1708
+ * @param parent optional node to look into
1709
+ * @return the query result
1710
+ */
1711
+ export declare const querySelectorAll: <T extends HTMLElement>(selector: string, parent?: ParentNode) => NodeListOf<T>;
1712
+
1713
+ /**
1714
+ * A global namespace for `readystatechange` event.
1715
+ */
1716
+ export declare const readystatechangeEvent = "readystatechange";
1717
+
1718
+ /**
1719
+ * Utility to force re-paint of an `HTMLElement` target.
1720
+ *
1721
+ * @param element is the target
1722
+ * @return the `Element.offsetHeight` value
1723
+ */
1724
+ export declare const reflow: (element: HTMLElement) => number;
1725
+
1726
+ /**
1727
+ * Shortcut for `HTMLElement.removeAttribute()` method.
1728
+ *
1729
+ * @param element target element
1730
+ * @param att attribute name
1731
+ */
1732
+ export declare const removeAttribute: (element: HTMLElement, att: string) => void;
1733
+
1734
+ /**
1735
+ * Shortcut for `HTMLElement.removeAttributeNS()` method.
1736
+ *
1737
+ * @param ns attribute namespace
1738
+ * @param element target element
1739
+ * @param att attribute name
1740
+ */
1741
+ export declare const removeAttributeNS: (ns: string, element: HTMLElement, att: string) => void;
1742
+
1743
+ /**
1744
+ * Remove one or more classes from `HTMLElement.classList`.
1745
+ *
1746
+ * @param element target
1747
+ * @param classNAME to remove
1748
+ */
1749
+ export declare const removeClass: (element: HTMLElement, ...classNAME: string[]) => void;
1750
+
1751
+ /**
1752
+ * A global namespace for 'removeEventListener' string.
1753
+ */
1754
+ declare const removeEventListener_2 = "removeEventListener";
1755
+ export { removeEventListener_2 as removeEventListener }
1756
+
1757
+ /**
1758
+ * A global namespace for `reset` event.
1759
+ */
1760
+ export declare const resetEvent = "reset";
1761
+
1762
+ /**
1763
+ * A global namespace for `resize` event.
1764
+ */
1765
+ export declare const resizeEvent = "resize";
1766
+
1767
+ /**
1768
+ * A global namespace for `scroll` event.
1769
+ */
1770
+ export declare const scrollEvent = "scroll";
1771
+
1772
+ /**
1773
+ * A global namespace for `scrollHeight` property.
1774
+ */
1775
+ export declare const scrollHeight = "scrollHeight";
1776
+
1777
+ /**
1778
+ * A global namespace for `scrollWidth` property.
1779
+ */
1780
+ export declare const scrollWidth = "scrollWidth";
1781
+
1782
+ /**
1783
+ * A global namespace for the `selectend` event.
1784
+ */
1785
+ export declare const selectendEvent = "selectend";
1786
+
1787
+ /**
1788
+ * A global namespace for `select` event.
1789
+ */
1790
+ export declare const selectEvent = "select";
1791
+
1792
+ /**
1793
+ * A global namespace for the `selectstart` event.
1794
+ */
1795
+ export declare const selectstartEvent = "selectstart";
1796
+
1797
+ /**
1798
+ * Shortcut for `HTMLElement.setAttribute()` method.
1799
+ *
1800
+ * @param element target element
1801
+ * @param att attribute name
1802
+ * @param value attribute value
1803
+ */
1804
+ export declare const setAttribute: (element: HTMLElement, att: string, value: string) => void;
1805
+
1806
+ /**
1807
+ * Shortcut for `SVGElement.setAttributeNS()` method.
1808
+ *
1809
+ * @param ns attribute namespace
1810
+ * @param element target element
1811
+ * @param att attribute name
1812
+ * @param value attribute value
1813
+ */
1814
+ export declare const setAttributeNS: (ns: string, element: HTMLElement, att: string, value: string) => void;
1815
+
1816
+ /**
1817
+ * Shortcut for multiple uses of `HTMLElement.style.propertyName` method.
1818
+ *
1819
+ * @param element target element
1820
+ * @param styles attribute value
1821
+ */
1822
+ export declare const setElementStyle: (element: HTMLElement, styles: Partial<CSS4Declaration>) => void;
1823
+
1824
+ /**
1825
+ * A global namespace for `submit` event.
1826
+ */
1827
+ export declare const submitEvent = "submit";
1828
+
1829
+ /**
1830
+ * A global `boolean` for CSS3 3D transform support.
1831
+ */
1832
+ export declare const support3DTransform: () => boolean;
1833
+
1834
+ /**
1835
+ * A global `boolean` for CSS3 animation support.
1836
+ */
1837
+ export declare const supportAnimation: () => boolean;
1838
+
1839
+ /**
1840
+ * A global `boolean` for passive events support,
1841
+ * in general event options are not suited for scroll prevention.
1842
+ *
1843
+ * @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection
1844
+ */
1845
+ export declare const supportPassive: () => boolean;
1846
+
1847
+ /**
1848
+ * A global `boolean` for touch events support.
1849
+ */
1850
+ export declare const supportTouch: () => boolean;
1851
+
1852
+ /**
1853
+ * A global `boolean` for CSS3 transform support.
1854
+ */
1855
+ export declare const supportTransform: () => boolean;
1856
+
1857
+ /**
1858
+ * A global `boolean` for CSS3 transition support.
1859
+ */
1860
+ export declare const supportTransition: () => boolean;
1861
+
1862
+ /**
1863
+ * A global namespace for `touchcancel` event.
1864
+ */
1865
+ export declare const tabindex = "tabindex";
1866
+
1867
+ /**
1868
+ * An interface for one or more `TimerHandler`s per `Element`.
1869
+ *
1870
+ * @see https://github.com/thednp/navbar/
1871
+ */
1872
+ export declare const Timer: {
1873
+ /**
1874
+ * Sets a new timeout timer for an element, or element -> key association.
1875
+ *
1876
+ * @param element target element
1877
+ * @param callback the callback
1878
+ * @param delay the execution delay
1879
+ * @param key a unique key
1880
+ */
1881
+ set: (element: HTMLElement, callback: TimerHandler, delay: number, key?: string) => void;
1882
+ /**
1883
+ * Returns the timer associated with the target.
1884
+ *
1885
+ * @param element target element
1886
+ * @param key a unique
1887
+ * @returns the timer
1888
+ */
1889
+ get: (element: HTMLElement, key?: string) => number | null;
1890
+ /**
1891
+ * Clears the element's timer.
1892
+ *
1893
+ * @param element target element
1894
+ * @param key a unique key
1895
+ */
1896
+ clear: (element: HTMLElement, key?: string) => void;
1897
+ };
1898
+
1899
+ /**
1900
+ * Utility to toggle focus trap inside a designated target element;
1901
+ * @param target
1902
+ */
1903
+ export declare const toggleFocusTrap: (target: HTMLElement) => void;
1904
+
1905
+ /**
1906
+ * Shortcut for `String.toLowerCase()`.
1907
+ *
1908
+ * @param source input string
1909
+ * @returns lowercase output string
1910
+ */
1911
+ export declare const toLowerCase: (source: string) => string;
1912
+
1913
+ /**
1914
+ * A global namespace for `touchcancel` event.
1915
+ */
1916
+ export declare const touchcancelEvent = "touchcancel";
1917
+
1918
+ /**
1919
+ * A global namespace for `touchend` event.
1920
+ */
1921
+ export declare const touchendEvent = "touchend";
1922
+
1923
+ declare interface TouchEvent_2<T = Element> extends UIEvent_2<T, NativeTouchEvent> {
1924
+ altKey: boolean;
1925
+ changedTouches: TouchList;
1926
+ ctrlKey: boolean;
1927
+ /**
1928
+ * See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
1929
+ */
1930
+ getModifierState(key: ModifierKey): boolean;
1931
+ metaKey: boolean;
1932
+ shiftKey: boolean;
1933
+ targetTouches: TouchList;
1934
+ touches: TouchList;
1935
+ }
1936
+ export { TouchEvent_2 as TouchEvent }
1937
+
1938
+ export declare type TouchEventHandler<T = Element> = EventHandler<T, TouchEvent_2<T>>;
1939
+
1940
+ /**
1941
+ * A global namespace for touch events.
1942
+ */
1943
+ export declare const touchEvents: {
1944
+ start: string;
1945
+ end: string;
1946
+ move: string;
1947
+ cancel: string;
1948
+ };
1949
+
1950
+ /**
1951
+ * A global namespace for `touchmove` event.
1952
+ */
1953
+ export declare const touchmoveEvent = "touchmove";
1954
+
1955
+ /**
1956
+ * A global namespace for `touchstart` event.
1957
+ */
1958
+ export declare const touchstartEvent = "touchstart";
1959
+
1960
+ /**
1961
+ * Shortcut for `String.toUpperCase()`.
1962
+ *
1963
+ * @param source input string
1964
+ * @returns uppercase output string
1965
+ */
1966
+ export declare const toUpperCase: (source: string) => string;
1967
+
1968
+ /**
1969
+ * A global namespace for 'transitionDelay' string.
1970
+ */
1971
+ export declare const transitionDelay = "transitionDelay";
1972
+
1973
+ /**
1974
+ * A global namespace for 'transitionDuration' string.
1975
+ */
1976
+ export declare const transitionDuration = "transitionDuration";
1977
+
1978
+ /**
1979
+ * A global namespace for 'transitionend' string.
1980
+ */
1981
+ export declare const transitionEndEvent = "transitionend";
1982
+
1983
+ declare interface TransitionEvent_2<T = Element>
1984
+ extends NativeEvent<T, NativeTransitionEvent> {
1985
+ elapsedTime: number;
1986
+ propertyName: string;
1987
+ pseudoElement: string;
1988
+ }
1989
+ export { TransitionEvent_2 as TransitionEvent }
1990
+
1991
+ export declare type TransitionEventHandler<T = Element> = EventHandler<T, TransitionEvent_2<T>>;
1992
+
1993
+ /**
1994
+ * A global namespace for `transitionProperty` string for modern browsers.
1995
+ */
1996
+ export declare const transitionProperty = "transitionProperty";
1997
+
1998
+ declare interface UIEvent_2<T = Element, E = NativeUIEvent> extends NativeEvent<T, E> {
1999
+ detail: number;
2000
+ view: AbstractView;
2001
+ }
2002
+ export { UIEvent_2 as UIEvent }
2003
+
2004
+ export declare type UIEventHandler<T = Element> = EventHandler<T, UIEvent_2<T>>;
2005
+
2006
+ /**
2007
+ * A global namespace for `unload` event.
2008
+ */
2009
+ export declare const unloadEvent = "unload";
2010
+
2011
+ /**
2012
+ * A global namespace for `navigator.userAgent` string.
2013
+ */
2014
+ export declare const userAgent: string;
2015
+
2016
+ /**
2017
+ * A global namespace for `userAgentData` object.
2018
+ */
2019
+ export declare const userAgentData: NavigatorUA["userAgentData"];
2020
+
2021
+ export { version }
2022
+
2023
+ declare interface WheelEvent_2<T = Element> extends MouseEvent_2<T, NativeWheelEvent> {
2024
+ deltaMode: number;
2025
+ deltaX: number;
2026
+ deltaY: number;
2027
+ deltaZ: number;
2028
+ }
2029
+ export { WheelEvent_2 as WheelEvent }
2030
+
2031
+ export declare type WheelEventHandler<T = Element> = EventHandler<T, WheelEvent_2<T>>;
2032
+
2033
+ export { }