11import { Vue } from "./vue.d" ;
2- import { VNode , VNodeDirective } from "./vnode.d" ;
2+ import { VNode , VNodeData , VNodeDirective } from "./vnode.d" ;
33
44type Constructor = {
55 new ( ...args : any [ ] ) : any ;
66}
77
8+ type $createElement = typeof Vue . prototype . $createElement ;
9+
810export interface ComponentOptions {
911 data ?: Object | ( ( this : Vue ) => Object ) ;
1012 props ?: string [ ] | { [ key : string ] : PropOptions | Constructor | Constructor [ ] } ;
@@ -15,7 +17,7 @@ export interface ComponentOptions {
1517
1618 el ?: Element | String ;
1719 template ?: string ;
18- render ?( createElement : typeof Vue . prototype . $createElement ) : VNode ;
20+ render ?( createElement : $createElement ) : VNode ;
1921 staticRenderFns ?: ( ( ) => VNode ) [ ] ;
2022
2123 beforeCreate ?( ) : void ;
@@ -28,7 +30,7 @@ export interface ComponentOptions {
2830 updated ?( ) : void ;
2931
3032 directives ?: { [ key : string ] : DirectiveOptions | DirectiveFunction } ;
31- components ?: { [ key : string ] : ComponentOptions | typeof Vue } ;
33+ components ?: { [ key : string ] : ComponentOptions | FunctionalComponentOptions | typeof Vue } ;
3234 transitions ?: { [ key : string ] : Object } ;
3335 filters ?: { [ key : string ] : Function } ;
3436
@@ -39,6 +41,21 @@ export interface ComponentOptions {
3941 delimiters ?: [ string , string ] ;
4042}
4143
44+ export interface FunctionalComponentOptions {
45+ props ?: string [ ] | { [ key : string ] : PropOptions | Constructor | Constructor [ ] } ;
46+ functional : boolean ;
47+ render ( this : never , createElement : $createElement , context : RenderContext ) : VNode ;
48+ name ?: string ;
49+ }
50+
51+ export interface RenderContext {
52+ props : any ;
53+ children : VNode [ ] ;
54+ slots : any ;
55+ data : VNodeData ;
56+ parent : Vue ;
57+ }
58+
4259export interface PropOptions {
4360 type ?: Constructor | Constructor [ ] | null ;
4461 required ?: boolean ;
0 commit comments