@@ -89,6 +89,30 @@ export type DefineComponent<
89
89
> &
90
90
PP
91
91
92
+ type DirectSetupComponent <
93
+ P extends Record < string , any > ,
94
+ E extends EmitsOptions = { } ,
95
+ S extends SlotsType = SlotsType ,
96
+ Props = P & EmitsToProps < E > ,
97
+ PP = PublicProps ,
98
+ > = new (
99
+ props : Props & PP ,
100
+ ) => CreateComponentPublicInstance <
101
+ Props ,
102
+ { } ,
103
+ { } ,
104
+ { } ,
105
+ { } ,
106
+ ComponentOptionsMixin ,
107
+ ComponentOptionsMixin ,
108
+ E ,
109
+ PP ,
110
+ { } ,
111
+ false ,
112
+ { } ,
113
+ S
114
+ >
115
+
92
116
// defineComponent is a utility that is primarily used for type inference
93
117
// when declaring components. Type inference is provided in the component
94
118
// options (provided as the argument). The returned value has artificial types
@@ -111,7 +135,7 @@ export function defineComponent<
111
135
emits ?: E | EE [ ]
112
136
slots ?: S
113
137
} ,
114
- ) : ( props : Props & EmitsToProps < E > ) => any
138
+ ) : DirectSetupComponent < Props , E , S >
115
139
export function defineComponent <
116
140
Props extends Record < string , any > ,
117
141
E extends EmitsOptions = { } ,
@@ -127,7 +151,7 @@ export function defineComponent<
127
151
emits ?: E | EE [ ]
128
152
slots ?: S
129
153
} ,
130
- ) : ( props : Props & EmitsToProps < E > ) => any
154
+ ) : DirectSetupComponent < Props , E , S >
131
155
132
156
// overload 2: object format with no props
133
157
// (uses user defined props interface)
0 commit comments