@thednp/shorty 2.0.0-alpha6 → 2.0.0-alpha8

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,32 +1,1023 @@
1
- // Generated by dts-bundle-generator v6.13.0
2
-
3
- export interface NavigatorUABrand {
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 `error` event.
134
+ */
135
+ export declare const errorEvent = "error";
136
+ /**
137
+ * A global namespace for `reset` event.
138
+ */
139
+ export declare const resetEvent = "reset";
140
+ /**
141
+ * A global namespace for `resize` event.
142
+ */
143
+ export declare const resizeEvent = "resize";
144
+ /**
145
+ * A global namespace for `scroll` event.
146
+ */
147
+ export declare const scrollEvent = "scroll";
148
+ /**
149
+ * A global namespace for `submit` event.
150
+ */
151
+ export declare const submitEvent = "submit";
152
+ /**
153
+ * A global namespace for `load` event.
154
+ */
155
+ export declare const loadEvent = "load";
156
+ /**
157
+ * A global namespace for `loadstart` event.
158
+ */
159
+ export declare const loadstartEvent = "loadstart";
160
+ /**
161
+ * A global namespace for `unload` event.
162
+ */
163
+ export declare const unloadEvent = "unload";
164
+ /**
165
+ * A global namespace for `readystatechange` event.
166
+ */
167
+ export declare const readystatechangeEvent = "readystatechange";
168
+ /**
169
+ * A global namespace for `beforeunload` event.
170
+ */
171
+ export declare const beforeunloadEvent = "beforeunload";
172
+ /**
173
+ * A global namespace for `orientationchange` event.
174
+ */
175
+ export declare const orientationchangeEvent = "orientationchange";
176
+ /**
177
+ * A global namespace for `contextmenu` event.
178
+ */
179
+ export declare const contextmenuEvent = "contextmenu";
180
+ /**
181
+ * A global namespace for `DOMContentLoaded` event.
182
+ */
183
+ export declare const DOMContentLoadedEvent = "DOMContentLoaded";
184
+ /**
185
+ * A global namespace for `DOMMouseScroll` event.
186
+ */
187
+ export declare const DOMMouseScrollEvent = "DOMMouseScroll";
188
+ /**
189
+ * A global namespace for `select` event.
190
+ */
191
+ export declare const selectEvent = "select";
192
+ /**
193
+ * A global namespace for the `selectend` event.
194
+ */
195
+ export declare const selectendEvent = "selectend";
196
+ /**
197
+ * A global namespace for the `selectstart` event.
198
+ */
199
+ export declare const selectstartEvent = "selectstart";
200
+ /**
201
+ * A global namespace for mouse events equivalent to touch events.
202
+ */
203
+ export declare const mouseSwipeEvents: {
204
+ start: string;
205
+ end: string;
206
+ move: string;
207
+ cancel: string;
208
+ };
209
+ /**
210
+ * A global namespace for mouse click events.
211
+ */
212
+ export declare const mouseClickEvents: {
213
+ down: string;
214
+ up: string;
215
+ };
216
+ /**
217
+ * A global namespace for `click` event.
218
+ */
219
+ export declare const mouseclickEvent = "click";
220
+ /**
221
+ * A global namespace for `dblclick` event.
222
+ */
223
+ export declare const mousedblclickEvent = "dblclick";
224
+ /**
225
+ * A global namespace for `mousedown` event.
226
+ */
227
+ export declare const mousedownEvent = "mousedown";
228
+ /**
229
+ * A global namespace for `mouseup` event.
230
+ */
231
+ export declare const mouseupEvent = "mouseup";
232
+ /**
233
+ * A global namespace for `hover` event.
234
+ */
235
+ export declare const mousehoverEvent = "hover";
236
+ /**
237
+ * A global namespace for mouse hover events.
238
+ */
239
+ export declare const mouseHoverEvents: string[];
240
+ /**
241
+ * A global namespace for `mouseenter` event.
242
+ */
243
+ export declare const mouseenterEvent = "mouseenter";
244
+ /**
245
+ * A global namespace for `mouseleave` event.
246
+ */
247
+ export declare const mouseleaveEvent = "mouseleave";
248
+ /**
249
+ * A global namespace for `mousein` event.
250
+ */
251
+ export declare const mouseinEvent = "mousein";
252
+ /**
253
+ * A global namespace for `mouseout` event.
254
+ */
255
+ export declare const mouseoutEvent = "mouseout";
256
+ /**
257
+ * A global namespace for `mouseover` event.
258
+ */
259
+ export declare const mouseoverEvent = "mouseover";
260
+ /**
261
+ * A global namespace for `mousemove` event.
262
+ */
263
+ export declare const mousemoveEvent = "mousemove";
264
+ /**
265
+ * A global namespace for `mousewheel` event.
266
+ */
267
+ export declare const mousewheelEvent = "mousewheel";
268
+ /**
269
+ * A global namespace for touch events.
270
+ */
271
+ export declare const touchEvents: {
272
+ start: string;
273
+ end: string;
274
+ move: string;
275
+ cancel: string;
276
+ };
277
+ /**
278
+ * A global namespace for `touchstart` event.
279
+ */
280
+ export declare const touchstartEvent = "touchstart";
281
+ /**
282
+ * A global namespace for `touchmove` event.
283
+ */
284
+ export declare const touchmoveEvent = "touchmove";
285
+ /**
286
+ * A global namespace for `touchcancel` event.
287
+ */
288
+ export declare const touchcancelEvent = "touchcancel";
289
+ /**
290
+ * A global namespace for `touchend` event.
291
+ */
292
+ export declare const touchendEvent = "touchend";
293
+ /**
294
+ * A global namespace for `pointercancel` event.
295
+ */
296
+ export declare const pointercancelEvent = "pointercancel";
297
+ /**
298
+ * A global namespace for `pointerdown` event.
299
+ */
300
+ export declare const pointerdownEvent = "pointerdown";
301
+ /**
302
+ * A global namespace for `pointerleave` event.
303
+ */
304
+ export declare const pointerleaveEvent = "pointerleave";
305
+ /**
306
+ * A global namespace for `pointermove` event.
307
+ */
308
+ export declare const pointermoveEvent = "pointermove";
309
+ /**
310
+ * A global namespace for `pointerup` event.
311
+ */
312
+ export declare const pointerupEvent = "pointerup";
313
+ /**
314
+ * A global namespace for focus event names.
315
+ */
316
+ export declare const focusEvents: {
317
+ in: string;
318
+ out: string;
319
+ };
320
+ /**
321
+ * A global namespace for `focus` event.
322
+ */
323
+ export declare const focusEvent = "focus";
324
+ /**
325
+ * A global namespace for `focusin` event.
326
+ */
327
+ export declare const focusinEvent = "focusin";
328
+ /**
329
+ * A global namespace for `focusout` event.
330
+ */
331
+ export declare const focusoutEvent = "focusout";
332
+ /**
333
+ * A global namespace for `gesturechange` event.
334
+ */
335
+ export declare const gesturechangeEvent = "gesturechange";
336
+ /**
337
+ * A global namespace for `gestureend` event.
338
+ */
339
+ export declare const gestureendEvent = "gestureend";
340
+ /**
341
+ * A global namespace for `gesturestart` event.
342
+ */
343
+ export declare const gesturestartEvent = "gesturestart";
344
+ /**
345
+ * A global namespace for keyboard event keys.
346
+ */
347
+ export declare const keyboardEventKeys: {
348
+ Backspace: string;
349
+ Tab: string;
350
+ Enter: string;
351
+ Shift: string;
352
+ Control: string;
353
+ Alt: string;
354
+ Pause: string;
355
+ CapsLock: string;
356
+ Escape: string;
357
+ Scape: string;
358
+ ArrowLeft: string;
359
+ ArrowUp: string;
360
+ ArrowRight: string;
361
+ ArrowDown: string;
362
+ Insert: string;
363
+ Delete: string;
364
+ Meta: string;
365
+ ContextMenu: string;
366
+ ScrollLock: string;
367
+ };
368
+ /**
369
+ * A global namespace for `keydown` event.
370
+ */
371
+ export declare const keydownEvent = "keydown";
372
+ /**
373
+ * A global namespace for `keyup` event.
374
+ */
375
+ export declare const keyupEvent = "keyup";
376
+ /**
377
+ * A global namespace for `keypress` event.
378
+ */
379
+ export declare const keypressEvent = "keypress";
380
+ /**
381
+ * A global namespace for `Alt` key.
382
+ * e.which = 18
383
+ */
384
+ export declare const keyAlt = "Alt";
385
+ /**
386
+ * A global namespace for `ArrowDown` key.
387
+ * e.which = 40 equivalent
388
+ */
389
+ export declare const keyArrowDown = "ArrowDown";
390
+ /**
391
+ * A global namespace for `ArrowUp` key.
392
+ * e.which = 38 equivalent
393
+ */
394
+ export declare const keyArrowUp = "ArrowUp";
395
+ /**
396
+ * A global namespace for `ArrowLeft` key.
397
+ * e.which = 37 equivalent
398
+ */
399
+ export declare const keyArrowLeft = "ArrowLeft";
400
+ /**
401
+ * A global namespace for `ArrowRight` key.
402
+ * e.which = 39 equivalent
403
+ */
404
+ export declare const keyArrowRight = "ArrowRight";
405
+ /**
406
+ * A global namespace for `Backspace` key.
407
+ * e.which === 8 equivalent
408
+ */
409
+ export declare const keyBackspace = "Backspace";
410
+ /**
411
+ * A global namespace for `CapsLock` key.
412
+ * e.which = 20 equivalent
413
+ */
414
+ export declare const keyCapsLock = "CapsLock";
415
+ /**
416
+ * A global namespace for `Control` key.
417
+ * e.which = 17
418
+ */
419
+ export declare const keyControl = "Control";
420
+ /**
421
+ * A global namespace for `Delete` key.
422
+ * e.which = 46 equivalent
423
+ */
424
+ export declare const keyDelete = "Delete";
425
+ /**
426
+ * A global namespace for `Enter` key.
427
+ * e.which = 13 equivalent
428
+ */
429
+ export declare const keyEnter = "Enter";
430
+ /**
431
+ * A global namespace for `Escape` key.
432
+ * e.which = 27 equivalent
433
+ */
434
+ export declare const keyEscape = "Escape";
435
+ /**
436
+ * A global namespace for `Insert` key.
437
+ * e.which = 45 equivalent
438
+ */
439
+ export declare const keyInsert = "Insert";
440
+ /**
441
+ * A global namespace for `Meta` key.
442
+ * e.which = 93 equivalent
443
+ */
444
+ export declare const keyMeta = "Meta";
445
+ /**
446
+ * A global namespace for `Pause` key.
447
+ * e.which = 19
448
+ */
449
+ export declare const keyPause = "Pause";
450
+ /**
451
+ * A global namespace for `ScrollLock` key.
452
+ * e.which = 145 equivalent
453
+ */
454
+ export declare const keyScrollLock = "ScrollLock";
455
+ /**
456
+ * A global namespace for `Shift` key.
457
+ * e.which = 16
458
+ */
459
+ export declare const keyShift = "Shift";
460
+ /**
461
+ * A global namespace for `Space` key.
462
+ * e.which = 32 equivalent
463
+ */
464
+ export declare const keySpace = "Space";
465
+ /**
466
+ * A global namespace for `Tab` key.
467
+ * e.which = 9 equivalent
468
+ */
469
+ export declare const keyTab = "Tab";
470
+ /**
471
+ * A global namespace for 'animationDuration' string.
472
+ */
473
+ export declare const animationDuration = "animationDuration";
474
+ /**
475
+ * A global namespace for 'animationDelay' string.
476
+ */
477
+ export declare const animationDelay = "animationDelay";
478
+ /**
479
+ * A global namespace for 'animationName' string.
480
+ */
481
+ export declare const animationName = "animationName";
482
+ /**
483
+ * A global namespace for 'animationend' string.
484
+ */
485
+ export declare const animationEndEvent = "animationend";
486
+ /**
487
+ * A global namespace for 'transitionDuration' string.
488
+ */
489
+ export declare const transitionDuration = "transitionDuration";
490
+ /**
491
+ * A global namespace for 'transitionDelay' string.
492
+ */
493
+ export declare const transitionDelay = "transitionDelay";
494
+ /**
495
+ * A global namespace for 'transitionend' string.
496
+ */
497
+ export declare const transitionEndEvent = "transitionend";
498
+ /**
499
+ * A global namespace for `transitionProperty` string for modern browsers.
500
+ */
501
+ export declare const transitionProperty = "transitionProperty";
502
+ /**
503
+ * A global namespace for 'addEventListener' string.
504
+ */
505
+ export declare const addEventListener = "addEventListener";
506
+ /**
507
+ * A global namespace for 'removeEventListener' string.
508
+ */
509
+ export declare const removeEventListener = "removeEventListener";
510
+ /**
511
+ * A global namespace for predefined
512
+ * CSS3 'cubic-bezier()' easing functions.
513
+ */
514
+ export declare const bezierEasings: {
515
+ linear: string;
516
+ easingSinusoidalIn: string;
517
+ easingSinusoidalOut: string;
518
+ easingSinusoidalInOut: string;
519
+ easingQuadraticIn: string;
520
+ easingQuadraticOut: string;
521
+ easingQuadraticInOut: string;
522
+ easingCubicIn: string;
523
+ easingCubicOut: string;
524
+ easingCubicInOut: string;
525
+ easingQuarticIn: string;
526
+ easingQuarticOut: string;
527
+ easingQuarticInOut: string;
528
+ easingQuinticIn: string;
529
+ easingQuinticOut: string;
530
+ easingQuinticInOut: string;
531
+ easingExponentialIn: string;
532
+ easingExponentialOut: string;
533
+ easingExponentialInOut: string;
534
+ easingCircularIn: string;
535
+ easingCircularOut: string;
536
+ easingCircularInOut: string;
537
+ easingBackIn: string;
538
+ easingBackOut: string;
539
+ easingBackInOut: string;
540
+ };
541
+ /**
542
+ * A global namespace for `offsetHeight` property.
543
+ */
544
+ export declare const offsetHeight = "offsetHeight";
545
+ /**
546
+ * A global namespace for `offsetWidth` property.
547
+ */
548
+ export declare const offsetWidth = "offsetWidth";
549
+ /**
550
+ * A global namespace for `scrollHeight` property.
551
+ */
552
+ export declare const scrollHeight = "scrollHeight";
553
+ /**
554
+ * A global namespace for `scrollWidth` property.
555
+ */
556
+ export declare const scrollWidth = "scrollWidth";
557
+ /**
558
+ * A global namespace for `touchcancel` event.
559
+ */
560
+ export declare const tabindex = "tabindex";
561
+ // https://github.com/lukewarlow/user-agent-data-types/blob/master/index.d.ts
562
+ export declare interface NavigatorUABrand {
4
563
  readonly brand: string;
5
564
  readonly version: string;
6
565
  }
7
- export interface NavigatorUAData {
566
+ export declare interface NavigatorUAData {
8
567
  readonly brands: NavigatorUABrand[];
9
568
  readonly mobile: boolean;
10
569
  readonly platform: string;
11
570
  }
12
- export interface OriginalEvent extends CustomEvent<any> {
571
+ export declare interface NavigatorUA extends Navigator {
572
+ readonly userAgentData: NavigatorUAData;
573
+ }
574
+ /**
575
+ * A global namespace for `userAgentData` object.
576
+ */
577
+ export declare const userAgentData: NavigatorUA["userAgentData"];
578
+ /**
579
+ * A global namespace for `navigator.userAgent` string.
580
+ */
581
+ export declare const userAgent: string;
582
+ /**
583
+ * A global `boolean` for mobile detection.
584
+ */
585
+ export declare const isMobile: boolean;
586
+ /**
587
+ * A global `boolean` for Apple browsers.
588
+ */
589
+ export declare const isApple: boolean;
590
+ /**
591
+ * A global boolean for Gecko browsers. When writing this file,
592
+ * Gecko was not supporting `userAgentData`.
593
+ */
594
+ export declare const isFirefox: boolean;
595
+ /**
596
+ * A global `boolean` for CSS3 3D transform support.
597
+ */
598
+ export declare const support3DTransform: boolean;
599
+ /**
600
+ * A global `boolean` for passive events support,
601
+ * in general event options are not suited for scroll prevention.
602
+ *
603
+ * @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection
604
+ */
605
+ export declare const supportPassive: boolean;
606
+ /**
607
+ * A global `boolean` for CSS3 transform support.
608
+ */
609
+ export declare const supportTransform: boolean;
610
+ /**
611
+ * A global `boolean` for touch events support.
612
+ */
613
+ export declare const supportTouch: boolean;
614
+ /**
615
+ * A global `boolean` for CSS3 animation support.
616
+ */
617
+ export declare const supportAnimation: boolean;
618
+ /**
619
+ * A global `boolean` for CSS3 transition support.
620
+ */
621
+ export declare const supportTransition: boolean;
622
+ /**
623
+ * Shortcut for `HTMLElement.getAttribute()` method.
624
+ *
625
+ * @param element target element
626
+ * @param att attribute name
627
+ * @returns attribute value
628
+ */
629
+ export declare const getAttribute: (element: HTMLElement, att: string) => string | null;
630
+ /**
631
+ * Shortcut for `HTMLElement.getAttributeNS()` method.
632
+ *
633
+ * @param ns attribute namespace
634
+ * @param element target element
635
+ * @param att attribute name
636
+ * @returns attribute value
637
+ */
638
+ export declare const getAttributeNS: (ns: string, element: HTMLElement, att: string) => string | null;
639
+ /**
640
+ * Shortcut for `HTMLElement.hasAttribute()` method.
641
+ *
642
+ * @param element target element
643
+ * @param att attribute name
644
+ * @returns the query result
645
+ */
646
+ export declare const hasAttribute: (element: HTMLElement, att: string) => boolean;
647
+ /**
648
+ * Shortcut for `HTMLElement.hasAttributeNS()` method.
649
+ *
650
+ * @param ns attribute namespace
651
+ * @param element target element
652
+ * @param att attribute name
653
+ * @returns the query result
654
+ */
655
+ export declare const hasAttributeNS: (ns: string, element: HTMLElement, att: string) => boolean;
656
+ /**
657
+ * Shortcut for `HTMLElement.setAttribute()` method.
658
+ *
659
+ * @param element target element
660
+ * @param att attribute name
661
+ * @param value attribute value
662
+ */
663
+ export declare const setAttribute: (element: HTMLElement, att: string, value: string) => void;
664
+ /**
665
+ * Shortcut for `SVGElement.setAttributeNS()` method.
666
+ *
667
+ * @param ns attribute namespace
668
+ * @param element target element
669
+ * @param att attribute name
670
+ * @param value attribute value
671
+ */
672
+ export declare const setAttributeNS: (ns: string, element: HTMLElement, att: string, value: string) => void;
673
+ /**
674
+ * Shortcut for `HTMLElement.removeAttribute()` method.
675
+ *
676
+ * @param element target element
677
+ * @param att attribute name
678
+ */
679
+ export declare const removeAttribute: (element: HTMLElement, att: string) => void;
680
+ /**
681
+ * Shortcut for `HTMLElement.removeAttributeNS()` method.
682
+ *
683
+ * @param ns attribute namespace
684
+ * @param element target element
685
+ * @param att attribute name
686
+ */
687
+ export declare const removeAttributeNS: (ns: string, element: HTMLElement, att: string) => void;
688
+ /**
689
+ * Add one or more CSS classes to `HTMLElement.classList`.
690
+ *
691
+ * @param element target
692
+ * @param classNAME to add
693
+ */
694
+ export declare const addClass: (element: HTMLElement, ...classNAME: string[]) => void;
695
+ /**
696
+ * Remove one or more classes from `HTMLElement.classList`.
697
+ *
698
+ * @param element target
699
+ * @param classNAME to remove
700
+ */
701
+ export declare const removeClass: (element: HTMLElement, ...classNAME: string[]) => void;
702
+ /**
703
+ * Check class in `HTMLElement.classList`.
704
+ *
705
+ * @param element target
706
+ * @param classNAME to check
707
+ */
708
+ export declare const hasClass: (element: HTMLElement, classNAME: string) => boolean;
709
+ /**
710
+ * Add eventListener to an `EventTarget` object.
711
+ */
712
+ export declare const on: (element: EventTarget, eventName: string, listener: EventListener, options?: AddEventListenerOptions) => void;
713
+ /**
714
+ * Remove eventListener from an `EventTarget` object.
715
+ */
716
+ export declare const off: (element: EventTarget, eventName: string, listener: EventListener, options?: AddEventListenerOptions) => void;
717
+ /**
718
+ * Add an `eventListener` to an `EventTarget`
719
+ * element and remove it once callback is called.
720
+ */
721
+ export declare const one: (element: EventTarget, eventName: string, listener: EventListener, options?: AddEventListenerOptions) => void;
722
+ /**
723
+ * A global namespace for `document.body`.
724
+ */
725
+ export declare const documentBody: HTMLElement;
726
+ /**
727
+ * A global namespace for `document.documentElement` or the `<HTML>`.
728
+ */
729
+ export declare const documentElement: HTMLElement;
730
+ /**
731
+ * A global namespace for `document.head`.
732
+ */
733
+ export declare const documentHead: HTMLHeadElement;
734
+ /**
735
+ * Shortie for `Array.from()` static method.
736
+ * The utility should also work with any typed arrays
737
+ * like Float64Array or Int32Array.
738
+ *
739
+ * @param arr array-like iterable object
740
+ * @returns a new array from iterable object
741
+ */
742
+ export declare const ArrayFrom: <T>(arr: ArrayLike<T> | Iterable<T>) => T[];
743
+ /**
744
+ * An interface for web components background data.
745
+ *
746
+ * @see https://github.com/thednp/bootstrap.native/blob/master/src/components/base-component.js
747
+ */
748
+ export declare const Data: {
749
+ /**
750
+ * Sets web components data.
751
+ *
752
+ * @param element target element
753
+ * @param component the component's name or a unique key
754
+ * @param instance the component instance
755
+ */
756
+ set: <T>(element: HTMLElement, component: string, instance: T) => void;
757
+ /**
758
+ * Returns all instances for specified component.
759
+ *
760
+ * @param component the component's name or a unique key
761
+ * @returns all the component instances
762
+ */
763
+ getAllFor: <T_1>(component: string) => Map<HTMLElement, T_1> | null;
764
+ /**
765
+ * Returns the instance associated with the target.
766
+ *
767
+ * @param element target element
768
+ * @param component the component's name or a unique key
769
+ * @returns the instance
770
+ */
771
+ get: <T_2>(element: HTMLElement, component: string) => T_2 | null;
772
+ /**
773
+ * Removes web components data.
774
+ *
775
+ * @param element target element
776
+ * @param component the component's name or a unique key
777
+ */
778
+ remove: <T_3>(element: HTMLElement, component: string) => void;
779
+ };
780
+ /**
781
+ * An alias for `Data.get()`.
782
+ */
783
+ export declare const getInstance: <T>(target: HTMLElement, component: string) => T | null;
784
+ /**
785
+ * Shortie for `document.createElement` method
786
+ * which allows you to create a new `HTMLElement` for a given `tagName`
787
+ * or based on an object with specific non-readonly attributes with string values:
788
+ * `id`, `className`, `textContent`, `style`, etc.
789
+ *
790
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
791
+ *
792
+ * @param param `tagName` or object
793
+ * @return a new `HTMLElement`
794
+ */
795
+ export declare const createElement: (param?: string | Partial<HTMLElement>) => HTMLElement | undefined;
796
+ /**
797
+ * Shortie for `document.createElementNS` method
798
+ * which allows you to create a new `HTMLElement` for a given `tagName`
799
+ * or based on an object with specific non-readonly attributes with string values:
800
+ * `id`, `className`, `textContent`, `style`, etc.
801
+ *
802
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createElementNS
803
+ *
804
+ * @param ns `namespaceURI` to associate with the new `HTMLElement`
805
+ * @param param `tagName` or object
806
+ * @return a new `HTMLElement`
807
+ */
808
+ export declare const createElementNS: (ns: string, param?: string | Partial<HTMLElement>) => HTMLElement | undefined;
809
+ /**
810
+ * Shortcut for the `Element.dispatchEvent(Event)` method.
811
+ *
812
+ * @param element is the target
813
+ * @param event is the `Event` object
814
+ */
815
+ export declare const dispatchEvent: (element: EventTarget, event: Event) => boolean;
816
+ /**
817
+ * JavaScript `Array` distinct.
818
+ *
819
+ * @see https://codeburst.io/javascript-array-distinct-5edc93501dc4
820
+ *
821
+ * @example
822
+ * ```
823
+ * [0,1,1,2].filter(distinct)
824
+ * // => [0,1,2]
825
+ * ```
826
+ * @param value array item value
827
+ * @param index array item index
828
+ * @param arr a clone of the target array
829
+ * @returns the query result
830
+ */
831
+ export declare const distinct: <T>(value: T, index: number, arr: T[]) => boolean;
832
+ /**
833
+ * Utility to make sure callbacks are consistently
834
+ * called when animation ends.
835
+ *
836
+ * @param element target
837
+ * @param handler `animationend` callback
838
+ */
839
+ export declare const emulateAnimationEnd: (element: HTMLElement, handler: EventListener) => void;
840
+ /**
841
+ * Utility to make sure callbacks are consistently
842
+ * called when transition ends.
843
+ *
844
+ * @param element event target
845
+ * @param handler `transitionend` callback
846
+ */
847
+ export declare const emulateTransitionEnd: (element: HTMLElement, handler: EventListener) => void;
848
+ /**
849
+ * Shortcut for `Float32Array.from()` static method.
850
+ *
851
+ * @param arr array-like iterable object
852
+ * @returns a new Float32Array
853
+ */
854
+ export declare const Float32ArrayFrom: (arr: ArrayLike<number> | Iterable<number>) => Float32Array;
855
+ /**
856
+ * Shortcut for `Float64Array.from()` static method.
857
+ *
858
+ * @param arr array-like iterable object
859
+ * @returns a new Float64Array
860
+ */
861
+ export declare const Float64ArrayFrom: (arr: ArrayLike<number> | Iterable<number>) => Float64Array;
862
+ /**
863
+ * Shortie for `HTMLElement.focus()` method.
864
+ *
865
+ * @param element is the target
866
+ * @param options allows to pass additional options such as `preventScroll: boolean`
867
+ */
868
+ export declare const focus: (element: HTMLOrSVGElement, options?: FocusOptions) => void;
869
+ /** A generic function with empty body. */
870
+ export declare const noop: () => void;
871
+ /**
872
+ * Utility to normalize component options.
873
+ *
874
+ * @param element target
875
+ * @param defaultOps component default options
876
+ * @param inputOps component instance options
877
+ * @param ns component namespace
878
+ * @return normalized component options object
879
+ */
880
+ export declare const normalizeOptions: <T extends {
881
+ [key: string]: any;
882
+ }>(element: HTMLElement, defaultOps: T, inputOps: Partial<T>, ns?: string) => T;
883
+ export type NormalValue = boolean | number | string | ((...args: any[]) => any) | null;
884
+ /**
885
+ * Utility to normalize component options
886
+ *
887
+ * @param value the input value
888
+ * @return the normalized value
889
+ */
890
+ export declare const normalizeValue: (value?: boolean | number | string) => NormalValue;
891
+ declare function ObjectAssignTyped<T, U>(target: T, source: U): T & U;
892
+ declare function ObjectAssignTyped<T, U, V>(target: T, source1: U, source2: V): T & U & V;
893
+ declare function ObjectAssignTyped<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
894
+ declare function ObjectAssignTyped<T, U, V, W, Q>(target: T, source1: U, source2: V, source3: W, source4: Q): T & U & V & W & Q;
895
+ 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;
896
+ declare function ObjectAssignTyped(target: any, ...sources: any[]): any;
897
+ /**
898
+ * Shortcut for `Object.assign()` static method.
899
+ *
900
+ * @param obj a target object
901
+ * @param source source object(s)
902
+ * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
903
+ */
904
+ export declare const ObjectAssign: typeof ObjectAssignTyped;
905
+ /**
906
+ * Shortcut for `Object.entries()` static method.
907
+ *
908
+ * @param obj a target object
909
+ * @returns the entries of an object in an array format [key, value][]
910
+ * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
911
+ */
912
+ export declare const ObjectEntries: <O extends Record<string, any>>(obj: O) => [
913
+ keyof O,
914
+ O[keyof O]
915
+ ][];
916
+ /**
917
+ * A shortcut to `Object.hasOwn()` static method to work
918
+ * with regular `Object` elements.
919
+ *
920
+ * @see https://fettblog.eu/typescript-hasownproperty/
921
+ * @param obj the target object
922
+ * @param prop the property to check
923
+ * @returns the query result
924
+ */
925
+ export declare const ObjectHasOwn: <T extends object, K extends PropertyKey>(obj: T, prop: K) => obj is T & Record<K, unknown>;
926
+ /**
927
+ * Shortcut for `Object.keys()` static method.
928
+ *
929
+ * @param obj a target object
930
+ * @returns an array with object keys
931
+ * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
932
+ */
933
+ export declare const ObjectKeys: <O extends Record<string, any>>(obj: O) => (keyof O)[];
934
+ /**
935
+ * Shortcut for `Object.values()` static method.
936
+ *
937
+ * @param obj a target object
938
+ * @returns an array with the object values
939
+ * @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
940
+ */
941
+ export declare const ObjectValues: <O extends Record<string, unknown>>(obj: O) => O[keyof O][];
942
+ export declare interface OriginalEvent extends CustomEvent<any> {
13
943
  readonly type: string;
14
944
  relatedTarget?: EventTarget;
15
945
  }
16
- export interface OffsetRect {
17
- width: number;
18
- height: number;
19
- x: number;
20
- y: number;
21
- }
22
- export interface CustomElement extends HTMLElement {
23
- shadowRoot: ShadowRoot;
24
- connectedCallback?: () => void;
25
- disconnectedCallback?: () => void;
26
- adoptedCallback?: () => void;
27
- attributeChangedCallback?: () => void;
946
+ /**
947
+ * Returns a namespaced `CustomEvent` specific to each component.
948
+ *
949
+ * @param eventType Event.type
950
+ * @param config Event.options | Event.properties
951
+ * @returns a new namespaced event
952
+ */
953
+ export declare const createCustomEvent: <T extends OriginalEvent>(eventType: string, config?: CustomEventInit<any>) => T;
954
+ /**
955
+ * A global namespace for most scroll event listeners.
956
+ */
957
+ export declare const passiveHandler: Partial<AddEventListenerOptions>;
958
+ /**
959
+ * Utility to force re-paint of an `HTMLElement` target.
960
+ *
961
+ * @param element is the target
962
+ * @return the `Element.offsetHeight` value
963
+ */
964
+ export declare const reflow: (element: HTMLElement) => number;
965
+ export declare interface CSS4Declaration extends Exclude<() => string | symbol, CSSStyleDeclaration> {
966
+ [key: string]: string;
28
967
  }
29
- export interface BoundingClientRect {
968
+ /**
969
+ * Shortcut for multiple uses of `HTMLElement.style.propertyName` method.
970
+ *
971
+ * @param element target element
972
+ * @param styles attribute value
973
+ */
974
+ export declare const setElementStyle: (element: HTMLElement, styles: Partial<CSS4Declaration>) => void;
975
+ /**
976
+ * An interface for one or more `TimerHandler`s per `Element`.
977
+ *
978
+ * @see https://github.com/thednp/navbar/
979
+ */
980
+ export declare const Timer: {
981
+ /**
982
+ * Sets a new timeout timer for an element, or element -> key association.
983
+ *
984
+ * @param element target element
985
+ * @param callback the callback
986
+ * @param delay the execution delay
987
+ * @param key a unique key
988
+ */
989
+ set: (element: HTMLElement, callback: TimerHandler, delay: number, key?: string) => void;
990
+ /**
991
+ * Returns the timer associated with the target.
992
+ *
993
+ * @param element target element
994
+ * @param key a unique
995
+ * @returns the timer
996
+ */
997
+ get: (element: HTMLElement, key?: string) => number | null;
998
+ /**
999
+ * Clears the element's timer.
1000
+ *
1001
+ * @param element target element
1002
+ * @param key a unique key
1003
+ */
1004
+ clear: (element: HTMLElement, key?: string) => void;
1005
+ };
1006
+ /**
1007
+ * Shortcut for `String.toLowerCase()`.
1008
+ *
1009
+ * @param source input string
1010
+ * @returns lowercase output string
1011
+ */
1012
+ export declare const toLowerCase: (source: string) => string;
1013
+ /**
1014
+ * Shortcut for `String.toUpperCase()`.
1015
+ *
1016
+ * @param source input string
1017
+ * @returns uppercase output string
1018
+ */
1019
+ export declare const toUpperCase: (source: string) => string;
1020
+ export declare interface BoundingClientRect {
30
1021
  width: number;
31
1022
  height: number;
32
1023
  top: number;
@@ -36,366 +1027,452 @@ export interface BoundingClientRect {
36
1027
  x: number;
37
1028
  y: number;
38
1029
  }
39
- export interface CSS4Declaration extends Exclude<() => string | symbol, CSSStyleDeclaration> {
40
- [key: string]: string;
41
- }
42
- declare const SHORTY: {
43
- ariaChecked: string;
44
- ariaDescription: string;
45
- ariaDescribedBy: string;
46
- ariaExpanded: string;
47
- ariaHidden: string;
48
- ariaHasPopup: string;
49
- ariaLabel: string;
50
- ariaLabelledBy: string;
51
- ariaModal: string;
52
- ariaPressed: string;
53
- ariaSelected: string;
54
- ariaValueMin: string;
55
- ariaValueMax: string;
56
- ariaValueNow: string;
57
- ariaValueText: string;
58
- nativeEvents: {
59
- DOMContentLoaded: string;
60
- DOMMouseScroll: string;
61
- abort: string;
62
- beforeunload: string;
63
- blur: string;
64
- change: string;
65
- click: string;
66
- contextmenu: string;
67
- dblclick: string;
68
- error: string;
69
- focus: string;
70
- focusin: string;
71
- focusout: string;
72
- gesturechange: string;
73
- gestureend: string;
74
- gesturestart: string;
75
- hover: string;
76
- keydown: string;
77
- keypress: string;
78
- keyup: string;
79
- load: string;
80
- mousedown: string;
81
- mousemove: string;
82
- mousein: string;
83
- mouseout: string;
84
- mouseenter: string;
85
- mouseleave: string;
86
- mouseover: string;
87
- mouseup: string;
88
- mousewheel: string;
89
- move: string;
90
- orientationchange: string;
91
- pointercancel: string;
92
- pointerdown: string;
93
- pointerleave: string;
94
- pointermove: string;
95
- pointerup: string;
96
- readystatechange: string;
97
- reset: string;
98
- resize: string;
99
- scroll: string;
100
- select: string;
101
- selectend: string;
102
- selectstart: string;
103
- submit: string;
104
- touchcancel: string;
105
- touchend: string;
106
- touchmove: string;
107
- touchstart: string;
108
- unload: string;
109
- };
110
- abortEvent: string;
111
- blurEvent: string;
112
- moveEvent: string;
113
- changeEvent: string;
114
- errorEvent: string;
115
- resetEvent: string;
116
- resizeEvent: string;
117
- scrollEvent: string;
118
- submitEvent: string;
119
- loadEvent: string;
120
- loadstartEvent: string;
121
- unloadEvent: string;
122
- readystatechangeEvent: string;
123
- beforeunloadEvent: string;
124
- orientationchangeEvent: string;
125
- contextmenuEvent: string;
126
- DOMContentLoadedEvent: string;
127
- DOMMouseScrollEvent: string;
128
- selectEvent: string;
129
- selectendEvent: string;
130
- selectstartEvent: string;
131
- mouseClickEvents: {
132
- down: string;
133
- up: string;
134
- };
135
- mouseclickEvent: string;
136
- mousedblclickEvent: string;
137
- mousedownEvent: string;
138
- mouseupEvent: string;
139
- mousehoverEvent: string;
140
- mouseHoverEvents: string[];
141
- mouseenterEvent: string;
142
- mouseleaveEvent: string;
143
- mouseinEvent: string;
144
- mouseoutEvent: string;
145
- mouseoverEvent: string;
146
- mousemoveEvent: string;
147
- mousewheelEvent: string;
148
- mouseSwipeEvents: {
149
- start: string;
150
- end: string;
151
- move: string;
152
- cancel: string;
153
- };
154
- touchEvents: {
155
- start: string;
156
- end: string;
157
- move: string;
158
- cancel: string;
159
- };
160
- touchstartEvent: string;
161
- touchmoveEvent: string;
162
- touchcancelEvent: string;
163
- touchendEvent: string;
164
- pointercancelEvent: string;
165
- pointerdownEvent: string;
166
- pointerleaveEvent: string;
167
- pointermoveEvent: string;
168
- pointerupEvent: string;
169
- focusEvents: {
170
- in: string;
171
- out: string;
172
- };
173
- focusEvent: string;
174
- focusinEvent: string;
175
- focusoutEvent: string;
176
- gesturechangeEvent: string;
177
- gestureendEvent: string;
178
- gesturestartEvent: string;
179
- bezierEasings: {
180
- linear: string;
181
- easingSinusoidalIn: string;
182
- easingSinusoidalOut: string;
183
- easingSinusoidalInOut: string;
184
- easingQuadraticIn: string;
185
- easingQuadraticOut: string;
186
- easingQuadraticInOut: string;
187
- easingCubicIn: string;
188
- easingCubicOut: string;
189
- easingCubicInOut: string;
190
- easingQuarticIn: string;
191
- easingQuarticOut: string;
192
- easingQuarticInOut: string;
193
- easingQuinticIn: string;
194
- easingQuinticOut: string;
195
- easingQuinticInOut: string;
196
- easingExponentialIn: string;
197
- easingExponentialOut: string;
198
- easingExponentialInOut: string;
199
- easingCircularIn: string;
200
- easingCircularOut: string;
201
- easingCircularInOut: string;
202
- easingBackIn: string;
203
- easingBackOut: string;
204
- easingBackInOut: string;
205
- };
206
- animationDuration: string;
207
- animationDelay: string;
208
- animationName: string;
209
- animationEndEvent: string;
210
- transitionDuration: string;
211
- transitionDelay: string;
212
- transitionEndEvent: string;
213
- transitionProperty: string;
214
- isMobile: boolean;
215
- isApple: boolean;
216
- isFirefox: boolean;
217
- support3DTransform: boolean;
218
- supportPassive: boolean;
219
- supportTransform: boolean;
220
- supportTouch: boolean;
221
- supportAnimation: boolean;
222
- supportTransition: boolean;
223
- addEventListener: string;
224
- removeEventListener: string;
225
- keyboardEventKeys: {
226
- Backspace: string;
227
- Tab: string;
228
- Enter: string;
229
- Shift: string;
230
- Control: string;
231
- Alt: string;
232
- Pause: string;
233
- CapsLock: string;
234
- Escape: string;
235
- Scape: string;
236
- ArrowLeft: string;
237
- ArrowUp: string;
238
- ArrowRight: string;
239
- ArrowDown: string;
240
- Insert: string;
241
- Delete: string;
242
- Meta: string;
243
- ContextMenu: string;
244
- ScrollLock: string;
245
- };
246
- keydownEvent: string;
247
- keypressEvent: string;
248
- keyupEvent: string;
249
- keyAlt: string;
250
- keyArrowDown: string;
251
- keyArrowLeft: string;
252
- keyArrowRight: string;
253
- keyArrowUp: string;
254
- keyBackspace: string;
255
- keyCapsLock: string;
256
- keyControl: string;
257
- keyDelete: string;
258
- keyEnter: string;
259
- keyEscape: string;
260
- keyInsert: string;
261
- keyMeta: string;
262
- keyPause: string;
263
- keyScrollLock: string;
264
- keyShift: string;
265
- keySpace: string;
266
- keyTab: string;
267
- offsetHeight: string;
268
- offsetWidth: string;
269
- scrollHeight: string;
270
- scrollWidth: string;
271
- userAgentData: NavigatorUAData;
272
- userAgent: string;
273
- tabindex: string;
274
- addClass: (element: HTMLElement, ...classNAME: string[]) => void;
275
- removeClass: (element: HTMLElement, ...classNAME: string[]) => void;
276
- hasClass: (element: HTMLElement, classNAME: string) => boolean;
277
- on: (element: EventTarget, eventName: string, listener: EventListener, options?: AddEventListenerOptions | undefined) => void;
278
- off: (element: EventTarget, eventName: string, listener: EventListener, options?: AddEventListenerOptions | undefined) => void;
279
- one: (element: EventTarget, eventName: string, listener: EventListener, options?: AddEventListenerOptions | undefined) => void;
280
- documentBody: HTMLElement;
281
- documentElement: HTMLElement;
282
- documentHead: HTMLHeadElement;
283
- dispatchEvent: (element: EventTarget, event: Event) => boolean;
284
- distinct: <T>(value: T, index: number, arr: T[]) => boolean;
285
- Data: {
286
- set: <T_1>(element: HTMLElement, component: string, instance: T_1) => void;
287
- getAllFor: <T_2>(component: string) => Map<HTMLElement, T_2> | null;
288
- get: <T_3>(element: HTMLElement, component: string) => T_3 | null;
289
- remove: <T_4>(element: HTMLElement, component: string) => void;
290
- };
291
- getInstance: <T_5>(target: HTMLElement, component: string) => T_5 | null;
292
- createElement: (param?: string | Partial<HTMLElement> | undefined) => HTMLElement | undefined;
293
- createElementNS: (ns: string, param?: string | Partial<HTMLElement> | undefined) => HTMLElement | undefined;
294
- createCustomEvent: <T_6 extends OriginalEvent>(eventType: string, config?: CustomEventInit<any> | undefined) => T_6;
295
- toUpperCase: (source: string) => string;
296
- toLowerCase: (source: string) => string;
297
- Timer: {
298
- set: (element: HTMLElement, callback: TimerHandler, delay: number, key?: string | undefined) => void;
299
- get: (element: HTMLElement, key?: string | undefined) => number | null;
300
- clear: (element: HTMLElement, key?: string | undefined) => void;
301
- };
302
- emulateAnimationEnd: (element: HTMLElement, handler: EventListener) => void;
303
- emulateTransitionEnd: (element: HTMLElement, handler: EventListener) => void;
304
- isElementInScrollRange: (element?: HTMLElement | undefined) => boolean;
305
- isElementInViewport: (element?: HTMLElement | undefined) => boolean;
306
- passiveHandler: Partial<AddEventListenerOptions>;
307
- getElementAnimationDuration: (element: HTMLElement) => number;
308
- getElementAnimationDelay: (element: HTMLElement) => number;
309
- getElementTransitionDuration: (element: HTMLElement) => number;
310
- getElementTransitionDelay: (element: HTMLElement) => number;
311
- getNodeScroll: (element: HTMLElement | Window) => {
312
- x: number;
313
- y: number;
314
- };
315
- getParentNode: (node: Node) => Node | ParentNode;
316
- getRectRelativeToOffsetParent: (element: HTMLElement, offsetParent: HTMLElement, scroll: {
317
- x: number;
318
- y: number;
319
- }) => OffsetRect;
320
- getWindow: (node?: Node | undefined) => Window;
321
- isArray: (obj?: unknown) => obj is any[];
322
- isCanvas: (element?: unknown) => element is HTMLCanvasElement;
323
- isString: (str?: unknown) => str is string;
324
- isCustomElement: <T_7 extends CustomElement>(element?: unknown) => element is T_7;
325
- isElement: (element?: unknown) => element is Element;
326
- isJSON: (str?: string | undefined) => boolean;
327
- isMap: (obj?: unknown) => obj is Map<any, any>;
328
- isWeakMap: (obj?: unknown) => obj is WeakMap<any, any>;
329
- isNode: (node?: unknown) => node is Node;
330
- isNumber: (num?: unknown) => num is number;
331
- isHTMLElement: (element?: unknown) => element is HTMLElement;
332
- isHTMLImageElement: (element?: unknown) => element is HTMLImageElement;
333
- isSVGElement: (element?: unknown) => element is SVGElement;
334
- isNodeList: (obj?: unknown) => obj is NodeList;
335
- isHTMLCollection: (obj?: unknown) => obj is HTMLCollection;
336
- isScaledElement: (element?: HTMLElement | undefined) => boolean;
337
- isTableElement: (element?: unknown) => element is HTMLTableElement | HTMLTableCellElement;
338
- isShadowRoot: (element?: unknown) => element is ShadowRoot;
339
- isDocument: (obj?: unknown) => obj is Document;
340
- isElementsArray: (obj?: unknown) => obj is HTMLElement[];
341
- isFunction: (fn?: unknown) => fn is (...arg0: any[]) => any;
342
- isObject: (obj?: unknown) => obj is object;
343
- isWindow: (obj?: unknown) => obj is Window;
344
- isMedia: (element?: unknown) => element is HTMLCanvasElement | HTMLImageElement | SVGElement | HTMLVideoElement;
345
- isRTL: (node?: Node | undefined) => boolean;
346
- closest: (element: HTMLElement, selector: string) => HTMLElement | null;
347
- querySelector: (selector: string | HTMLElement, parent?: ParentNode | undefined) => HTMLElement | null;
348
- getCustomElements: (parent?: ParentNode | undefined) => CustomElement[];
349
- getElementById: (id: string, context?: Node | undefined) => HTMLElement | null;
350
- querySelectorAll: (selector: string, parent?: ParentNode | undefined) => NodeListOf<HTMLElement>;
351
- getElementsByClassName: (selector: string, parent?: ParentNode | undefined) => HTMLCollectionOf<HTMLElement>;
352
- getElementsByTagName: (selector: string, parent?: ParentNode | undefined) => HTMLCollectionOf<HTMLElement>;
353
- matches: (target: Element, selector: string) => boolean;
354
- hasOwn: <T_8 extends object, K extends PropertyKey>(obj: T_8, prop: K) => obj is T_8 & Record<K, unknown>;
355
- normalizeValue: (value?: string | number | boolean | undefined) => string | number | boolean | ((...args: any[]) => any) | null;
356
- normalizeOptions: <T_9 extends {
357
- [key: string]: any;
358
- }>(element: HTMLElement, defaultOps: T_9, inputOps: Partial<T_9>, ns?: string | undefined) => T_9;
359
- reflow: (element: HTMLElement) => number;
360
- noop: () => void;
361
- focus: (element: HTMLOrSVGElement, options?: FocusOptions | undefined) => void;
362
- getUID: (element: HTMLElement, key?: string | undefined) => number;
363
- ArrayFrom: <T_10>(arr: ArrayLike<T_10> | Iterable<T_10>) => T_10[];
364
- Float32ArrayFrom: (arr: ArrayLike<number> | Iterable<number>) => Float32Array;
365
- Float64ArrayFrom: (arr: ArrayLike<number> | Iterable<number>) => Float64Array;
366
- ObjectAssign: {
367
- <T_11, U>(target: T_11, source: U): T_11 & U;
368
- <T_12, U_1, V>(target: T_12, source1: U_1, source2: V): T_12 & U_1 & V;
369
- <T_13, U_2, V_1, W>(target: T_13, source1: U_2, source2: V_1, source3: W): T_13 & U_2 & V_1 & W;
370
- <T_14, U_3, V_2, W_1, Q>(target: T_14, source1: U_3, source2: V_2, source3: W_1, source4: Q): T_14 & U_3 & V_2 & W_1 & Q;
371
- <T_15, U_4, V_3, W_2, Q_1, R>(target: T_15, source1: U_4, source2: V_3, source3: W_2, source4: Q_1, source5: R): T_15 & U_4 & V_3 & W_2 & Q_1 & R;
372
- (target: any, ...sources: any[]): any;
373
- };
374
- ObjectEntries: <O extends Record<string, any>>(obj: O) => [
375
- keyof O,
376
- O[keyof O]
377
- ][];
378
- ObjectKeys: <O_1 extends Record<string, any>>(obj: O_1) => (keyof O_1)[];
379
- ObjectValues: <O_2 extends Record<string, unknown>>(obj: O_2) => O_2[keyof O_2][];
380
- getBoundingClientRect: (element: HTMLElement, includeScale?: boolean | undefined) => BoundingClientRect;
381
- getDocument: (node?: Node | Document | Window | undefined) => Document;
382
- getDocumentBody: (node?: Node | undefined) => HTMLElement;
383
- getDocumentElement: (node?: Node | undefined) => HTMLElement;
384
- getDocumentHead: (node?: Node | undefined) => HTMLElement & HTMLHeadElement;
385
- getElementStyle: (element: HTMLElement, property: string) => string;
386
- setElementStyle: (element: HTMLElement, styles: Partial<CSS4Declaration>) => void;
387
- hasAttribute: (element: HTMLElement, att: string) => boolean;
388
- hasAttributeNS: (ns: string, element: HTMLElement, att: string) => boolean;
389
- getAttribute: (element: HTMLElement, att: string) => string | null;
390
- getAttributeNS: (ns: string, element: HTMLElement, att: string) => string | null;
391
- setAttribute: (element: HTMLElement, att: string, value: string) => void;
392
- setAttributeNS: (ns: string, element: HTMLElement, att: string, value: string) => void;
393
- removeAttribute: (element: HTMLElement, att: string) => void;
394
- removeAttributeNS: (ns: string, element: HTMLElement, att: string) => void;
1030
+ /**
1031
+ * Returns the bounding client rect of a target `HTMLElement`.
1032
+ *
1033
+ * @see https://github.com/floating-ui/floating-ui
1034
+ *
1035
+ * @param element event.target
1036
+ * @param includeScale when *true*, the target scale is also computed
1037
+ * @returns the bounding client rect object
1038
+ */
1039
+ export declare const getBoundingClientRect: (element: HTMLElement, includeScale?: boolean) => BoundingClientRect;
1040
+ /**
1041
+ * Returns the `document` or the `#document` element.
1042
+ *
1043
+ * @see https://github.com/floating-ui/floating-ui
1044
+ *
1045
+ * @param node the reference node
1046
+ * @returns the parent document of the given node
1047
+ */
1048
+ export declare const getDocument: (node?: Node | Document | Window) => Document;
1049
+ /**
1050
+ * Returns the `document.body` or the `<body>` element.
1051
+ *
1052
+ * @param node the reference node
1053
+ * @returns the parent `<body>` of the specified node
1054
+ */
1055
+ export declare const getDocumentBody: (node?: Node | Document | Window) => HTMLElement;
1056
+ /**
1057
+ * Returns the `document.documentElement` or the `<HTML>` element.
1058
+ *
1059
+ * @param node the reference node
1060
+ * @returns the parent `<HTML>` of the node's parent document
1061
+ */
1062
+ export declare const getDocumentElement: (node?: Node | Document | Window) => HTMLElement;
1063
+ /**
1064
+ * Returns the `document.head` or the `<head>` element.
1065
+ *
1066
+ * @param node the reference node
1067
+ * @returns the `<head>` of the node's parent document
1068
+ */
1069
+ export declare const getDocumentHead: (node?: Node | Document | Window) => HTMLElement & HTMLHeadElement;
1070
+ /**
1071
+ * Utility to get the computed `animationDuration`
1072
+ * from `HTMLElement` in miliseconds.
1073
+ *
1074
+ * @param element target
1075
+ * @return the `animationDuration` value in miliseconds
1076
+ */
1077
+ export declare const getElementAnimationDuration: (element: HTMLElement) => number;
1078
+ /**
1079
+ * Utility to get the computed `animationDelay`
1080
+ * from Element in miliseconds.
1081
+ *
1082
+ * @param element target
1083
+ * @return the `animationDelay` value in miliseconds
1084
+ */
1085
+ export declare const getElementAnimationDelay: (element: HTMLElement) => number;
1086
+ /**
1087
+ * Shortcut for `window.getComputedStyle(element).propertyName`
1088
+ * static method.
1089
+ *
1090
+ * * If `element` parameter is not an `HTMLElement`, `getComputedStyle`
1091
+ * throws a `ReferenceError`.
1092
+ *
1093
+ * @param element target
1094
+ * @param property the css property
1095
+ * @return the css property value
1096
+ */
1097
+ export declare const getElementStyle: (element: HTMLElement, property: string) => string;
1098
+ /**
1099
+ * Utility to get the computed `transitionDuration`
1100
+ * from Element in miliseconds.
1101
+ *
1102
+ * @param element target
1103
+ * @return the `transitionDuration` value in miliseconds
1104
+ */
1105
+ export declare const getElementTransitionDuration: (element: HTMLElement) => number;
1106
+ /**
1107
+ * Utility to get the computed `transitionDelay`
1108
+ * from Element in miliseconds.
1109
+ *
1110
+ * @param element target
1111
+ * @return the `transitionDelay` value in miliseconds
1112
+ */
1113
+ export declare const getElementTransitionDelay: (element: HTMLElement) => number;
1114
+ /**
1115
+ * Returns an `{x,y}` object with the target
1116
+ * `HTMLElement` / `Node` scroll position.
1117
+ *
1118
+ * @see https://github.com/floating-ui/floating-ui
1119
+ *
1120
+ * @param element target node / element
1121
+ * @returns the scroll tuple
1122
+ */
1123
+ export declare const getNodeScroll: (element: HTMLElement | Window) => {
1124
+ x: number;
1125
+ y: number;
395
1126
  };
1127
+ /**
1128
+ * Returns the `parentNode` also going through `ShadowRoot`.
1129
+ *
1130
+ * @see https://github.com/floating-ui/floating-ui
1131
+ *
1132
+ * @param {Node} node the target node
1133
+ * @returns {Node} the apropriate parent node
1134
+ */
1135
+ export declare const getParentNode: (node: Node) => Node | ParentNode;
1136
+ export declare interface OffsetRect {
1137
+ width: number;
1138
+ height: number;
1139
+ x: number;
1140
+ y: number;
1141
+ }
1142
+ /**
1143
+ * Returns the rect relative to a given offset parent and its scroll position.
1144
+ *
1145
+ * @see https://github.com/floating-ui/floating-ui
1146
+ *
1147
+ * @param element target
1148
+ * @param offsetParent the container / offset parent
1149
+ * @param scroll the offsetParent scroll position
1150
+ * @returns a DOMRect like object
1151
+ */
1152
+ export declare const getRectRelativeToOffsetParent: (element: HTMLElement, offsetParent: HTMLElement, scroll: {
1153
+ x: number;
1154
+ y: number;
1155
+ }) => OffsetRect;
1156
+ /**
1157
+ * Returns a unique identifier for popover, tooltip, scrollspy.
1158
+ *
1159
+ * @param element target element
1160
+ * @param key optional identifier key
1161
+ * @returns an existing or new unique ID
1162
+ */
1163
+ export declare const getUID: (element: HTMLElement, key?: string) => number;
1164
+ /**
1165
+ * Returns the `Window` object of a target node.
1166
+ *
1167
+ * @see https://github.com/floating-ui/floating-ui
1168
+ *
1169
+ * @param node target node
1170
+ * @returns the `Window` object
1171
+ */
1172
+ export declare const getWindow: (node?: Node) => Window;
1173
+ /**
1174
+ * Shortie for the `Array.isArray()` static method.
1175
+ *
1176
+ * @param obj array-like iterable object
1177
+ * @returns the query result
1178
+ */
1179
+ export declare const isArray: (obj?: unknown) => obj is any[];
1180
+ /**
1181
+ * Checks if an element is an `HTMLCanvasElement` or `<canvas>`.
1182
+ *
1183
+ * @param element the target element
1184
+ * @returns the query result
1185
+ */
1186
+ export declare const isCanvas: (element?: unknown) => element is HTMLCanvasElement;
1187
+ /**
1188
+ * Checks if an object is a `Document`.
1189
+ *
1190
+ * @see https://dom.spec.whatwg.org/#node
1191
+ *
1192
+ * @param obj the target object
1193
+ * @returns the query result
1194
+ */
1195
+ export declare const isDocument: (obj?: unknown) => obj is Document;
1196
+ export declare interface CustomElement extends HTMLElement {
1197
+ shadowRoot: ShadowRoot;
1198
+ connectedCallback?: () => void;
1199
+ disconnectedCallback?: () => void;
1200
+ adoptedCallback?: () => void;
1201
+ attributeChangedCallback?: () => void;
1202
+ }
1203
+ /**
1204
+ * Checks if an object is a `CustomElement`.
1205
+ *
1206
+ * @param element the target object
1207
+ * @returns the query result
1208
+ */
1209
+ export declare const isCustomElement: <T extends CustomElement>(element?: unknown) => element is T;
1210
+ /**
1211
+ * Checks if an object is an `Element`.
1212
+ *
1213
+ * @see https://dom.spec.whatwg.org/#node
1214
+ *
1215
+ * ```
1216
+ * ELEMENT_NODE = 1;
1217
+ * ATTRIBUTE_NODE = 2;
1218
+ * TEXT_NODE = 3;
1219
+ * CDATA_SECTION_NODE = 4;
1220
+ * ENTITY_REFERENCE_NODE = 5; // legacy
1221
+ * ENTITY_NODE = 6; // legacy
1222
+ * PROCESSING_INSTRUCTION_NODE = 7;
1223
+ * COMMENT_NODE = 8;
1224
+ * DOCUMENT_NODE = 9;
1225
+ * DOCUMENT_TYPE_NODE = 10;
1226
+ * DOCUMENT_FRAGMENT_NODE = 11;
1227
+ * ```
1228
+ * @param element the target object
1229
+ * @returns the query result
1230
+ */
1231
+ export declare const isElement: (element?: unknown) => element is Element;
1232
+ /**
1233
+ * Utility to determine if an `HTMLElement`
1234
+ * is partially visible in viewport.
1235
+ *
1236
+ * @param element target
1237
+ * @return the query result
1238
+ */
1239
+ export declare const isElementInScrollRange: (element?: HTMLElement) => boolean;
1240
+ /**
1241
+ * Utility to determine if an `HTMLElement`
1242
+ * is fully visible in the viewport.
1243
+ *
1244
+ * @param element target
1245
+ * @return the query result
1246
+ */
1247
+ export declare const isElementInViewport: (element?: HTMLElement) => boolean;
1248
+ /**
1249
+ * Checks if an object is an `Array` in which all items are `Element`.
1250
+ *
1251
+ * @param obj the target object
1252
+ * @returns the query result
1253
+ */
1254
+ export declare const isElementsArray: (obj?: unknown) => obj is HTMLElement[];
1255
+ /**
1256
+ * Checks if an object is a `Function`.
1257
+ *
1258
+ * @param fn the target object
1259
+ * @returns the query result
1260
+ */
1261
+ export declare const isFunction: (fn?: unknown) => fn is (...arg0: any[]) => any;
1262
+ /**
1263
+ * Checks if a value is an `Object`.
1264
+ *
1265
+ * @param obj the target object
1266
+ * @returns the query result
1267
+ */
1268
+ export declare const isObject: (obj?: unknown) => obj is object;
1269
+ /**
1270
+ * Checks if an object is an `HTMLCollection`.
1271
+ *
1272
+ * @param obj the target object
1273
+ * @returns the query result
1274
+ */
1275
+ export declare const isHTMLCollection: (obj?: unknown) => obj is HTMLCollection;
1276
+ /**
1277
+ * Checks if an element is an `HTMLElement`.
1278
+ *
1279
+ * @see https://dom.spec.whatwg.org/#node
1280
+ *
1281
+ * @param element the target object
1282
+ * @returns the query result
1283
+ */
1284
+ export declare const isHTMLElement: (element?: unknown) => element is HTMLElement;
1285
+ /**
1286
+ * Check if a target element is an `<img>`.
1287
+ *
1288
+ * @param element the target element
1289
+ * @returns the query result
1290
+ */
1291
+ export declare const isHTMLImageElement: (element?: unknown) => element is HTMLImageElement;
1292
+ /**
1293
+ * Checks if a string is a `JSON` string.
1294
+ *
1295
+ * @param str the target string
1296
+ * @returns the query result
1297
+ */
1298
+ export declare const isJSON: (str?: string) => boolean;
1299
+ /**
1300
+ * Checks if an element is a `Map`.
1301
+ *
1302
+ * @param obj the target object
1303
+ * @returns the query result
1304
+ */
1305
+ export declare const isMap: (obj?: unknown) => obj is Map<any, any>;
1306
+ /**
1307
+ * Checks if an element is a `WeakMap`.
1308
+ *
1309
+ * @param obj the target object
1310
+ * @returns the query result
1311
+ */
1312
+ export declare const isWeakMap: (obj?: unknown) => obj is WeakMap<any, any>;
1313
+ /**
1314
+ * Checks if an element is an `<svg>` (or any type of SVG element),
1315
+ * `<img>`, `<video>` or `<canvas>`.
1316
+ *
1317
+ * *Tooltip* / *Popover* works different with media elements.
1318
+ *
1319
+ * @param element the target element
1320
+ * @returns the query result
1321
+ */
1322
+ export declare const isMedia: (element?: unknown) => element is HTMLCanvasElement | HTMLImageElement | SVGElement | HTMLVideoElement;
1323
+ /**
1324
+ * Checks if an object is a `Node`.
1325
+ *
1326
+ * @param node the target object
1327
+ * @returns the query result
1328
+ */
1329
+ export declare const isNode: (node?: unknown) => node is Node;
1330
+ /**
1331
+ * Checks if an object is a `NodeList`.
1332
+ * => equivalent to `object instanceof NodeList`
1333
+ *
1334
+ * @param obj the target object
1335
+ * @returns the query result
1336
+ */
1337
+ export declare const isNodeList: (obj?: unknown) => obj is NodeList;
1338
+ /**
1339
+ * Shortie for `typeof SOMETHING === "number"`.
1340
+ *
1341
+ * @param num input value
1342
+ * @returns the query result
1343
+ */
1344
+ export declare const isNumber: (num?: unknown) => num is number;
1345
+ /**
1346
+ * Checks if a page is Right To Left.
1347
+ *
1348
+ * @param node the target
1349
+ * @returns the query result
1350
+ */
1351
+ export declare const isRTL: (node?: Node) => boolean;
1352
+ /**
1353
+ * Checks if a target `HTMLElement` is affected by scale.
1354
+ *
1355
+ * @see https://github.com/floating-ui/floating-ui
1356
+ *
1357
+ * @param element target
1358
+ * @returns the query result
1359
+ */
1360
+ export declare const isScaledElement: (element?: HTMLElement) => boolean;
1361
+ /**
1362
+ * Check if target is a `ShadowRoot`.
1363
+ *
1364
+ * @param element target
1365
+ * @returns the query result
1366
+ */
1367
+ export declare const isShadowRoot: (element?: unknown) => element is ShadowRoot;
1368
+ /**
1369
+ * Shortie for `typeof SOMETHING === "string"`.
1370
+ *
1371
+ * @param str input value
1372
+ * @returns the query result
1373
+ */
1374
+ export declare const isString: (str?: unknown) => str is string;
1375
+ /**
1376
+ * Check if an element is an `<svg>` or any other SVG element,
1377
+ * an equivalent to `SOMETHING instanceof SVGElement`.
1378
+ *
1379
+ * @param element the target element
1380
+ * @returns the query result
1381
+ */
1382
+ export declare const isSVGElement: (element?: unknown) => element is SVGElement;
1383
+ /**
1384
+ * Check if a target element is a `<table>`, `<td>` or `<th>`.
1385
+ * This specific check is important for determining
1386
+ * the `offsetParent` of a given element.
1387
+ *
1388
+ * @param element the target element
1389
+ * @returns the query result
1390
+ */
1391
+ export declare const isTableElement: (element?: unknown) => element is HTMLTableElement | HTMLTableCellElement;
1392
+ /**
1393
+ * Check if a target object is `Window`.
1394
+ * => equivalent to `object instanceof Window`
1395
+ *
1396
+ * @param obj the target object
1397
+ * @returns the query result
1398
+ */
1399
+ export declare const isWindow: (obj?: unknown) => obj is Window;
1400
+ /**
1401
+ * Shortcut for `HTMLElement.closest` method which also works
1402
+ * with children of `ShadowRoot`. The order of the parameters
1403
+ * is intentional since they're both required.
1404
+ *
1405
+ * @see https://stackoverflow.com/q/54520554/803358
1406
+ *
1407
+ * @param element Element to look into
1408
+ * @param selector the selector name
1409
+ * @return the query result
1410
+ */
1411
+ export declare const closest: (element: HTMLElement, selector: string) => HTMLElement | null;
1412
+ /**
1413
+ * Utility to check if target is typeof `HTMLElement`, `Element`, `Node`
1414
+ * or find one that matches a selector.
1415
+ *
1416
+ * @param selector the input selector or target element
1417
+ * @param parent optional node to look into
1418
+ * @return the `HTMLElement` or `querySelector` result
1419
+ */
1420
+ export declare const querySelector: (selector: HTMLElement | string, parent?: ParentNode) => HTMLElement | null;
1421
+ /**
1422
+ * Returns an `Array` of `Node` elements that are registered as
1423
+ * `CustomElement`.
1424
+ *
1425
+ * @see https://stackoverflow.com/questions/27334365/how-to-get-list-of-registered-custom-elements
1426
+ *
1427
+ * @param parent parent to look into
1428
+ * @returns the query result
1429
+ */
1430
+ export declare const getCustomElements: (parent?: ParentNode) => CustomElement[];
1431
+ /**
1432
+ * Returns an `HTMLElement` that matches the id in the document.
1433
+ * Within multiple <iframe> elements, a `parent` parameter
1434
+ * would decisively locate the correct element.
1435
+ *
1436
+ * @param id the ID selector
1437
+ * @param context an element in it's document or document
1438
+ * @returns the requested element
1439
+ */
1440
+ export declare const getElementById: (id: string, context?: Node) => HTMLElement | null;
1441
+ /**
1442
+ * A shortcut for `(document|Element).querySelectorAll`.
1443
+ *
1444
+ * @param selector the input selector
1445
+ * @param parent optional node to look into
1446
+ * @return the query result
1447
+ */
1448
+ export declare const querySelectorAll: (selector: string, parent?: ParentNode) => NodeListOf<HTMLElement>;
1449
+ /**
1450
+ * Shortcut for `HTMLElement.getElementsByTagName` method. Some `Node` elements
1451
+ * like `ShadowRoot` do not support `getElementsByTagName`.
1452
+ *
1453
+ * @param selector the tag name
1454
+ * @param parent optional Element to look into
1455
+ * @return the 'HTMLCollection'
1456
+ */
1457
+ export declare const getElementsByTagName: (selector: string, parent?: ParentNode) => HTMLCollectionOf<HTMLElement>;
1458
+ /**
1459
+ * Shortcut for `HTMLElement.getElementsByClassName` method. Some `Node` elements
1460
+ * like `ShadowRoot` do not support `getElementsByClassName`.
1461
+ *
1462
+ * @param selector the class name
1463
+ * @param parent optional Element to look into
1464
+ * @return the 'HTMLCollection'
1465
+ */
1466
+ export declare const getElementsByClassName: (selector: string, parent?: ParentNode) => HTMLCollectionOf<HTMLElement>;
1467
+ /**
1468
+ * Check if element matches a CSS selector.
1469
+ *
1470
+ * @param target the target element
1471
+ * @param selector the selector to match
1472
+ * @returns the query result
1473
+ */
1474
+ export declare const matches: (target: Element, selector: string) => boolean;
396
1475
 
397
- export {
398
- SHORTY as default,
399
- };
1476
+ export as namespace SHORTY;
400
1477
 
401
1478
  export {};