UNPKG

510 BTypeScriptView Raw
1import {ParserOptions} from 'htmlparser2';
2
3declare const parser: (html: string, options?: Options) => Node[];
4
5export default parser;
6
7export type Directive = {
8 name: string | RegExp;
9 start: string;
10 end: string;
11};
12
13export type Options = {
14 directives?: Directive[];
15} & ParserOptions;
16
17export type Node = NodeText | NodeTag;
18export type NodeText = string;
19export type NodeTag = {
20 tag?: string | boolean;
21 attrs?: Attributes;
22 content?: Node[];
23};
24
25export type Attributes = Record<string, string>;