Skip to content

Commit 26953f5

Browse files
committed
add semis to flow decls for better syntax highlighting
1 parent 303780a commit 26953f5

File tree

6 files changed

+28
-32
lines changed

6 files changed

+28
-32
lines changed

flow/compiler.js

+15-19
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,16 @@ declare type CompilerOptions = {
1818

1919
// runtime user-configurable
2020
delimiters?: [string, string]; // template delimiters
21-
}
21+
};
2222

2323
declare type CompiledResult = {
2424
ast: ?ASTElement;
2525
render: string;
2626
staticRenderFns: Array<string>;
27+
stringRenderFns?: Array<string>;
2728
errors?: Array<string>;
2829
tips?: Array<string>;
29-
}
30-
31-
declare type CompiledFunctionResult = {
32-
render: Function;
33-
staticRenderFns: Array<Function>;
34-
}
30+
};
3531

3632
declare type ModuleOptions = {
3733
preTransformNode: (el: ASTElement) => void;
@@ -40,29 +36,29 @@ declare type ModuleOptions = {
4036
genData: (el: ASTElement) => string; // generate extra data string for an element
4137
transformCode?: (el: ASTElement, code: string) => string; // further transform generated code for an element
4238
staticKeys?: Array<string>; // AST properties to be considered static
43-
}
39+
};
4440

45-
declare type ASTModifiers = { [key: string]: boolean }
46-
declare type ASTIfConditions = Array<{ exp: ?string; block: ASTElement }>
41+
declare type ASTModifiers = { [key: string]: boolean };
42+
declare type ASTIfConditions = Array<{ exp: ?string; block: ASTElement }>;
4743

4844
declare type ASTElementHandler = {
4945
value: string;
5046
modifiers: ?ASTModifiers;
51-
}
47+
};
5248

5349
declare type ASTElementHandlers = {
5450
[key: string]: ASTElementHandler | Array<ASTElementHandler>;
55-
}
51+
};
5652

5753
declare type ASTDirective = {
5854
name: string;
5955
rawName: string;
6056
value: string;
6157
arg: ?string;
6258
modifiers: ?ASTModifiers;
63-
}
59+
};
6460

65-
declare type ASTNode = ASTElement | ASTText | ASTExpression
61+
declare type ASTNode = ASTElement | ASTText | ASTExpression;
6662

6763
declare type ASTElement = {
6864
type: 1;
@@ -138,7 +134,7 @@ declare type ASTElement = {
138134

139135
// weex specific
140136
appendAsTree?: boolean;
141-
}
137+
};
142138

143139
declare type ASTExpression = {
144140
type: 2;
@@ -148,7 +144,7 @@ declare type ASTExpression = {
148144
// 2.4 ssr optimization
149145
ssrOptimizable?: boolean;
150146
ssrOptimizableRoot?: boolean;
151-
}
147+
};
152148

153149
declare type ASTText = {
154150
type: 3;
@@ -157,7 +153,7 @@ declare type ASTText = {
157153
// 2.4 ssr optimization
158154
ssrOptimizable?: boolean;
159155
ssrOptimizableRoot?: boolean;
160-
}
156+
};
161157

162158
// SFC-parser related declarations
163159

@@ -176,7 +172,7 @@ declare type SFCCustomBlock = {
176172
end?: number;
177173
src?: string;
178174
attrs: {[attribute:string]: string};
179-
}
175+
};
180176

181177
declare type SFCBlock = {
182178
type: string;
@@ -187,4 +183,4 @@ declare type SFCBlock = {
187183
src?: string;
188184
scoped?: boolean;
189185
module?: string | boolean;
190-
}
186+
};

flow/component.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ declare interface Component {
110110

111111
// allow dynamic method registration
112112
[key: string]: any
113-
}
113+
};

flow/global-api.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ declare interface GlobalAPI {
1818

1919
// allow dynamic method registration
2020
[key: string]: any
21-
}
21+
};

flow/options.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ declare type InternalComponentOptions = {
1010
_refElm: ?Node;
1111
render?: Function;
1212
staticRenderFns?: Array<Function>
13-
}
13+
};
1414

1515
declare type ComponentOptions = {
1616
// data
@@ -80,7 +80,7 @@ declare type ComponentOptions = {
8080
_base: Class<Component>;
8181
_parentElm: ?Node;
8282
_refElm: ?Node;
83-
}
83+
};
8484

8585
declare type PropOptions = {
8686
type: Function | Array<Function> | null;

flow/ssr.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ declare type ComponentWithCacheContext = {
33
bufferIndex: number;
44
buffer: Array<string>;
55
key: string;
6-
}
6+
};
77

88
declare type ElementContext = {
99
type: 'Element';
1010
children: Array<VNode>;
1111
rendered: number;
1212
endTag: string;
1313
total: number;
14-
}
14+
};
1515

1616
declare type ComponentContext = {
1717
type: 'Component';
1818
prevActive: Component;
19-
}
19+
};
2020

21-
declare type RenderState = ComponentContext | ComponentWithCacheContext | ElementContext
21+
declare type RenderState = ComponentContext | ComponentWithCacheContext | ElementContext;

flow/vnode.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
declare type VNodeChildren = Array<?VNode | string | VNodeChildren> | string
1+
declare type VNodeChildren = Array<?VNode | string | VNodeChildren> | string;
22

33
declare type VNodeComponentOptions = {
44
Ctor: Class<Component>;
55
propsData: ?Object;
66
listeners: ?Object;
77
children: ?Array<VNode>;
88
tag?: string;
9-
}
9+
};
1010

1111
declare type MountedComponentVNode = {
1212
context: Component;
1313
componentOptions: VNodeComponentOptions;
1414
componentInstance: Component;
1515
parent: VNode;
1616
data: VNodeData;
17-
}
17+
};
1818

1919
// interface for vnodes in update modules
2020
declare type VNodeWithData = {
@@ -29,7 +29,7 @@ declare type VNodeWithData = {
2929
parent?: VNodeWithData;
3030
componentInstance?: Component;
3131
isRootInsert: boolean;
32-
}
32+
};
3333

3434
declare interface VNodeData {
3535
key?: string | number;
@@ -61,7 +61,7 @@ declare interface VNodeData {
6161
value: any;
6262
callback: Function;
6363
};
64-
}
64+
};
6565

6666
declare type VNodeDirective = {
6767
name: string;

0 commit comments

Comments
 (0)