Installation
npm install --save @types/domhandler
Summary
This package contains type definitions for domhandler (https://github.com/fb55/DomHandler#readme).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/domhandler.
export interface DomHandlerOptions {
normalizeWhitespace?: boolean | undefined;
withDomLvl1?: boolean | undefined;
withStartIndices?: boolean | undefined;
withEndIndices?: boolean | undefined;
}
export interface DomElement {
attribs?: { [s: string]: string } | undefined;
children?: DomElement[] | undefined;
data?: any;
name?: string | undefined;
next?: DomElement | undefined;
parent?: DomElement | undefined;
prev?: DomElement | undefined;
type?: string | undefined;
}
export interface Element extends DomElement {
name: string;
}
export interface Node extends DomElement {
readonly firstChild: DomElement;
readonly lastChild: DomElement;
readonly nodeType: number;
}
export class DomHandler {
constructor(callback: (error: any, dom: DomElement[]) => any, options?: DomHandlerOptions);
onparserinit(parser: any): void;
onreset(): void;
onend(): void;
onerror(error: Error): void;
onclosetag(): void;
onopentag(name: string, attribs: { [s: string]: string }): void;
ontext(data: string): void;
oncomment(data: string): void;
oncdatastart(): void;
oncommentend(): void;
onprocessinginstruction(name: string, data: string): void;
}
Additional Details
- Last updated: Mon, 06 Nov 2023 22:41:05 GMT
- Dependencies: none
Credits
These definitions were written by Johan Davidsson.