2016-05-15 06:45:54 +08:00
|
|
|
declare type InternalComponentOptions = {
|
2016-07-26 09:28:46 +08:00
|
|
|
_isComponent: true;
|
|
|
|
parent: Component;
|
|
|
|
propsData: ?Object;
|
|
|
|
_parentVnode: VNode;
|
|
|
|
_parentListeners: ?Object;
|
2016-12-05 00:34:53 +08:00
|
|
|
_renderChildren: ?Array<VNode>;
|
2016-07-26 09:28:46 +08:00
|
|
|
_componentTag: ?string;
|
2016-11-26 06:12:40 +08:00
|
|
|
_parentElm: ?Node;
|
|
|
|
_refElm: ?Node;
|
2016-07-26 09:28:46 +08:00
|
|
|
render?: Function;
|
2016-05-15 06:45:54 +08:00
|
|
|
staticRenderFns?: Array<Function>
|
|
|
|
}
|
|
|
|
|
2016-05-14 15:08:21 +08:00
|
|
|
declare type ComponentOptions = {
|
2016-05-14 16:10:48 +08:00
|
|
|
// data
|
2016-07-26 09:28:46 +08:00
|
|
|
data: Object | Function | void;
|
|
|
|
props?: { [key: string]: PropOptions };
|
|
|
|
propsData?: ?Object;
|
2016-05-14 16:10:48 +08:00
|
|
|
computed?: {
|
|
|
|
[key: string]: Function | {
|
2016-07-26 09:28:46 +08:00
|
|
|
get?: Function;
|
|
|
|
set?: Function;
|
2016-05-14 16:10:48 +08:00
|
|
|
cache?: boolean
|
|
|
|
}
|
2016-07-26 09:28:46 +08:00
|
|
|
};
|
2016-05-14 16:10:48 +08:00
|
|
|
methods?: {
|
|
|
|
[key: string]: Function
|
2016-07-26 09:28:46 +08:00
|
|
|
};
|
2016-05-14 16:10:48 +08:00
|
|
|
watch?: {
|
|
|
|
[key: string]: Function | string
|
2016-07-26 09:28:46 +08:00
|
|
|
};
|
2016-05-14 16:10:48 +08:00
|
|
|
// DOM
|
2016-07-26 09:28:46 +08:00
|
|
|
el?: string | Element;
|
|
|
|
template?: string;
|
|
|
|
render: () => VNode;
|
|
|
|
staticRenderFns?: Array<() => VNode>;
|
2016-05-14 16:10:48 +08:00
|
|
|
// lifecycle
|
2016-09-27 10:54:57 +08:00
|
|
|
beforeCreate?: Function;
|
2016-07-26 09:28:46 +08:00
|
|
|
created?: Function;
|
|
|
|
beforeMount?: Function;
|
|
|
|
mounted?: Function;
|
|
|
|
beforeUpdate?: Function;
|
|
|
|
updated?: Function;
|
2016-05-14 16:10:48 +08:00
|
|
|
// assets
|
2016-07-26 09:28:46 +08:00
|
|
|
directives?: { [key: string]: Object };
|
|
|
|
components?: { [key: string]: Class<Component> };
|
|
|
|
transitions?: { [key: string]: Object };
|
|
|
|
filters?: { [key: string]: Function };
|
2016-05-14 16:10:48 +08:00
|
|
|
// misc
|
2016-07-26 09:28:46 +08:00
|
|
|
parent?: Component;
|
|
|
|
mixins?: Array<Object>;
|
|
|
|
name?: string;
|
|
|
|
extends?: Class<Component> | Object;
|
|
|
|
delimiters?: [string, string];
|
2016-05-14 15:08:21 +08:00
|
|
|
|
2016-05-14 16:10:48 +08:00
|
|
|
// private
|
2016-07-26 09:28:46 +08:00
|
|
|
_isComponent?: true;
|
|
|
|
_propKeys?: Array<string>;
|
|
|
|
_parentVnode?: VNode;
|
|
|
|
_parentListeners?: ?Object;
|
2016-12-05 00:34:53 +08:00
|
|
|
_renderChildren?: ?Array<VNode>;
|
2016-10-21 01:34:06 +08:00
|
|
|
_componentTag: ?string;
|
|
|
|
_scopeId: ?string;
|
2016-11-10 10:19:01 +08:00
|
|
|
_base: Class<Component>;
|
2016-11-26 06:12:40 +08:00
|
|
|
_parentElm: ?Node;
|
|
|
|
_refElm: ?Node;
|
2016-05-14 16:10:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
declare type PropOptions = {
|
2016-07-26 09:28:46 +08:00
|
|
|
type: Function | Array<Function> | null;
|
|
|
|
default: any;
|
|
|
|
required: ?boolean;
|
|
|
|
validator: ?Function;
|
2016-05-14 15:08:21 +08:00
|
|
|
}
|