1+ import { VNode , ComponentOptions as Vue2ComponentOptions } from 'vue'
12import { Data } from './common'
23import { ComponentPropsOptions , ExtractPropTypes } from './componentProps'
3- import { VNode } from 'vue'
44import { ComponentInstance , ComponentRenderProxy } from './componentProxy'
55
6- import { ComponentOptions as Vue2ComponentOptions } from 'vue'
7-
86export interface SetupContext {
97 readonly attrs : Record < string , string >
108 readonly slots : { [ key : string ] : ( ...args : any [ ] ) => VNode [ ] }
@@ -43,12 +41,11 @@ interface ComponentOptionsBase<
4341 D = Data ,
4442 C extends ComputedOptions = { } ,
4543 M extends MethodOptions = { }
46- >
47- extends Omit <
44+ > extends Omit <
4845 Vue2ComponentOptions < Vue , D , M , C , Props > ,
4946 'data' | 'computed' | 'method' | 'setup' | 'props'
5047 > {
51- data ?: ( this : Props , vm : Props ) => D
48+ data ?: ( this : Props & Vue , vm : Props ) => D
5249 computed ?: C
5350 methods ?: M
5451}
@@ -70,7 +67,7 @@ export type ComponentOptionsWithProps<
7067 Props = ExtractPropTypes < PropsOptions >
7168> = ComponentOptionsBase < Props , D , C , M > & {
7269 props ?: PropsOptions
73- emits ?: string [ ] | Record < string , null | ( ( emitData : any ) => boolean ) >
70+ emits ?: string [ ] | Record < string , null | ( ( emitData : any ) => boolean ) >
7471 setup ?: SetupFunction < Props , RawBindings >
7572} & ThisType < ComponentRenderProxy < Props , RawBindings , D , C , M > >
7673
0 commit comments