1 | import { ChildNode, Element, DataNode, Document, ParentNode } from "./node.js";
|
2 | export * from "./node.js";
|
3 | export interface DomHandlerOptions {
|
4 | |
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | withStartIndices?: boolean;
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | withEndIndices?: boolean;
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 | xmlMode?: boolean;
|
26 | }
|
27 | interface ParserInterface {
|
28 | startIndex: number | null;
|
29 | endIndex: number | null;
|
30 | }
|
31 | declare type Callback = (error: Error | null, dom: ChildNode[]) => void;
|
32 | declare type ElementCallback = (element: Element) => void;
|
33 | export declare class DomHandler {
|
34 |
|
35 | dom: ChildNode[];
|
36 |
|
37 | root: Document;
|
38 |
|
39 | private readonly callback;
|
40 |
|
41 | private readonly options;
|
42 |
|
43 | private readonly elementCB;
|
44 |
|
45 | private done;
|
46 |
|
47 | protected tagStack: ParentNode[];
|
48 |
|
49 | protected lastNode: DataNode | null;
|
50 |
|
51 | private parser;
|
52 | |
53 |
|
54 |
|
55 |
|
56 |
|
57 | constructor(callback?: Callback | null, options?: DomHandlerOptions | null, elementCB?: ElementCallback);
|
58 | onparserinit(parser: ParserInterface): void;
|
59 | onreset(): void;
|
60 | onend(): void;
|
61 | onerror(error: Error): void;
|
62 | onclosetag(): void;
|
63 | onopentag(name: string, attribs: {
|
64 | [key: string]: string;
|
65 | }): void;
|
66 | ontext(data: string): void;
|
67 | oncomment(data: string): void;
|
68 | oncommentend(): void;
|
69 | oncdatastart(): void;
|
70 | oncdataend(): void;
|
71 | onprocessinginstruction(name: string, data: string): void;
|
72 | protected handleCallback(error: Error | null): void;
|
73 | protected addNode(node: ChildNode): void;
|
74 | }
|
75 | export default DomHandler;
|
76 | //# sourceMappingURL=index.d.ts.map |
\ | No newline at end of file |