Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromvuejs/vue

Commitb06d09f

Browse files
committed
types: adjust weex flow types
1 parent5c2ce00 commitb06d09f

File tree

10 files changed

+25
-29
lines changed

10 files changed

+25
-29
lines changed

‎flow/compiler.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
1-
// global flag to be compiled away
2-
declarevar __WEEX__:boolean;
3-
41
declaretypeCompilerOptions={
52
warn?:Function;// allow customizing warning in different environments; e.g. node
6-
expectHTML?:boolean;// only false for non-web builds
73
modules?:Array<ModuleOptions>;// platform specific modules; e.g. style; class
8-
staticKeys?:string;// a list of AST properties to be considered static; for optimization
94
directives?:{[key:string]:Function};// platform specific directives
5+
staticKeys?:string;// a list of AST properties to be considered static; for optimization
106
isUnaryTag?:(tag:string)=> ?boolean;// check if a tag is unary for the platform
117
canBeLeftOpenTag?:(tag:string)=> ?boolean;// check if a tag can be left opened
128
isReservedTag?:(tag:string)=> ?boolean;// check if a tag is a native for the platform
9+
preserveWhitespace?:boolean;// preserve whitespace between elements?
10+
optimize?:boolean;// optimize static content?
11+
12+
// web specific
1313
mustUseProp?:(tag:string,type: ?string,name:string)=>boolean;// check if an attribute should be bound as a property
1414
isPreTag?:(attr:string)=> ?boolean;// check if a tag needs to preserve whitespace
1515
getTagNamespace?:(tag:string)=> ?string;// check the namespace for a tag
16-
transforms?:Array<Function>;// a list of transforms on parsed AST before codegen
17-
preserveWhitespace?:boolean;
16+
expectHTML?:boolean;// only false for non-web builds
1817
isFromDOM?:boolean;
1918
shouldDecodeTags?:boolean;
2019
shouldDecodeNewlines?:boolean;
2120
shouldDecodeNewlinesForHref?:boolean;
22-
optimize?:boolean;
23-
24-
// for ssr optimization compiler
25-
scopeId?:string;
2621

2722
// runtime user-configurable
2823
delimiters?:[string,string];// template delimiters
24+
comments?:boolean;// preserve comments in template
2925

30-
//allow user kept comments
31-
comments?:boolean
26+
//for ssr optimization compiler
27+
scopeId?:string;
3228
};
3329

3430
declaretypeCompiledResult={

‎flow/weex.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// global flag to be compiled away
2+
declarevar __WEEX__:boolean;
3+
4+
declaretypeWeexCompilerOptions=CompilerOptions&{
5+
// whether to compile special template for <recycle-list>
6+
recyclable?:boolean;
7+
};
8+
9+
declaretypeWeexCompiledResult=CompiledResult&{
10+
'@render'?:string;
11+
};

‎src/platforms/weex/compiler/index.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ import {
1414
getTagNamespace
1515
}from'../util/index'
1616

17-
exporttypeWeexCompilerOptions=CompilerOptions&{
18-
// whether to compile special template for <recycle-list>
19-
recyclable?:boolean;
20-
};
21-
22-
exporttypeWeexCompiledResult=CompiledResult&{
23-
'@render'?:string;
24-
};
25-
2617
exportconstbaseOptions:WeexCompilerOptions={
2718
modules,
2819
directives,

‎src/platforms/weex/compiler/modules/recycle-list/component.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import{addAttr}from'compiler/helpers'
44
import{RECYCLE_LIST_MARKER}from'weex/util/index'
5-
importtype{WeexCompilerOptions}from'weex/compiler/index'
65

76
// mark components as inside recycle-list so that we know we need to invoke
87
// their special@render function instead of render in create-component.js

‎src/platforms/weex/compiler/modules/recycle-list/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*@flow */
22

3-
importtype{WeexCompilerOptions}from'weex/compiler/index'
43
import{postTransformComponent}from'./component'
54
import{postTransformText}from'./text'
65
import{preTransformVBind}from'./v-bind'

‎src/platforms/weex/compiler/modules/recycle-list/text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function genText (node: ASTNode) {
1313
returnJSON.stringify(value)
1414
}
1515

16-
exportfunctionpostTransformText(el:ASTElement,options:CompilerOptions){
16+
exportfunctionpostTransformText(el:ASTElement,options:WeexCompilerOptions){
1717
// weex <text> can only contain text, so the parser
1818
// always generates a single child.
1919
if(el.children.length){

‎src/platforms/weex/compiler/modules/recycle-list/v-bind.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function parseAttrName (name: string): string {
88
returncamelize(name.replace(bindRE,''))
99
}
1010

11-
exportfunctionpreTransformVBind(el:ASTElement,options:CompilerOptions){
11+
exportfunctionpreTransformVBind(el:ASTElement,options:WeexCompilerOptions){
1212
for(constattrinel.attrsMap){
1313
if(bindRE.test(attr)){
1414
constname:string=parseAttrName(attr)

‎src/platforms/weex/compiler/modules/recycle-list/v-for.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import{forAliasRE,forIteratorRE,stripParensRE}from'compiler/parser/index'
44
import{getAndRemoveAttr}from'compiler/helpers'
55

6-
exportfunctionpreTransformVFor(el:ASTElement,options:CompilerOptions){
6+
exportfunctionpreTransformVFor(el:ASTElement,options:WeexCompilerOptions){
77
constexp=getAndRemoveAttr(el,'v-for')
88
if(!exp){
99
return

‎src/platforms/weex/compiler/modules/recycle-list/v-if.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function getPrevMatch (el: ASTElement): any {
1818
}
1919
}
2020

21-
exportfunctionpreTransformVIf(el:ASTElement,options:CompilerOptions){
21+
exportfunctionpreTransformVIf(el:ASTElement,options:WeexCompilerOptions){
2222
if(hasConditionDirective(el)){
2323
letexp
2424
constifExp=getAndRemoveAttr(el,'v-if',true/* remove from attrsMap */)

‎src/platforms/weex/compiler/modules/recycle-list/v-on.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function parseHandlerParams (handler: ASTElementHandler) {
99
}
1010
}
1111

12-
exportfunctionpostTransformVOn(el:ASTElement,options:CompilerOptions){
12+
exportfunctionpostTransformVOn(el:ASTElement,options:WeexCompilerOptions){
1313
constevents:ASTElementHandlers|void=el.events
1414
if(!events){
1515
return

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp