Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

DomHandler

class DomHandler {
constructor(
callback?: Callback | null,
options?: DomHandlerOptions | null,
elementCB?: ElementCallback,
);
private readonly callback;
private done;
private readonly elementCB;
private readonly options;
private parser;
protected lastNode: DataNode | null;
protected tagStack: NodeWithChildren[];
dom: Node[];
root: Document;
 
protected addNode(node: Node): void;
protected handleCallback(error: Error | null): void;
oncdataend(): void;
oncdatastart(): void;
onclosetag(): void;
oncomment(data: string): void;
oncommentend(): void;
onend(): void;
onerror(error: Error): void;
onopentag(name: string, attribs: {
[key: string]: string;
}
): void;
onparserinit(parser: ParserInterface): void;
onprocessinginstruction(name: string, data: string): void;
onreset(): void;
ontext(data: string): void;
}

§Constructors

§
new DomHandler(callback?: Callback | null, options?: DomHandlerOptions | null, elementCB?: ElementCallback)
[src]
@param callback

Called once parsing has completed.

@param options

Settings for the handler.

@param elementCB

Callback whenever a tag is closed.

§Properties

§
callback
[src]

Called once parsing has completed.

§
done
[src]

Indicated whether parsing has been completed.

§
elementCB
[src]

Callback whenever a tag is closed.

§
options
[src]

Settings for the handler.

§
parser
[src]

Reference to the parser instance. Used for location information.

§
lastNode: DataNode | null
[src]

A data node that is still being written to.

§

Stack of open tags.

§
dom: Node[]
[src]

The elements of the DOM

§

The root element for the DOM

§Methods

§
addNode(node: Node): void protected
[src]
§
handleCallback(error: Error | null): void protected
[src]
§
oncdataend(): void
[src]
§
oncdatastart(): void
[src]
§
onclosetag(): void
[src]
§
oncomment(data: string): void
[src]
§
oncommentend(): void
[src]
§
onend(): void
[src]
§
onerror(error: Error): void
[src]
§
onopentag(name: string, attribs: {
[key: string]: string;
}
): void
[src]
§
onparserinit(parser: ParserInterface): void
[src]
§
onprocessinginstruction(name: string, data: string): void
[src]
§
onreset(): void
[src]
§
ontext(data: string): void
[src]