@@ -67,7 +67,7 @@ export class ToastComponent implements OnInit, OnDestroy {
67
67
* Auto hide the toast.
68
68
* @type boolean
69
69
*/
70
- @Input ( ) autohide = true ;
70
+ @Input ( ) autohide : boolean = true ;
71
71
72
72
/**
73
73
* Sets the color context of the component to one of CoreUI’s themed colors.
@@ -79,13 +79,13 @@ export class ToastComponent implements OnInit, OnDestroy {
79
79
* Delay hiding the toast (ms).
80
80
* @type number
81
81
*/
82
- @Input ( ) delay = 5000 ;
82
+ @Input ( ) delay : number = 5000 ;
83
83
84
84
/**
85
85
* Apply fade transition to the toast.
86
86
* @type boolean
87
87
*/
88
- @Input ( ) fade = true ;
88
+ @Input ( ) fade : boolean = true ;
89
89
90
90
/**
91
91
* Toggle the visibility of component.
@@ -115,19 +115,19 @@ export class ToastComponent implements OnInit, OnDestroy {
115
115
116
116
/**
117
117
* Event emitted on visibility change. [docs]
118
- * @type boolean
118
+ * @type EventEmitter< boolean>
119
119
*/
120
- @Output ( ) visibleChange = new EventEmitter < boolean > ( ) ;
120
+ @Output ( ) visibleChange : EventEmitter < boolean > = new EventEmitter < boolean > ( ) ;
121
121
122
122
/**
123
123
* Event emitted on timer tick. [docs]
124
124
* @type number
125
125
*/
126
126
@Output ( ) timer : EventEmitter < number > = new EventEmitter ( ) ;
127
127
128
- private timerId : any ;
129
- private clockId : any ;
130
- private clockTimerId : any ;
128
+ private timerId : ReturnType < typeof setTimeout > | undefined ;
129
+ private clockId : ReturnType < typeof setInterval > | undefined ;
130
+ private clockTimerId : ReturnType < typeof setTimeout > | undefined ;
131
131
132
132
private _clock ! : number ;
133
133
@@ -188,15 +188,15 @@ export class ToastComponent implements OnInit, OnDestroy {
188
188
setTimer ( ) : void {
189
189
this . clearTimer ( ) ;
190
190
if ( this . autohide && this . visible ) {
191
- this . timerId = this . delay > 0 ? setTimeout ( ( ) => this . onClose ( ) , this . delay ) : null ;
191
+ this . timerId = this . delay > 0 ? setTimeout ( ( ) => this . onClose ( ) , this . delay ) : undefined ;
192
192
this . setClock ( ) ;
193
193
}
194
194
}
195
195
196
196
clearTimer ( ) : void {
197
197
this . clearClock ( ) ;
198
198
clearTimeout ( this . timerId ) ;
199
- this . timerId = null ;
199
+ this . timerId = undefined ;
200
200
}
201
201
202
202
onClose ( ) : void {
@@ -223,6 +223,6 @@ export class ToastComponent implements OnInit, OnDestroy {
223
223
clearClock ( ) : void {
224
224
clearTimeout ( this . clockTimerId ) ;
225
225
clearInterval ( this . clockId ) ;
226
- this . clockId = null ;
226
+ this . clockId = undefined ;
227
227
}
228
228
}
0 commit comments