From d968441c7f16e7fda2c089e3766f395e2902cf73 Mon Sep 17 00:00:00 2001 From: hexpunk <10983817+hexpunk@users.noreply.github.com> Date: Sun, 12 Jan 2025 16:38:13 -0600 Subject: [PATCH] [#4256] Re-export types from domhandler --- src/index-browser.mts | 4 ++++ src/index.ts | 4 ++++ src/load.ts | 2 ++ src/slim.ts | 8 +++++++- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/index-browser.mts b/src/index-browser.mts index 7ba8626841..b8f895912d 100644 --- a/src/index-browser.mts +++ b/src/index-browser.mts @@ -1,9 +1,13 @@ export type * from './types.js'; export type { + AnyNode, Cheerio, CheerioAPI, CheerioOptions, + Document, + Element, HTMLParser2Options, + ParentNode, } from './slim.js'; export { contains, merge } from './static.js'; diff --git a/src/index.ts b/src/index.ts index 2dd139781d..086725608c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,10 +7,14 @@ export * from './load-parse.js'; export { contains, merge } from './static.js'; export type * from './types.js'; export type { + AnyNode, Cheerio, CheerioAPI, CheerioOptions, + Document, + Element, HTMLParser2Options, + ParentNode, } from './slim.js'; import { adapter as htmlparser2Adapter } from 'parse5-htmlparser2-tree-adapter'; diff --git a/src/load.ts b/src/load.ts index 75e2827c64..0bb4378cfe 100644 --- a/src/load.ts +++ b/src/load.ts @@ -10,6 +10,8 @@ import type { AnyNode, Document, Element, ParentNode } from 'domhandler'; import type { SelectorType, BasicAcceptedElems } from './types.js'; import { ElementType } from 'htmlparser2'; +export type { AnyNode, Document, Element, ParentNode } from 'domhandler'; + type StaticType = typeof staticMethods; /** diff --git a/src/slim.ts b/src/slim.ts index 440d0a6fe0..09ce49b8fc 100644 --- a/src/slim.ts +++ b/src/slim.ts @@ -13,7 +13,13 @@ export { contains, merge } from './static.js'; export type * from './types.js'; export type { Cheerio } from './cheerio.js'; export type { CheerioOptions, HTMLParser2Options } from './options.js'; -export type { CheerioAPI } from './load.js'; +export type { + AnyNode, + CheerioAPI, + Document, + Element, + ParentNode, +} from './load.js'; /** * Create a querying function, bound to a document created from the provided