You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.0 KiB

9 years ago
declare type CompilerOptions = {
warn?: Function,
expectHTML?: boolean,
preserveWhitespace?: boolean,
9 years ago
directives?: { [key: string]: Function },
9 years ago
isUnaryTag?: (tag: string) => ?boolean,
isReservedTag?: (tag: string) => ?boolean,
mustUseProp?: (attr: string) => ?boolean,
getTagNamespace?: (tag: string) => ?string,
delimiters?: [string, string]
}
declare type ASTElementHandler = {
value: string,
modifiers: ?{ [key: string]: true }
}
declare type ASTElementHandlers = {
[key: string]: ASTElementHandler | Array<ASTElementHandler>
}
declare type ASTElementHooks = { [key: string]: Array<string> }
declare type ASTDirective = {
name: string,
value: ?string,
arg: ?string,
modifiers: ?{ [key: string]: true }
}
declare type ASTNode = ASTElement | ASTText | ASTExpression
9 years ago
declare type ASTElement = {
type: 1,
9 years ago
tag: string,
attrsList: Array<{ name: string, value: string }>,
attrsMap: { [key: string]: string | null },
9 years ago
parent: ASTElement | void,
children: Array<ASTNode>,
9 years ago
static?: boolean,
staticRoot?: true,
9 years ago
text?: string,
attrs?: Array<{ name: string, value: string }>,
props?: Array<{ name: string, value: string }>,
staticAttrs?: Array<{ name: string, value: string }>,
9 years ago
plain?: boolean,
pre?: true,
ns?: string,
component?: string,
inlineTemplate?: true,
slotName?: ?string,
slotTarget?: ?string,
9 years ago
render?: true,
renderMethod?: ?string,
renderArgs?: ?string,
9 years ago
9 years ago
if?: string | null,
9 years ago
else?: true,
elseBlock?: ASTElement,
9 years ago
for?: string | null,
9 years ago
key?: string,
alias?: string,
iterator?: string,
staticClass?: string,
classBinding?: string,
styleBinding?: string,
hooks?: ASTElementHooks,
events?: ASTElementHandlers,
9 years ago
transition?: string | true,
transitionOnAppear?: boolean,
directives?: Array<ASTDirective>,
9 years ago
9 years ago
forbidden?: true,
once?: true
}
declare type ASTExpression = {
type: 2,
expression: string,
static?: boolean
}
declare type ASTText = {
type: 3,
text: string,
static?: boolean
}