Skip to content

Commit e6c0988

Browse files
authored
refactor: Remove type re-exports (#3969)
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`.
1 parent 931b8fa commit e6c0988

File tree

4 files changed

+4
-22
lines changed

4 files changed

+4
-22
lines changed

src/index.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,7 @@ export type { Cheerio } from './cheerio.js';
2121
* @category Cheerio
2222
*/
2323
export * from './types.js';
24-
export type {
25-
CheerioOptions,
26-
HTMLParser2Options,
27-
Parse5Options,
28-
} from './options.js';
29-
/**
30-
* Re-exporting all of the node types.
31-
*
32-
* @category DOM Node
33-
*/
34-
export type { Node, AnyNode, ParentNode, Element, Document } from 'domhandler';
24+
export type { CheerioOptions, HTMLParser2Options } from './options.js';
3525
export type { CheerioAPI } from './load.js';
3626
export { contains, merge } from './static.js';
3727

src/options.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@ export interface HTMLParser2Options
1313
extends DomHandlerOptions,
1414
HTMLParser2ParserOptions {}
1515

16-
/** Options for parse5, the default parser for HTML. */
17-
export interface Parse5Options // eslint-disable-line @typescript-eslint/no-empty-interface
18-
extends Parse5ParserOptions<Htmlparser2TreeAdapterMap> {}
19-
2016
/**
2117
* Options accepted by Cheerio.
2218
*
2319
* Please note that parser-specific options are _only recognized_ if the
2420
* relevant parser is used.
2521
*/
26-
export interface CheerioOptions extends Parse5Options {
22+
export interface CheerioOptions
23+
extends Parse5ParserOptions<Htmlparser2TreeAdapterMap> {
2724
/**
2825
* Recommended way of configuring htmlparser2 when wanting to parse XML.
2926
*

src/slim.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ export type {
1414
CheerioAPI,
1515
CheerioOptions,
1616
HTMLParser2Options,
17-
Node,
18-
AnyNode,
19-
ParentNode,
20-
Element,
21-
Document,
2217
} from './index.js';
2318

2419
/**

website/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ const config = {
228228
],
229229
[
230230
'docusaurus-plugin-typedoc',
231-
232231
{
233232
// TypeDoc options
234233
entryPoints: ['../src/batteries.ts'],
@@ -259,6 +258,7 @@ const config = {
259258
sidebar: {
260259
// Always display the API entry last
261260
position: Number.MAX_SAFE_INTEGER,
261+
pretty: true,
262262
},
263263
outputFileStrategy: 'members',
264264
},

0 commit comments

Comments
 (0)