options.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. import type { DomHandlerOptions } from 'domhandler';
  2. import type { ParserOptions } from 'htmlparser2';
  3. /** Options accepted by htmlparser2, the default parser for XML. */
  4. export interface HTMLParser2Options extends DomHandlerOptions, ParserOptions {
  5. }
  6. /** Options for parse5, the default parser for HTML. */
  7. export interface Parse5Options {
  8. /** Disable scripting in parse5, so noscript tags would be parsed. */
  9. scriptingEnabled?: boolean;
  10. /** Enable location support for parse5. */
  11. sourceCodeLocationInfo?: boolean;
  12. }
  13. /** Internal options for Cheerio. */
  14. export interface InternalOptions extends HTMLParser2Options, Parse5Options {
  15. _useHtmlParser2?: boolean;
  16. }
  17. /**
  18. * Options accepted by Cheerio.
  19. *
  20. * Please note that parser-specific options are *only recognized* if the
  21. * relevant parser is used.
  22. */
  23. export interface CheerioOptions extends HTMLParser2Options, Parse5Options {
  24. /** Suggested way of configuring htmlparser2 when wanting to parse XML. */
  25. xml?: HTMLParser2Options | boolean;
  26. }
  27. declare const defaultOpts: CheerioOptions;
  28. /** Cheerio default options. */
  29. export default defaultOpts;
  30. export declare function flatten(options?: CheerioOptions | null): InternalOptions | undefined;
  31. //# sourceMappingURL=options.d.ts.map