1
- import { HTMLAttributes , PropType , SetupContext , SlotsType , computed , defineComponent , onMounted , ref } from 'vue' ;
1
+ import { HTMLAttributes , PropType , SlotsType , computed , defineComponent , onMounted , ref } from 'vue' ;
2
2
import { params } from '@/params' ;
3
3
import { Id , listToDirection , Timer , NotificationItemWithTimer , emitter , parse } from '@/utils' ;
4
4
import defaults from '@/defaults' ;
@@ -18,16 +18,6 @@ type NotificationItemExtended = NotificationItemWithTimer & {
18
18
state : NotificationItemState [ keyof NotificationItemState ] ;
19
19
}
20
20
21
- type Emit = {
22
- click : [ item : NotificationItem ] ,
23
- destroy : [ item : NotificationItem ] ,
24
- start : [ item : NotificationItem ] ,
25
- }
26
-
27
- type Slots = SlotsType < {
28
- body ?: ( props : { class : HTMLAttributes [ 'class' ] , item : NotificationItem , close : ( ) => void } ) => any ;
29
- } >
30
-
31
21
export default defineComponent ( {
32
22
// eslint-disable-next-line vue/multi-word-component-names
33
23
name : 'notifications' ,
@@ -126,7 +116,10 @@ export default defineComponent({
126
116
start : ( item : NotificationItem ) => true ,
127
117
/* eslint-enable @typescript-eslint/no-unused-vars */
128
118
} ,
129
- setup : ( props , { emit, slots, expose } : SetupContext < Emit , Slots > ) => {
119
+ slots : Object as SlotsType < {
120
+ body ?: ( props : { class : HTMLAttributes [ 'class' ] , item : NotificationItem , close : ( ) => void } ) => any ;
121
+ } > ,
122
+ setup : ( props , { emit, slots, expose } ) => {
130
123
const list = ref < NotificationItemExtended [ ] > ( [ ] ) ;
131
124
const timerControl = ref < Timer | null > ( null ) ;
132
125
const velocity = params . get ( 'velocity' ) ;
0 commit comments