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