1
1
import { default as default_2 } from '@thednp/position-observer' ;
2
+ import { TouchEvent as TouchEvent_2 } from '@thednp/shorty' ;
2
3
3
4
/** Creates a new Alert instance. */
4
5
export declare class Alert extends BaseComponent {
5
6
static selector : string ;
6
- static init : ( element : HTMLElement ) => Alert ;
7
- static getInstance : ( element : HTMLElement ) => Alert | null ;
7
+ static init : ( element : Element ) => Alert ;
8
+ static getInstance : ( element : Element ) => Alert | null ;
8
9
dismiss : HTMLElement | null ;
9
- constructor ( target : HTMLElement | string ) ;
10
+ constructor ( target : Element | string ) ;
10
11
/** Returns component name string. */
11
12
get name ( ) : string ;
12
13
/**
@@ -27,13 +28,13 @@ export declare class Alert extends BaseComponent {
27
28
28
29
/** Returns a new `BaseComponent` instance. */
29
30
declare class BaseComponent {
30
- element : HTMLElement ;
31
+ element : Element ;
31
32
options ?: BaseOptions ;
32
33
/**
33
- * @param target `HTMLElement ` or selector string
34
+ * @param target `Element ` or selector string
34
35
* @param config component instance options
35
36
*/
36
- constructor ( target : HTMLElement | string , config ?: BaseOptions ) ;
37
+ constructor ( target : Element | string , config ?: BaseOptions ) ;
37
38
get version ( ) : string ;
38
39
get name ( ) : string ;
39
40
get defaults ( ) : { } ;
@@ -50,13 +51,14 @@ declare interface BaseOptions {
50
51
/** Creates a new `Button` instance. */
51
52
export declare class Button extends BaseComponent {
52
53
static selector : string ;
53
- static init : ( element : HTMLElement ) => Button ;
54
- static getInstance : ( element : HTMLElement ) => Button | null ;
54
+ static init : ( element : Element ) => Button ;
55
+ static getInstance : ( element : Element ) => Button | null ;
55
56
isActive : boolean ;
57
+ element : HTMLElement ;
56
58
/**
57
59
* @param target usually a `.btn` element
58
60
*/
59
- constructor ( target : HTMLElement | string ) ;
61
+ constructor ( target : Element | string ) ;
60
62
/**
61
63
* Returns component name string.
62
64
*/
@@ -80,8 +82,9 @@ export declare class Button extends BaseComponent {
80
82
/** Creates a new `Carousel` instance. */
81
83
export declare class Carousel extends BaseComponent {
82
84
static selector : string ;
83
- static init : ( element : HTMLElement ) => Carousel ;
84
- static getInstance : ( element : HTMLElement ) => Carousel | null ;
85
+ static init : ( element : Element ) => Carousel ;
86
+ static getInstance : ( element : Element ) => Carousel | null ;
87
+ element : HTMLElement ;
85
88
options : CarouselOptions ;
86
89
direction : "right" | "left" ;
87
90
index : number ;
@@ -94,7 +97,7 @@ export declare class Carousel extends BaseComponent {
94
97
* @param target mostly a `.carousel` element
95
98
* @param config instance options
96
99
*/
97
- constructor ( target : HTMLElement | string , config ?: Partial < CarouselOptions > ) ;
100
+ constructor ( target : Element | string , config ?: Partial < CarouselOptions > ) ;
98
101
/**
99
102
* Returns component name string.
100
103
*/
@@ -145,16 +148,17 @@ declare interface CarouselOptions extends BaseOptions {
145
148
/** Returns a new `Colapse` instance. */
146
149
export declare class Collapse extends BaseComponent {
147
150
static selector : string ;
148
- static init : ( element : HTMLElement ) => Collapse ;
149
- static getInstance : ( element : HTMLElement ) => Collapse | null ;
151
+ static init : ( element : Element ) => Collapse ;
152
+ static getInstance : ( element : Element ) => Collapse | null ;
153
+ element : HTMLElement ;
150
154
options : CollapseOptions ;
151
- parent : HTMLElement | null ;
152
- triggers : HTMLElement [ ] ;
155
+ parent : Element | null ;
156
+ triggers : Element [ ] ;
153
157
/**
154
158
* @param target and `Element` that matches the selector
155
159
* @param config instance options
156
160
*/
157
- constructor ( target : HTMLElement | string , config ?: Partial < CollapseOptions > ) ;
161
+ constructor ( target : Element | string , config ?: Partial < CollapseOptions > ) ;
158
162
/**
159
163
* Returns component name string.
160
164
*/
@@ -188,8 +192,9 @@ declare interface CollapseOptions extends BaseOptions {
188
192
/** Returns a new Dropdown instance. */
189
193
export declare class Dropdown extends BaseComponent {
190
194
static selector : string ;
191
- static init : ( element : HTMLElement ) => Dropdown ;
192
- static getInstance : ( element : HTMLElement ) => Dropdown | null ;
195
+ static init : ( element : Element ) => Dropdown ;
196
+ static getInstance : ( element : Element ) => Dropdown | null ;
197
+ element : HTMLElement ;
193
198
options : DropdownOptions ;
194
199
open : boolean ;
195
200
parentElement : HTMLElement ;
@@ -199,7 +204,7 @@ export declare class Dropdown extends BaseComponent {
199
204
* @param target Element or string selector
200
205
* @param config the instance options
201
206
*/
202
- constructor ( target : HTMLElement | string , config ?: Partial < DropdownOptions > ) ;
207
+ constructor ( target : Element | string , config ?: Partial < DropdownOptions > ) ;
203
208
/**
204
209
* Returns component name string.
205
210
*/
@@ -242,20 +247,21 @@ export declare const initCallback: (context?: ParentNode) => void;
242
247
/** Returns a new `Modal` instance. */
243
248
export declare class Modal extends BaseComponent {
244
249
static selector : string ;
245
- static init : ( element : HTMLElement ) => Modal ;
246
- static getInstance : ( element : HTMLElement ) => Modal | null ;
250
+ static init : ( element : Element ) => Modal ;
251
+ static getInstance : ( element : Element ) => Modal | null ;
252
+ element : HTMLElement ;
247
253
options : ModalOptions ;
248
254
modalDialog : HTMLElement ;
249
255
triggers : HTMLElement [ ] ;
250
256
isStatic : boolean ;
251
257
hasFade : boolean ;
252
- relatedTarget : HTMLElement | null ;
258
+ relatedTarget : EventTarget & HTMLElement | null ;
253
259
_observer : ResizeObserver ;
254
260
/**
255
261
* @param target usually the `.modal` element
256
262
* @param config instance options
257
263
*/
258
- constructor ( target : HTMLElement | string , config ?: Partial < ModalOptions > ) ;
264
+ constructor ( target : Element | string , config ?: Partial < ModalOptions > ) ;
259
265
/**
260
266
* Returns component name string.
261
267
*/
@@ -295,16 +301,17 @@ declare interface ModalOptions extends BaseOptions {
295
301
/** Returns a new `Offcanvas` instance. */
296
302
export declare class Offcanvas extends BaseComponent {
297
303
static selector : string ;
298
- static init : ( element : HTMLElement ) => Offcanvas ;
299
- static getInstance : ( element : HTMLElement ) => Offcanvas | null ;
304
+ static init : ( element : Element ) => Offcanvas ;
305
+ static getInstance : ( element : Element ) => Offcanvas | null ;
306
+ element : HTMLElement ;
300
307
options : OffcanvasOptions ;
301
308
triggers : HTMLElement [ ] ;
302
- relatedTarget : HTMLElement | null ;
309
+ relatedTarget : EventTarget & HTMLElement | undefined ;
303
310
/**
304
311
* @param target usually an `.offcanvas` element
305
312
* @param config instance options
306
313
*/
307
- constructor ( target : HTMLElement | string , config ?: Partial < OffcanvasOptions > ) ;
314
+ constructor ( target : Element | string , config ?: Partial < OffcanvasOptions > ) ;
308
315
/**
309
316
* Returns component name string.
310
317
*/
@@ -342,15 +349,15 @@ declare interface OffcanvasOptions extends BaseOptions {
342
349
/** Returns a new `Popover` instance. */
343
350
export declare class Popover extends Tooltip {
344
351
static selector : string ;
345
- static init : ( element : HTMLElement ) => Popover ;
346
- static getInstance : ( element : HTMLElement ) => Popover | null ;
347
- static styleTip : < T extends Tooltip > ( self : T ) => void ;
352
+ static init : ( element : Element ) => Popover ;
353
+ static getInstance : ( element : Element ) => Popover | null ;
354
+ static styleTip : ( self : Tooltip ) => void ;
348
355
options : PopoverOptions ;
349
356
/**
350
357
* @param target the target element
351
358
* @param config the instance options
352
359
*/
353
- constructor ( target : HTMLElement | string , config ?: Partial < PopoverOptions > ) ;
360
+ constructor ( target : Element | string , config ?: Partial < PopoverOptions > ) ;
354
361
/**
355
362
* Returns component name string.
356
363
*/
@@ -379,8 +386,9 @@ export declare const removeDataAPI: (context?: ParentNode) => void;
379
386
/** Returns a new `ScrollSpy` instance. */
380
387
export declare class ScrollSpy extends BaseComponent {
381
388
static selector : string ;
382
- static init : ( element : HTMLElement ) => ScrollSpy ;
383
- static getInstance : ( element : HTMLElement ) => ScrollSpy | null ;
389
+ static init : ( element : Element ) => ScrollSpy ;
390
+ static getInstance : ( element : Element ) => ScrollSpy | null ;
391
+ element : HTMLElement ;
384
392
options : ScrollSpyOptions ;
385
393
target : HTMLElement | null ;
386
394
scrollTarget : HTMLElement ;
@@ -397,15 +405,15 @@ export declare class ScrollSpy extends BaseComponent {
397
405
* @param target the target element
398
406
* @param config the instance options
399
407
*/
400
- constructor ( target : HTMLElement | string , config ?: Partial < ScrollSpyOptions > ) ;
408
+ constructor ( target : Element | string , config ?: Partial < ScrollSpyOptions > ) ;
401
409
/**
402
410
* Returns component name string.
403
411
*/
404
412
get name ( ) : string ;
405
413
/**
406
414
* Returns component default options.
407
415
*/
408
- get defaults ( ) : ScrollSpyOptions ;
416
+ get defaults ( ) : Partial < ScrollSpyOptions > ;
409
417
/** Updates all items. */
410
418
refresh : ( ) => void ;
411
419
/** Removes `ScrollSpy` from the target element. */
@@ -414,21 +422,22 @@ export declare class ScrollSpy extends BaseComponent {
414
422
415
423
declare interface ScrollSpyOptions extends BaseOptions {
416
424
offset : number ;
417
- target : HTMLElement | string | null ;
425
+ target : HTMLElement | string ;
418
426
}
419
427
420
428
/** Creates a new `Tab` instance. */
421
429
export declare class Tab extends BaseComponent {
422
430
static selector : string ;
423
- static init : ( element : HTMLElement ) => Tab ;
424
- static getInstance : ( element : HTMLElement ) => Tab | null ;
431
+ static init : ( element : Element ) => Tab ;
432
+ static getInstance : ( element : Element ) => Tab | null ;
433
+ element : HTMLElement ;
425
434
nav : HTMLElement | null ;
426
435
content : HTMLElement | null ;
427
436
tabContent : HTMLElement | null ;
428
437
nextContent : HTMLElement | null ;
429
438
dropdown : HTMLElement | null ;
430
439
/** @param target the target element */
431
- constructor ( target : HTMLElement | string ) ;
440
+ constructor ( target : Element | string ) ;
432
441
/**
433
442
* Returns component name string.
434
443
*/
@@ -448,8 +457,9 @@ export declare class Tab extends BaseComponent {
448
457
/** Creates a new `Toast` instance. */
449
458
export declare class Toast extends BaseComponent {
450
459
static selector : string ;
451
- static init : ( element : HTMLElement ) => Toast ;
452
- static getInstance : ( element : HTMLElement ) => Toast | null ;
460
+ static init : ( element : Element ) => Toast ;
461
+ static getInstance : ( element : Element ) => Toast | null ;
462
+ element : HTMLElement ;
453
463
options : ToastOptions ;
454
464
dismiss : HTMLElement | null ;
455
465
triggers : HTMLElement [ ] ;
@@ -458,7 +468,7 @@ export declare class Toast extends BaseComponent {
458
468
* @param target the target `.toast` element
459
469
* @param config the instance options
460
470
*/
461
- constructor ( target : HTMLElement | string , config ?: Partial < ToastOptions > ) ;
471
+ constructor ( target : Element | string , config ?: Partial < ToastOptions > ) ;
462
472
/**
463
473
* Returns component name string.
464
474
*/
@@ -498,23 +508,24 @@ declare interface ToastOptions extends BaseOptions {
498
508
/** Creates a new `Tooltip` instance. */
499
509
export declare class Tooltip extends BaseComponent {
500
510
static selector : string ;
501
- static init : ( element : HTMLElement ) => Tooltip ;
502
- static getInstance : ( element : HTMLElement ) => Tooltip | null ;
503
- static styleTip : < T extends Tooltip > ( self : T ) => void ;
511
+ static init : ( element : Element ) => Tooltip ;
512
+ static getInstance : ( element : Element ) => Tooltip | null ;
513
+ static styleTip : ( self : Tooltip ) => void ;
514
+ element : Element & HTMLOrSVGElement ;
504
515
options : TooltipOptions ;
505
516
btn ?: HTMLElement ;
506
- tooltip ? : HTMLElement ;
507
- container : ParentNode ;
508
- arrow ?: HTMLElement ;
509
- offsetParent ? : HTMLElement ;
517
+ tooltip : HTMLElement ;
518
+ container : HTMLElement ;
519
+ offsetParent : Element | Window ;
520
+ arrow : HTMLElement ;
510
521
enabled : boolean ;
511
522
id : string ;
512
523
_observer : default_2 ;
513
524
/**
514
525
* @param target the target element
515
526
* @param config the instance options
516
527
*/
517
- constructor ( target : HTMLElement | string , config ?: Partial < TooltipOptions > ) ;
528
+ constructor ( target : Element | string , config ?: Partial < TooltipOptions > ) ;
518
529
/**
519
530
* Returns component name string.
520
531
*/
@@ -547,7 +558,7 @@ export declare class Tooltip extends BaseComponent {
547
558
* @this {Tooltip}
548
559
* @param {TouchEvent } e the `Event` object
549
560
*/
550
- handleTouch : ( { target } : TouchEvent ) => void ;
561
+ handleTouch : ( { target } : TouchEvent_2 ) => void ;
551
562
/**
552
563
* Toggles on/off the `Tooltip` event listeners.
553
564
*
0 commit comments