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