index.d.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { Parser, ParserOptions } from "./Parser";
  2. export { Parser, ParserOptions };
  3. import { DomHandler, DomHandlerOptions, Node, Element, Document } from "domhandler";
  4. export { DomHandler, DomHandlerOptions };
  5. declare type Options = ParserOptions & DomHandlerOptions;
  6. /**
  7. * Parses the data, returns the resulting document.
  8. *
  9. * @param data The data that should be parsed.
  10. * @param options Optional options for the parser and DOM builder.
  11. */
  12. export declare function parseDocument(data: string, options?: Options): Document;
  13. /**
  14. * Parses data, returns an array of the root nodes.
  15. *
  16. * Note that the root nodes still have a `Document` node as their parent.
  17. * Use `parseDocument` to get the `Document` node instead.
  18. *
  19. * @param data The data that should be parsed.
  20. * @param options Optional options for the parser and DOM builder.
  21. * @deprecated Use `parseDocument` instead.
  22. */
  23. export declare function parseDOM(data: string, options?: Options): Node[];
  24. /**
  25. * Creates a parser instance, with an attached DOM handler.
  26. *
  27. * @param cb A callback that will be called once parsing has been completed.
  28. * @param options Optional options for the parser and DOM builder.
  29. * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM.
  30. */
  31. export declare function createDomStream(cb: (error: Error | null, dom: Node[]) => void, options?: Options, elementCb?: (element: Element) => void): Parser;
  32. export { default as Tokenizer, Callbacks as TokenizerCallbacks, } from "./Tokenizer";
  33. import * as ElementType from "domelementtype";
  34. export { ElementType };
  35. export * from "./FeedHandler";
  36. export * as DomUtils from "domutils";
  37. export { DomHandler as DefaultHandler };
  38. export { FeedHandler as RssHandler } from "./FeedHandler";
  39. //# sourceMappingURL=index.d.ts.map