import { assert } from './assert' import { ParserErrorTypes } from './errorTypes' import { Node, AttributeNode, CommentNode, DirectiveNode, ElementNode, ElementTypes, ExpressionNode, Namespaces, NodeTypes, Position, RootNode, SourceLocation, TextNode } from './ast' export interface ParserOptions { isVoidTag: (tag: string) => boolean // e.g. img, br, hr getNamespace: (tag: string, parent: ElementNode | undefined) => Namespaces getTextMode: (tag: string, ns: Namespaces) => TextModes delimiters: [string, string] // ['{{', '}}'] transform: (node: Node) => Node // -- ignoreSpaces: boolean // Map to HTML entities. E.g., `{ "amp;": "&" }` // The full set is https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references namedCharacterReferences: { [name: string]: string | undefined } onError: (type: ParserErrorTypes, loc: Position) => void } export const enum TextModes { // | Elements | Entities | End sign | Inside of DATA, // | ✔ | ✔ | End tags of ancestors | RCDATA, // | ✘ | ✔ | End tag of the parent |