@@ -28,6 +28,7 @@ import {
2828 CreateComponentPublicInstance ,
2929 ComponentPublicInstanceConstructor
3030} from './componentPublicInstance'
31+ import { SlotsType } from './componentSlots'
3132
3233export type PublicProps = VNodeProps &
3334 AllowedComponentProps &
@@ -43,6 +44,7 @@ export type DefineComponent<
4344 Extends extends ComponentOptionsMixin = ComponentOptionsMixin ,
4445 E extends EmitsOptions = { } ,
4546 EE extends string = string ,
47+ S extends SlotsType = { } ,
4648 PP = PublicProps ,
4749 Props = Readonly <
4850 PropsOrPropOptions extends ComponentPropsOptions
@@ -61,6 +63,7 @@ export type DefineComponent<
6163 Mixin ,
6264 Extends ,
6365 E ,
66+ S ,
6467 PP & Props ,
6568 Defaults ,
6669 true
@@ -77,6 +80,7 @@ export type DefineComponent<
7780 Extends ,
7881 E ,
7982 EE ,
83+ S ,
8084 Defaults
8185 > &
8286 PP
@@ -91,29 +95,33 @@ export type DefineComponent<
9195export function defineComponent <
9296 Props extends Record < string , any > ,
9397 E extends EmitsOptions = { } ,
94- EE extends string = string
98+ EE extends string = string ,
99+ S extends SlotsType = { }
95100> (
96101 setup : (
97102 props : Props ,
98- ctx : SetupContext < E >
103+ ctx : SetupContext < E , S >
99104 ) => RenderFunction | Promise < RenderFunction > ,
100105 options ?: Pick < ComponentOptions , 'name' | 'inheritAttrs' > & {
101106 props ?: ( keyof Props ) [ ]
102107 emits ?: E | EE [ ]
108+ slots ?: S
103109 }
104110) : ( props : Props & EmitsToProps < E > ) => any
105111export function defineComponent <
106112 Props extends Record < string , any > ,
107113 E extends EmitsOptions = { } ,
108- EE extends string = string
114+ EE extends string = string ,
115+ S extends SlotsType = { }
109116> (
110117 setup : (
111118 props : Props ,
112- ctx : SetupContext < E >
119+ ctx : SetupContext < E , S >
113120 ) => RenderFunction | Promise < RenderFunction > ,
114121 options ?: Pick < ComponentOptions , 'name' | 'inheritAttrs' > & {
115122 props ?: ComponentObjectPropsOptions < Props >
116123 emits ?: E | EE [ ]
124+ slots ?: S
117125 }
118126) : ( props : Props & EmitsToProps < E > ) => any
119127
@@ -130,6 +138,7 @@ export function defineComponent<
130138 Extends extends ComponentOptionsMixin = ComponentOptionsMixin ,
131139 E extends EmitsOptions = { } ,
132140 EE extends string = string ,
141+ S extends SlotsType = { } ,
133142 I extends ComponentInjectOptions = { } ,
134143 II extends string = string
135144> (
@@ -143,10 +152,11 @@ export function defineComponent<
143152 Extends ,
144153 E ,
145154 EE ,
155+ S ,
146156 I ,
147157 II
148158 >
149- ) : DefineComponent < Props , RawBindings , D , C , M , Mixin , Extends , E , EE >
159+ ) : DefineComponent < Props , RawBindings , D , C , M , Mixin , Extends , E , EE , S >
150160
151161// overload 3: object format with array props declaration
152162// props inferred as { [key in PropNames]?: any }
@@ -161,6 +171,7 @@ export function defineComponent<
161171 Extends extends ComponentOptionsMixin = ComponentOptionsMixin ,
162172 E extends EmitsOptions = { } ,
163173 EE extends string = string ,
174+ S extends SlotsType = { } ,
164175 I extends ComponentInjectOptions = { } ,
165176 II extends string = string
166177> (
@@ -174,6 +185,7 @@ export function defineComponent<
174185 Extends ,
175186 E ,
176187 EE ,
188+ S ,
177189 I ,
178190 II
179191 >
@@ -186,7 +198,8 @@ export function defineComponent<
186198 Mixin ,
187199 Extends ,
188200 E ,
189- EE
201+ EE ,
202+ S
190203>
191204
192205// overload 4: object format with object props declaration
@@ -203,6 +216,7 @@ export function defineComponent<
203216 Extends extends ComponentOptionsMixin = ComponentOptionsMixin ,
204217 E extends EmitsOptions = { } ,
205218 EE extends string = string ,
219+ S extends SlotsType = { } ,
206220 I extends ComponentInjectOptions = { } ,
207221 II extends string = string
208222> (
@@ -216,10 +230,11 @@ export function defineComponent<
216230 Extends ,
217231 E ,
218232 EE ,
233+ S ,
219234 I ,
220235 II
221236 >
222- ) : DefineComponent < PropsOptions , RawBindings , D , C , M , Mixin , Extends , E , EE >
237+ ) : DefineComponent < PropsOptions , RawBindings , D , C , M , Mixin , Extends , E , EE , S >
223238
224239// implementation, close to no-op
225240export function defineComponent (
0 commit comments