From f4b525527678b7edf8c70b9cd5b77694e7ce61c2 Mon Sep 17 00:00:00 2001 From: Felix <188768+fb55@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:31:32 +0100 Subject: [PATCH] refactor: Remove type re-exports This made the docs difficult to read, as all types ended up in the docs. BREAKING CHANGE; if you previously imported node types from Cheerio, you will now have to import them directly from `domhandler`. --- src/index.ts | 12 +----------- src/options.ts | 7 ++----- src/slim.ts | 5 ----- website/docusaurus.config.js | 2 +- 4 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/index.ts b/src/index.ts index 68b032bdbd..9c05c20ab4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,17 +21,7 @@ export type { Cheerio } from './cheerio.js'; * @category Cheerio */ export * from './types.js'; -export type { - CheerioOptions, - HTMLParser2Options, - Parse5Options, -} from './options.js'; -/** - * Re-exporting all of the node types. - * - * @category DOM Node - */ -export type { Node, AnyNode, ParentNode, Element, Document } from 'domhandler'; +export type { CheerioOptions, HTMLParser2Options } from './options.js'; export type { CheerioAPI } from './load.js'; export { contains, merge } from './static.js'; diff --git a/src/options.ts b/src/options.ts index f8bce0c2cb..ddd7944be5 100644 --- a/src/options.ts +++ b/src/options.ts @@ -13,17 +13,14 @@ export interface HTMLParser2Options extends DomHandlerOptions, HTMLParser2ParserOptions {} -/** Options for parse5, the default parser for HTML. */ -export interface Parse5Options // eslint-disable-line @typescript-eslint/no-empty-interface - extends Parse5ParserOptions {} - /** * Options accepted by Cheerio. * * Please note that parser-specific options are _only recognized_ if the * relevant parser is used. */ -export interface CheerioOptions extends Parse5Options { +export interface CheerioOptions + extends Parse5ParserOptions { /** * Recommended way of configuring htmlparser2 when wanting to parse XML. * diff --git a/src/slim.ts b/src/slim.ts index cf30316c7a..32f8ba2239 100644 --- a/src/slim.ts +++ b/src/slim.ts @@ -14,11 +14,6 @@ export type { CheerioAPI, CheerioOptions, HTMLParser2Options, - Node, - AnyNode, - ParentNode, - Element, - Document, } from './index.js'; /** diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index aa2ee4bbfa..3d8a7684e7 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -228,7 +228,6 @@ const config = { ], [ 'docusaurus-plugin-typedoc', - { // TypeDoc options entryPoints: ['../src/batteries.ts'], @@ -259,6 +258,7 @@ const config = { sidebar: { // Always display the API entry last position: Number.MAX_SAFE_INTEGER, + pretty: true, }, outputFileStrategy: 'members', },