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.

112 lines
2.3 KiB

9 years ago
declare type CompilerOptions = {
warn?: Function,
isIE?: boolean,
9 years ago
expectHTML?: boolean,
preserveWhitespace?: boolean,
modules?: Array<ModuleOptions>,
staticKeys?: string,
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 ModuleOptions = {
staticKeys?: Array<string>,
9 years ago
parse: (el: ASTElement) => void,
genData: (el: ASTElement) => string,
transformElement?: (el: ASTElement, code: 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?: boolean,
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,
9 years ago
keepAlive?: boolean,
9 years ago
inlineTemplate?: true,
9 years ago
transitionMode?: string | null,
slotName?: ?string,
slotTarget?: ?string,
9 years ago
ref?: string,
refInFor?: boolean,
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,
text: string,
static?: boolean
}
declare type ASTText = {
type: 3,
text: string,
static?: boolean
}