angular-html-parser
Version:
A HTML parser extracted from Angular with some modifications
46 lines (45 loc) • 1.58 kB
TypeScript
import { TagContentType } from '../../compiler/src/ml_parser/tags.js';
import { ParseTreeResult } from "../../compiler/src/ml_parser/parser.js";
export interface ParseOptions {
/**
* any element can self close
*
* defaults to false
*/
canSelfClose?: boolean;
/**
* support [`htm`](https://github.com/developit/htm) component closing tags (`<//>`)
*
* defaults to false
*/
allowHtmComponentClosingTags?: boolean;
/**
* do not lowercase tag names before querying their tag definitions
*
* defaults to false
*/
isTagNameCaseSensitive?: boolean;
/**
* customize tag content type
*
* defaults to the content type defined in the HTML spec
*/
getTagContentType?: (tagName: string, prefix: string, hasParent: boolean, attrs: Array<{
prefix: string;
name: string;
value?: string;
}>) => void | TagContentType;
/**
* tokenize angular control flow block syntax
*/
tokenizeAngularBlocks?: boolean;
/**
* tokenize angular let declaration syntax
*/
tokenizeAngularLetDeclaration?: boolean;
}
export declare function parse(input: string, options?: ParseOptions): ParseTreeResult;
export { TagContentType };
export { RecursiveVisitor, visitAll, } from "../../compiler/src/ml_parser/ast.js";
export { ParseSourceSpan, ParseLocation, ParseSourceFile, } from "../../compiler/src/parse_util.js";
export { getHtmlTagDefinition } from "../../compiler/src/ml_parser/html_tags.js";