@@ -14,6 +14,10 @@ import { VNode, VNodeData, VNodeChildren, NormalizedScopedSlot } from './vnode'
14
14
import { PluginFunction , PluginObject } from './plugin'
15
15
import { DefineComponent } from './v3-define-component'
16
16
import { nextTick } from './v3-generated'
17
+ import {
18
+ UnwrapMixinsType ,
19
+ IntersectionMixin
20
+ } from './v3-component-public-instance'
17
21
18
22
export interface CreateElement {
19
23
(
@@ -94,18 +98,28 @@ export interface Vue<
94
98
$createElement : CreateElement
95
99
}
96
100
101
+ type ComponentMixin = ComponentOptions < any , any , any , any , any >
102
+
97
103
export type CombinedVueInstance <
98
104
Instance extends Vue ,
99
105
Data ,
100
106
Methods ,
101
107
Computed ,
102
108
Props ,
103
- SetupBindings = { }
104
- > = Data &
109
+ SetupBindings = { } ,
110
+ Mixin extends ComponentMixin = ComponentMixin ,
111
+ Extends extends ComponentMixin = ComponentMixin ,
112
+ PublicMixin = IntersectionMixin < Mixin > & IntersectionMixin < Extends >
113
+ > = UnwrapMixinsType < PublicMixin , 'D' > &
114
+ Data &
115
+ UnwrapMixinsType < PublicMixin , 'M' > &
105
116
Methods &
117
+ UnwrapMixinsType < PublicMixin , 'C' > &
106
118
Computed &
119
+ UnwrapMixinsType < PublicMixin , 'P' > &
107
120
Props &
108
121
Instance &
122
+ UnwrapMixinsType < PublicMixin , 'B' > &
109
123
( SetupBindings extends void ? { } : SetupBindings )
110
124
111
125
export type ExtendedVue <
@@ -114,9 +128,20 @@ export type ExtendedVue<
114
128
Methods ,
115
129
Computed ,
116
130
Props ,
117
- SetupBindings = { }
131
+ SetupBindings = { } ,
132
+ Mixin extends ComponentMixin = ComponentMixin ,
133
+ Extends extends ComponentMixin = ComponentMixin
118
134
> = VueConstructor <
119
- CombinedVueInstance < Instance , Data , Methods , Computed , Props , SetupBindings > &
135
+ CombinedVueInstance <
136
+ Instance ,
137
+ Data ,
138
+ Methods ,
139
+ Computed ,
140
+ Props ,
141
+ SetupBindings ,
142
+ Mixin ,
143
+ Extends
144
+ > &
120
145
Vue
121
146
>
122
147
@@ -142,23 +167,29 @@ export interface VueConstructor<V extends Vue = Vue> {
142
167
Methods = object ,
143
168
Computed = object ,
144
169
PropNames extends string = never ,
145
- SetupBindings = { }
170
+ SetupBindings = { } ,
171
+ Mixin extends ComponentMixin = ComponentMixin ,
172
+ Extends extends ComponentMixin = ComponentMixin
146
173
> (
147
174
options ?: ThisTypedComponentOptionsWithArrayProps <
148
175
V ,
149
176
Data ,
150
177
Methods ,
151
178
Computed ,
152
179
PropNames ,
153
- SetupBindings
180
+ SetupBindings ,
181
+ Mixin ,
182
+ Extends
154
183
>
155
184
) : CombinedVueInstance <
156
185
V ,
157
186
Data ,
158
187
Methods ,
159
188
Computed ,
160
189
Record < PropNames , any > ,
161
- SetupBindings
190
+ SetupBindings ,
191
+ Mixin ,
192
+ Extends
162
193
>
163
194
164
195
/**
@@ -172,23 +203,29 @@ export interface VueConstructor<V extends Vue = Vue> {
172
203
Methods = object ,
173
204
Computed = object ,
174
205
Props = object ,
175
- SetupBindings = { }
206
+ SetupBindings = { } ,
207
+ Mixin extends ComponentMixin = ComponentMixin ,
208
+ Extends extends ComponentMixin = ComponentMixin
176
209
> (
177
210
options ?: ThisTypedComponentOptionsWithRecordProps <
178
211
V ,
179
212
Data ,
180
213
Methods ,
181
214
Computed ,
182
215
Props ,
183
- SetupBindings
216
+ SetupBindings ,
217
+ Mixin ,
218
+ Extends
184
219
>
185
220
) : CombinedVueInstance <
186
221
V ,
187
222
Data ,
188
223
Methods ,
189
224
Computed ,
190
225
Record < keyof Props , any > ,
191
- SetupBindings
226
+ SetupBindings ,
227
+ Mixin ,
228
+ Extends
192
229
>
193
230
194
231
/**
@@ -211,38 +248,63 @@ export interface VueConstructor<V extends Vue = Vue> {
211
248
Methods ,
212
249
Computed ,
213
250
PropNames extends string = never ,
214
- SetupBindings = { }
251
+ SetupBindings = { } ,
252
+ Mixin extends ComponentMixin = ComponentMixin ,
253
+ Extends extends ComponentMixin = ComponentMixin
215
254
> (
216
255
options ?: ThisTypedComponentOptionsWithArrayProps <
217
256
V ,
218
257
Data ,
219
258
Methods ,
220
259
Computed ,
221
260
PropNames ,
222
- SetupBindings
261
+ SetupBindings ,
262
+ Mixin ,
263
+ Extends
223
264
>
224
265
) : ExtendedVue <
225
266
V ,
226
267
Data ,
227
268
Methods ,
228
269
Computed ,
229
270
Record < PropNames , any > ,
230
- SetupBindings
271
+ SetupBindings ,
272
+ Mixin ,
273
+ Extends
231
274
>
232
275
233
276
/**
234
277
* extend with object props
235
278
*/
236
- extend < Data , Methods , Computed , Props , SetupBindings = { } > (
279
+ extend <
280
+ Data ,
281
+ Methods ,
282
+ Computed ,
283
+ Props ,
284
+ SetupBindings = { } ,
285
+ Mixin extends ComponentMixin = ComponentMixin ,
286
+ Extends extends ComponentMixin = ComponentMixin
287
+ > (
237
288
options ?: ThisTypedComponentOptionsWithRecordProps <
238
289
V ,
239
290
Data ,
240
291
Methods ,
241
292
Computed ,
242
293
Props ,
243
- SetupBindings
294
+ SetupBindings ,
295
+ Mixin ,
296
+ Extends
244
297
>
245
- ) : ExtendedVue < V , Data , Methods , Computed , Props , SetupBindings >
298
+ ) : ExtendedVue <
299
+ V ,
300
+ Data ,
301
+ Methods ,
302
+ Computed ,
303
+ Props ,
304
+ SetupBindings ,
305
+ Mixin ,
306
+ Extends
307
+ >
246
308
247
309
/**
248
310
* extend with functional + array props
@@ -287,7 +349,9 @@ export interface VueConstructor<V extends Vue = Vue> {
287
349
Methods ,
288
350
Computed ,
289
351
PropNames extends string = never ,
290
- SetupBindings = { }
352
+ SetupBindings = { } ,
353
+ Mixin extends ComponentMixin = ComponentMixin ,
354
+ Extends extends ComponentMixin = ComponentMixin
291
355
> (
292
356
id : string ,
293
357
definition ?: ThisTypedComponentOptionsWithArrayProps <
@@ -296,25 +360,39 @@ export interface VueConstructor<V extends Vue = Vue> {
296
360
Methods ,
297
361
Computed ,
298
362
PropNames ,
299
- SetupBindings
363
+ SetupBindings ,
364
+ Mixin ,
365
+ Extends
300
366
>
301
367
) : ExtendedVue <
302
368
V ,
303
369
Data ,
304
370
Methods ,
305
371
Computed ,
306
372
Record < PropNames , any > ,
307
- SetupBindings
373
+ SetupBindings ,
374
+ Mixin ,
375
+ Extends
308
376
>
309
- component < Data , Methods , Computed , Props , SetupBindings > (
377
+ component <
378
+ Data ,
379
+ Methods ,
380
+ Computed ,
381
+ Props ,
382
+ SetupBindings ,
383
+ Mixin extends ComponentMixin = ComponentMixin ,
384
+ Extends extends ComponentMixin = ComponentMixin
385
+ > (
310
386
id : string ,
311
387
definition ?: ThisTypedComponentOptionsWithRecordProps <
312
388
V ,
313
389
Data ,
314
390
Methods ,
315
391
Computed ,
316
392
Props ,
317
- SetupBindings
393
+ SetupBindings ,
394
+ Mixin ,
395
+ Extends
318
396
>
319
397
) : ExtendedVue < V , Data , Methods , Computed , Props , SetupBindings >
320
398
component < PropNames extends string > (
0 commit comments