vue/flow/options.js

92 lines
2.1 KiB
JavaScript
Raw Normal View History

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;
_parentElm: ?Node;
_refElm: ?Node;
2016-07-26 09:28:46 +08:00
render?: Function;
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
};
2017-02-22 11:35:50 +08:00
methods?: { [key: string]: Function };
watch?: { [key: string]: Function | string };
2016-05-14 16:10:48 +08:00
// DOM
2016-07-26 09:28:46 +08:00
el?: string | Element;
template?: string;
2017-02-20 13:16:40 +08:00
render: (h: () => VNode) => VNode;
renderError?: (h: () => VNode, err: Error) => VNode;
2016-07-26 09:28:46 +08:00
staticRenderFns?: Array<() => VNode>;
2017-02-22 11:35:50 +08:00
2016-05-14 16:10:48 +08:00
// lifecycle
beforeCreate?: Function;
2016-07-26 09:28:46 +08:00
created?: Function;
beforeMount?: Function;
mounted?: Function;
beforeUpdate?: Function;
updated?: Function;
2017-02-22 11:35:50 +08:00
activated?: Function;
deactivated?: Function;
beforeDestroy?: Function;
destroyed?: 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 };
2017-02-22 11:35:50 +08:00
// context
2017-02-26 12:19:36 +08:00
provide?: { [key: string | Symbol]: any } | () => { [key: string | Symbol]: any };
inject?: { [key: string]: string | Symbol } | Array<string>;
2017-02-22 11:35:50 +08:00
// component v-model customization
model?: {
prop?: string;
event?: string;
};
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];
comments?: boolean;
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>;
_componentTag: ?string;
_scopeId: ?string;
_base: Class<Component>;
_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
}