Skip to content

Commit

Permalink
refactor: Remove type re-exports
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
fb55 committed Aug 5, 2024
1 parent 931b8fa commit f4b5255
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 22 deletions.
12 changes: 1 addition & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
7 changes: 2 additions & 5 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Htmlparser2TreeAdapterMap> {}

/**
* 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<Htmlparser2TreeAdapterMap> {
/**
* Recommended way of configuring htmlparser2 when wanting to parse XML.
*
Expand Down
5 changes: 0 additions & 5 deletions src/slim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ export type {
CheerioAPI,
CheerioOptions,
HTMLParser2Options,
Node,
AnyNode,
ParentNode,
Element,
Document,
} from './index.js';

/**
Expand Down
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ const config = {
],
[
'docusaurus-plugin-typedoc',

{
// TypeDoc options
entryPoints: ['../src/batteries.ts'],
Expand Down Expand Up @@ -259,6 +258,7 @@ const config = {
sidebar: {
// Always display the API entry last
position: Number.MAX_SAFE_INTEGER,
pretty: true,
},
outputFileStrategy: 'members',
},
Expand Down

0 comments on commit f4b5255

Please sign in to comment.