UNPKG

784 BTypeScriptView Raw
1import HTMLElement from './nodes/html';
2import TextNode from './nodes/text';
3export { default as CommentNode } from './nodes/comment';
4export { default as HTMLElement } from './nodes/html';
5export { default as Node } from './nodes/node';
6export { default as TextNode } from './nodes/text';
7export interface Options {
8 lowerCaseTagName?: boolean;
9 noFix?: boolean;
10 script?: boolean;
11 style?: boolean;
12 pre?: boolean;
13 comment?: boolean;
14}
15/**
16 * Parses HTML and returns a root element
17 * Parse a chuck of HTML source.
18 * @param {string} data html
19 * @return {HTMLElement} root element
20 */
21export declare function parse(data: string, options?: Options): (TextNode & {
22 valid: boolean;
23}) | (HTMLElement & {
24 valid: boolean;
25});
26export default parse;