mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
15 lines
624 B
TypeScript
15 lines
624 B
TypeScript
import { DomHandler, DomHandlerOptions, Node } from "domhandler";
|
|
|
|
const handler = new DomHandler((error: Error, dom: any) => {
|
|
if (error)
|
|
console.error('There has been an error...');
|
|
else
|
|
console.log(dom);
|
|
});
|
|
handler.ontext = (data: string) => { console.log(data); };
|
|
handler.onreset = () => { console.log('We have a reset.'); };
|
|
handler.onerror = (error: Error) => { console.error(Error); };
|
|
handler.onopentag = (name: string, attribs) => { console.log(name, attribs); };
|
|
|
|
const dho: DomHandlerOptions = { normalizeWhitespace: true, withDomLvl1: true, withEndIndices: true, withStartIndices: true };
|