diff --git a/flow/compiler.js b/flow/compiler.js index e7a53867..64dd243e 100644 --- a/flow/compiler.js +++ b/flow/compiler.js @@ -18,20 +18,16 @@ declare type CompilerOptions = { // runtime user-configurable delimiters?: [string, string]; // template delimiters -} +}; declare type CompiledResult = { ast: ?ASTElement; render: string; staticRenderFns: Array; + stringRenderFns?: Array; errors?: Array; tips?: Array; -} - -declare type CompiledFunctionResult = { - render: Function; - staticRenderFns: Array; -} +}; declare type ModuleOptions = { preTransformNode: (el: ASTElement) => void; @@ -40,19 +36,19 @@ declare type ModuleOptions = { genData: (el: ASTElement) => string; // generate extra data string for an element transformCode?: (el: ASTElement, code: string) => string; // further transform generated code for an element staticKeys?: Array; // AST properties to be considered static -} +}; -declare type ASTModifiers = { [key: string]: boolean } -declare type ASTIfConditions = Array<{ exp: ?string; block: ASTElement }> +declare type ASTModifiers = { [key: string]: boolean }; +declare type ASTIfConditions = Array<{ exp: ?string; block: ASTElement }>; declare type ASTElementHandler = { value: string; modifiers: ?ASTModifiers; -} +}; declare type ASTElementHandlers = { [key: string]: ASTElementHandler | Array; -} +}; declare type ASTDirective = { name: string; @@ -60,9 +56,9 @@ declare type ASTDirective = { value: string; arg: ?string; modifiers: ?ASTModifiers; -} +}; -declare type ASTNode = ASTElement | ASTText | ASTExpression +declare type ASTNode = ASTElement | ASTText | ASTExpression; declare type ASTElement = { type: 1; @@ -138,7 +134,7 @@ declare type ASTElement = { // weex specific appendAsTree?: boolean; -} +}; declare type ASTExpression = { type: 2; @@ -148,7 +144,7 @@ declare type ASTExpression = { // 2.4 ssr optimization ssrOptimizable?: boolean; ssrOptimizableRoot?: boolean; -} +}; declare type ASTText = { type: 3; @@ -157,7 +153,7 @@ declare type ASTText = { // 2.4 ssr optimization ssrOptimizable?: boolean; ssrOptimizableRoot?: boolean; -} +}; // SFC-parser related declarations @@ -176,7 +172,7 @@ declare type SFCCustomBlock = { end?: number; src?: string; attrs: {[attribute:string]: string}; -} +}; declare type SFCBlock = { type: string; @@ -187,4 +183,4 @@ declare type SFCBlock = { src?: string; scoped?: boolean; module?: string | boolean; -} +}; diff --git a/flow/component.js b/flow/component.js index d23b27d3..04418ded 100644 --- a/flow/component.js +++ b/flow/component.js @@ -110,4 +110,4 @@ declare interface Component { // allow dynamic method registration [key: string]: any -} +}; diff --git a/flow/global-api.js b/flow/global-api.js index d4cd4d4e..0b2efb23 100644 --- a/flow/global-api.js +++ b/flow/global-api.js @@ -18,4 +18,4 @@ declare interface GlobalAPI { // allow dynamic method registration [key: string]: any -} +}; diff --git a/flow/options.js b/flow/options.js index 9a756611..db90567b 100644 --- a/flow/options.js +++ b/flow/options.js @@ -10,7 +10,7 @@ declare type InternalComponentOptions = { _refElm: ?Node; render?: Function; staticRenderFns?: Array -} +}; declare type ComponentOptions = { // data @@ -80,7 +80,7 @@ declare type ComponentOptions = { _base: Class; _parentElm: ?Node; _refElm: ?Node; -} +}; declare type PropOptions = { type: Function | Array | null; diff --git a/flow/ssr.js b/flow/ssr.js index a3d5379c..d6a94592 100644 --- a/flow/ssr.js +++ b/flow/ssr.js @@ -3,7 +3,7 @@ declare type ComponentWithCacheContext = { bufferIndex: number; buffer: Array; key: string; -} +}; declare type ElementContext = { type: 'Element'; @@ -11,11 +11,11 @@ declare type ElementContext = { rendered: number; endTag: string; total: number; -} +}; declare type ComponentContext = { type: 'Component'; prevActive: Component; -} +}; -declare type RenderState = ComponentContext | ComponentWithCacheContext | ElementContext +declare type RenderState = ComponentContext | ComponentWithCacheContext | ElementContext; diff --git a/flow/vnode.js b/flow/vnode.js index 33b5ce1d..fba62ee3 100644 --- a/flow/vnode.js +++ b/flow/vnode.js @@ -1,4 +1,4 @@ -declare type VNodeChildren = Array | string +declare type VNodeChildren = Array | string; declare type VNodeComponentOptions = { Ctor: Class; @@ -6,7 +6,7 @@ declare type VNodeComponentOptions = { listeners: ?Object; children: ?Array; tag?: string; -} +}; declare type MountedComponentVNode = { context: Component; @@ -14,7 +14,7 @@ declare type MountedComponentVNode = { componentInstance: Component; parent: VNode; data: VNodeData; -} +}; // interface for vnodes in update modules declare type VNodeWithData = { @@ -29,7 +29,7 @@ declare type VNodeWithData = { parent?: VNodeWithData; componentInstance?: Component; isRootInsert: boolean; -} +}; declare interface VNodeData { key?: string | number; @@ -61,7 +61,7 @@ declare interface VNodeData { value: any; callback: Function; }; -} +}; declare type VNodeDirective = { name: string;