vue/flow/compiler.js

104 lines
2.1 KiB
JavaScript
Raw Normal View History

2016-05-14 17:08:54 +08:00
declare type CompilerOptions = {
warn?: Function,
expectHTML?: boolean,
2016-05-15 07:20:12 +08:00
preserveWhitespace?: boolean,
modules?: Array<ModuleOptions>,
2016-05-17 09:29:50 +08:00
staticKeys?: string,
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]
}
declare type ModuleOptions = {
staticKeys?: Array<string>,
parse: Function,
genData: Function
}
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 }
}
declare type ASTNode = ASTElement | ASTText | ASTExpression
2016-05-14 17:08:54 +08:00
declare type ASTElement = {
type: 1,
2016-05-14 17:08:54 +08:00
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,
children: Array<ASTNode>,
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
}
declare type ASTExpression = {
type: 2,
expression: string,
static?: boolean
}
declare type ASTText = {
type: 3,
text: string,
static?: boolean
}