vue2/flow/compiler.js

85 lines
1.8 KiB
JavaScript
Raw Normal View History

2016-05-14 17:08:54 +08:00
declare type CompilerOptions = {
warn?: Function,
expectHTML?: boolean,
2016-05-14 17:54:52 +08:00
directives?: { [key: string]: Function },
2016-05-14 17:08:54 +08:00
isUnaryTag?: (tag: string) => ?boolean,
isReservedTag?: (tag: string) => ?boolean,
mustUseProp?: (attr: string) => ?boolean,
getTagNamespace?: (tag: string) => ?string,
delimiters?: [string, string]
}
2016-05-14 18:20:54 +08:00
declare type ASTElementHandler = {
value: string,
modifiers: ?{ [key: string]: true }
}
declare type ASTElementHandlers = {
[key: string]: ASTElementHandler | Array<ASTElementHandler>
}
declare type ASTElementHooks = { [key: string]: Array<string> }
2016-05-14 19:40:56 +08:00
declare type ASTDirective = {
name: string,
value: ?string,
arg: ?string,
modifiers: ?{ [key: string]: true }
}
2016-05-14 17:08:54 +08:00
declare type ASTText = {
2016-05-14 17:54:52 +08:00
text?: string,
expression?: string
2016-05-14 17:08:54 +08:00
}
declare type ASTElement = {
tag: string,
attrsList: Array<{ name: string, value: string }>,
2016-05-14 18:20:54 +08:00
attrsMap: { [key: string]: string | null },
2016-05-14 17:08:54 +08:00
parent: ASTElement | void,
2016-05-14 18:20:54 +08:00
children: Array<any>, // for flexibility
2016-05-14 17:54:52 +08:00
static?: boolean,
staticRoot?: true,
2016-05-14 17:08:54 +08:00
text?: string,
attrs?: Array<{ name: string, value: string }>,
2016-05-14 18:20:54 +08:00
props?: Array<{ name: string, value: string }>,
staticAttrs?: Array<{ name: string, value: string }>,
2016-05-14 17:08:54 +08:00
plain?: boolean,
pre?: true,
ns?: string,
component?: string,
inlineTemplate?: true,
2016-05-14 18:20:54 +08:00
slotName?: ?string,
slotTarget?: ?string,
2016-05-14 17:08:54 +08:00
render?: true,
2016-05-14 18:20:54 +08:00
renderMethod?: ?string,
renderArgs?: ?string,
2016-05-14 17:08:54 +08:00
2016-05-14 17:54:52 +08:00
if?: string | null,
2016-05-14 17:08:54 +08:00
else?: true,
elseBlock?: ASTElement,
2016-05-14 17:54:52 +08:00
for?: string | null,
2016-05-14 17:08:54 +08:00
key?: string,
alias?: string,
iterator?: string,
staticClass?: string,
classBinding?: string,
styleBinding?: string,
2016-05-14 18:20:54 +08:00
hooks?: ASTElementHooks,
events?: ASTElementHandlers,
2016-05-14 17:08:54 +08:00
transition?: string | true,
transitionOnAppear?: boolean,
2016-05-14 19:40:56 +08:00
directives?: Array<ASTDirective>,
2016-05-14 17:54:52 +08:00
2016-05-14 17:08:54 +08:00
forbidden?: true,
once?: true
}