@@ -22,10 +22,14 @@ export interface MethodOptions {
22
22
[ key : string ] : Function
23
23
}
24
24
25
- export type SetupFunction < Props , RawBindings = { } > = (
25
+ export type SetupFunction <
26
+ Props ,
27
+ RawBindings = { } ,
28
+ Emits extends EmitsOptions = { }
29
+ > = (
26
30
this : void ,
27
31
props : Readonly < Props > ,
28
- ctx : SetupContext
32
+ ctx : SetupContext < Emits >
29
33
) => RawBindings | ( ( ) => VNode | null ) | void
30
34
31
35
interface ComponentOptionsBase <
@@ -70,7 +74,7 @@ export type ComponentOptionsWithProps<
70
74
> = ComponentOptionsBase < Props , D , C , M > & {
71
75
props ?: PropsOptions
72
76
emits ?: Emits & ThisType < void >
73
- setup ?: SetupFunction < Props , RawBindings >
77
+ setup ?: SetupFunction < Props , RawBindings , Emits >
74
78
} & ThisType <
75
79
ComponentRenderProxy < Props , RawBindings , D , C , M , Mixin , Extends , Emits >
76
80
>
@@ -88,7 +92,7 @@ export type ComponentOptionsWithArrayProps<
88
92
> = ComponentOptionsBase < Props , D , C , M > & {
89
93
props ?: PropNames [ ]
90
94
emits ?: Emits & ThisType < void >
91
- setup ?: SetupFunction < Props , RawBindings >
95
+ setup ?: SetupFunction < Props , RawBindings , Emits >
92
96
} & ThisType <
93
97
ComponentRenderProxy < Props , RawBindings , D , C , M , Mixin , Extends , Emits >
94
98
>
@@ -105,7 +109,7 @@ export type ComponentOptionsWithoutProps<
105
109
> = ComponentOptionsBase < Props , D , C , M > & {
106
110
props ?: undefined
107
111
emits ?: Emits & ThisType < void >
108
- setup ?: SetupFunction < Props , RawBindings >
112
+ setup ?: SetupFunction < Props , RawBindings , Emits >
109
113
} & ThisType <
110
114
ComponentRenderProxy < Props , RawBindings , D , C , M , Mixin , Extends , Emits >
111
115
>
0 commit comments