From 8faec7fbfd652dfeb8416cab7fc9e6abf96f9f97 Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 7 May 2025 04:18:23 +0800 Subject: [PATCH] refactor: fix Element type import --- lib/middleware/parameter.ts | 3 ++- lib/routes/10000link/info.ts | 3 ++- lib/routes/199it/index.ts | 3 ++- lib/routes/adquan/case-library.ts | 3 ++- lib/routes/adquan/index.ts | 3 ++- lib/routes/aflcio/blog.ts | 3 ++- lib/routes/ali213/news.ts | 3 ++- lib/routes/ali213/zl.ts | 3 ++- lib/routes/anytxt/release-notes.ts | 3 ++- lib/routes/asiafruitchina/categories.ts | 3 ++- lib/routes/asiafruitchina/news.ts | 3 ++- lib/routes/bullionvault/gold-news.ts | 3 ++- lib/routes/cccmc/index.ts | 3 ++- lib/routes/cfr/utils.ts | 3 ++- lib/routes/chinacdc/index.ts | 3 ++- lib/routes/chinadaily/language.ts | 3 ++- lib/routes/chinaratings/credit-research.ts | 3 ++- lib/routes/cursor/changelog.ts | 3 ++- lib/routes/diariofruticola/filtro.ts | 3 ++- lib/routes/dytt/index.ts | 3 ++- lib/routes/fangchan/list.ts | 3 ++- lib/routes/gov/moa/gjs.ts | 3 ++- lib/routes/grainoil/category.ts | 3 ++- lib/routes/jisilu/util.ts | 3 ++- lib/routes/joneslanglasalle/index.ts | 3 ++- lib/routes/kpopping/kpics.ts | 3 ++- lib/routes/kpopping/news.ts | 3 ++- lib/routes/lhratings/research.ts | 3 ++- lib/routes/ltaaa/article.ts | 3 ++- lib/routes/mycard520/news.ts | 3 ++- lib/routes/neea/jlpt.ts | 3 ++- lib/routes/oschina/column.ts | 3 ++- lib/routes/oschina/event.ts | 3 ++- lib/routes/papers/category.ts | 3 ++- lib/routes/raspberrypi/magazine.ts | 3 ++- lib/routes/stcn/index.ts | 3 ++- lib/routes/theinitium/app.ts | 3 ++- lib/routes/xjtu/zs.ts | 3 ++- lib/utils/wechat-mp.ts | 3 ++- package.json | 1 + pnpm-lock.yaml | 3 +++ 41 files changed, 82 insertions(+), 39 deletions(-) diff --git a/lib/middleware/parameter.ts b/lib/middleware/parameter.ts index e209578c39..096c4c64c6 100644 --- a/lib/middleware/parameter.ts +++ b/lib/middleware/parameter.ts @@ -1,5 +1,6 @@ import * as entities from 'entities'; -import { load, type CheerioAPI, type Element } from 'cheerio'; +import { load, type CheerioAPI } from 'cheerio'; +import type { Element } from 'domhandler'; import { simplecc } from 'simplecc-wasm'; import ofetch from '@/utils/ofetch'; import { config } from '@/config'; diff --git a/lib/routes/10000link/info.ts b/lib/routes/10000link/info.ts index a1b0b4b33a..6e88ff5383 100644 --- a/lib/routes/10000link/info.ts +++ b/lib/routes/10000link/info.ts @@ -5,7 +5,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/199it/index.ts b/lib/routes/199it/index.ts index 97c063fc4b..2816677eb7 100644 --- a/lib/routes/199it/index.ts +++ b/lib/routes/199it/index.ts @@ -5,7 +5,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/adquan/case-library.ts b/lib/routes/adquan/case-library.ts index 003043fc73..83cf24e5a7 100644 --- a/lib/routes/adquan/case-library.ts +++ b/lib/routes/adquan/case-library.ts @@ -6,7 +6,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/adquan/index.ts b/lib/routes/adquan/index.ts index 6f88d983b7..443ede0340 100644 --- a/lib/routes/adquan/index.ts +++ b/lib/routes/adquan/index.ts @@ -6,7 +6,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/aflcio/blog.ts b/lib/routes/aflcio/blog.ts index b6dbda0996..1896c88df5 100644 --- a/lib/routes/aflcio/blog.ts +++ b/lib/routes/aflcio/blog.ts @@ -4,7 +4,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/ali213/news.ts b/lib/routes/ali213/news.ts index e1e112bdf7..c41d832b9f 100644 --- a/lib/routes/ali213/news.ts +++ b/lib/routes/ali213/news.ts @@ -1,6 +1,7 @@ import path from 'node:path'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import { type DataItem, type Route, type Data, ViewType } from '@/types'; diff --git a/lib/routes/ali213/zl.ts b/lib/routes/ali213/zl.ts index 43914b7224..ac72236f36 100644 --- a/lib/routes/ali213/zl.ts +++ b/lib/routes/ali213/zl.ts @@ -1,6 +1,7 @@ import path from 'node:path'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import { type DataItem, type Route, type Data, ViewType } from '@/types'; diff --git a/lib/routes/anytxt/release-notes.ts b/lib/routes/anytxt/release-notes.ts index 497bec89f3..05e7dac65f 100644 --- a/lib/routes/anytxt/release-notes.ts +++ b/lib/routes/anytxt/release-notes.ts @@ -3,7 +3,8 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/asiafruitchina/categories.ts b/lib/routes/asiafruitchina/categories.ts index 34035a9af1..6eaef7fe3c 100644 --- a/lib/routes/asiafruitchina/categories.ts +++ b/lib/routes/asiafruitchina/categories.ts @@ -5,7 +5,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/asiafruitchina/news.ts b/lib/routes/asiafruitchina/news.ts index 8839f88216..d4d3ef3561 100644 --- a/lib/routes/asiafruitchina/news.ts +++ b/lib/routes/asiafruitchina/news.ts @@ -5,7 +5,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/bullionvault/gold-news.ts b/lib/routes/bullionvault/gold-news.ts index ecef8a97ab..71e50c1e0a 100644 --- a/lib/routes/bullionvault/gold-news.ts +++ b/lib/routes/bullionvault/gold-news.ts @@ -4,7 +4,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/cccmc/index.ts b/lib/routes/cccmc/index.ts index 6670bf1019..c0dea34949 100644 --- a/lib/routes/cccmc/index.ts +++ b/lib/routes/cccmc/index.ts @@ -4,7 +4,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/cfr/utils.ts b/lib/routes/cfr/utils.ts index 7539944135..2c23064c1f 100644 --- a/lib/routes/cfr/utils.ts +++ b/lib/routes/cfr/utils.ts @@ -1,4 +1,5 @@ -import { type Cheerio, type CheerioAPI, type Element, load } from 'cheerio'; +import { type Cheerio, type CheerioAPI, load } from 'cheerio'; +import type { Element } from 'domhandler'; import ofetch from '@/utils/ofetch'; import type { DataItem } from '@/types'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/chinacdc/index.ts b/lib/routes/chinacdc/index.ts index a98d4b2b5a..9c625f36ca 100644 --- a/lib/routes/chinacdc/index.ts +++ b/lib/routes/chinacdc/index.ts @@ -1,6 +1,7 @@ import path from 'node:path'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import { type DataItem, type Route, type Data, ViewType } from '@/types'; diff --git a/lib/routes/chinadaily/language.ts b/lib/routes/chinadaily/language.ts index b861b0a70d..cbd4508e30 100644 --- a/lib/routes/chinadaily/language.ts +++ b/lib/routes/chinadaily/language.ts @@ -6,7 +6,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/chinaratings/credit-research.ts b/lib/routes/chinaratings/credit-research.ts index 7aa14528b7..4dd012758f 100644 --- a/lib/routes/chinaratings/credit-research.ts +++ b/lib/routes/chinaratings/credit-research.ts @@ -4,7 +4,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/cursor/changelog.ts b/lib/routes/cursor/changelog.ts index fb6dc40f5f..02d482ed6f 100644 --- a/lib/routes/cursor/changelog.ts +++ b/lib/routes/cursor/changelog.ts @@ -3,7 +3,8 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/diariofruticola/filtro.ts b/lib/routes/diariofruticola/filtro.ts index 8fe19bc253..53c0db625f 100644 --- a/lib/routes/diariofruticola/filtro.ts +++ b/lib/routes/diariofruticola/filtro.ts @@ -5,7 +5,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/dytt/index.ts b/lib/routes/dytt/index.ts index 9d0cc82f03..cd5be2a0d4 100644 --- a/lib/routes/dytt/index.ts +++ b/lib/routes/dytt/index.ts @@ -6,7 +6,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; const domain: string = 'www.dydytt.net'; diff --git a/lib/routes/fangchan/list.ts b/lib/routes/fangchan/list.ts index 8be42fda7b..d9b291829f 100644 --- a/lib/routes/fangchan/list.ts +++ b/lib/routes/fangchan/list.ts @@ -6,7 +6,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/gov/moa/gjs.ts b/lib/routes/gov/moa/gjs.ts index a4ab19b220..d0b4a05512 100644 --- a/lib/routes/gov/moa/gjs.ts +++ b/lib/routes/gov/moa/gjs.ts @@ -5,7 +5,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/grainoil/category.ts b/lib/routes/grainoil/category.ts index 69419e4d55..d93d754b6d 100644 --- a/lib/routes/grainoil/category.ts +++ b/lib/routes/grainoil/category.ts @@ -4,7 +4,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/jisilu/util.ts b/lib/routes/jisilu/util.ts index 7254beb1c8..fba4e3600f 100644 --- a/lib/routes/jisilu/util.ts +++ b/lib/routes/jisilu/util.ts @@ -1,4 +1,5 @@ -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type DataItem } from '@/types'; diff --git a/lib/routes/joneslanglasalle/index.ts b/lib/routes/joneslanglasalle/index.ts index 343bef2152..df4e59cd46 100644 --- a/lib/routes/joneslanglasalle/index.ts +++ b/lib/routes/joneslanglasalle/index.ts @@ -1,6 +1,7 @@ import path from 'node:path'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import { type DataItem, type Route, type Data, ViewType } from '@/types'; diff --git a/lib/routes/kpopping/kpics.ts b/lib/routes/kpopping/kpics.ts index e993b2cec8..0cf4746bd4 100644 --- a/lib/routes/kpopping/kpics.ts +++ b/lib/routes/kpopping/kpics.ts @@ -5,7 +5,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/kpopping/news.ts b/lib/routes/kpopping/news.ts index d35f9f37e4..37c9c07c55 100644 --- a/lib/routes/kpopping/news.ts +++ b/lib/routes/kpopping/news.ts @@ -6,7 +6,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/lhratings/research.ts b/lib/routes/lhratings/research.ts index c24b2887db..dd8d0ee5b8 100644 --- a/lib/routes/lhratings/research.ts +++ b/lib/routes/lhratings/research.ts @@ -3,7 +3,8 @@ import { type Data, type DataItem, type Route, ViewType } from '@/types'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/ltaaa/article.ts b/lib/routes/ltaaa/article.ts index ad7d475506..54100997b9 100644 --- a/lib/routes/ltaaa/article.ts +++ b/lib/routes/ltaaa/article.ts @@ -5,7 +5,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/mycard520/news.ts b/lib/routes/mycard520/news.ts index 65c312b3c9..f020c44960 100644 --- a/lib/routes/mycard520/news.ts +++ b/lib/routes/mycard520/news.ts @@ -4,7 +4,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/neea/jlpt.ts b/lib/routes/neea/jlpt.ts index 47f73b9a2f..27618481e8 100644 --- a/lib/routes/neea/jlpt.ts +++ b/lib/routes/neea/jlpt.ts @@ -4,7 +4,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/oschina/column.ts b/lib/routes/oschina/column.ts index 65c3b7971c..2de32318d5 100644 --- a/lib/routes/oschina/column.ts +++ b/lib/routes/oschina/column.ts @@ -1,6 +1,7 @@ import path from 'node:path'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import { type DataItem, type Route, type Data, ViewType } from '@/types'; diff --git a/lib/routes/oschina/event.ts b/lib/routes/oschina/event.ts index 755c5e0e5c..ca4d293197 100644 --- a/lib/routes/oschina/event.ts +++ b/lib/routes/oschina/event.ts @@ -5,7 +5,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/papers/category.ts b/lib/routes/papers/category.ts index 9a980e050b..9e81da756c 100644 --- a/lib/routes/papers/category.ts +++ b/lib/routes/papers/category.ts @@ -5,7 +5,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/raspberrypi/magazine.ts b/lib/routes/raspberrypi/magazine.ts index 39d9264e41..746a166ed2 100644 --- a/lib/routes/raspberrypi/magazine.ts +++ b/lib/routes/raspberrypi/magazine.ts @@ -5,7 +5,8 @@ import cache from '@/utils/cache'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; import path from 'node:path'; diff --git a/lib/routes/stcn/index.ts b/lib/routes/stcn/index.ts index 86c058bf07..764a44878f 100644 --- a/lib/routes/stcn/index.ts +++ b/lib/routes/stcn/index.ts @@ -5,7 +5,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/routes/theinitium/app.ts b/lib/routes/theinitium/app.ts index 20d7219736..6a4c7a68f6 100644 --- a/lib/routes/theinitium/app.ts +++ b/lib/routes/theinitium/app.ts @@ -1,7 +1,8 @@ import { Route } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; -import { load, type CheerioAPI, type Element } from 'cheerio'; +import { load, type CheerioAPI } from 'cheerio'; +import type { Element } from 'domhandler'; import { art } from '@/utils/render'; import path from 'node:path'; import { config } from '@/config'; diff --git a/lib/routes/xjtu/zs.ts b/lib/routes/xjtu/zs.ts index 2beb8544f5..00ec627402 100644 --- a/lib/routes/xjtu/zs.ts +++ b/lib/routes/xjtu/zs.ts @@ -5,7 +5,8 @@ import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import { type CheerioAPI, type Cheerio, type Element, load } from 'cheerio'; +import { type CheerioAPI, type Cheerio, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { type Context } from 'hono'; export const handler = async (ctx: Context): Promise => { diff --git a/lib/utils/wechat-mp.ts b/lib/utils/wechat-mp.ts index 93545d9390..a8ab609ad0 100644 --- a/lib/utils/wechat-mp.ts +++ b/lib/utils/wechat-mp.ts @@ -26,7 +26,8 @@ */ import ofetch from '@/utils/ofetch'; -import { type Cheerio, type CheerioAPI, type Element, load } from 'cheerio'; +import { type Cheerio, type CheerioAPI, load } from 'cheerio'; +import type { Element } from 'domhandler'; import { parseDate } from '@/utils/parse-date'; import cache from '@/utils/cache'; import logger from '@/utils/logger'; diff --git a/package.json b/package.json index cf993d59dd..bf1c173722 100644 --- a/package.json +++ b/package.json @@ -172,6 +172,7 @@ "@vercel/nft": "0.29.2", "@vitest/coverage-v8": "2.1.9", "discord-api-types": "0.38.3", + "domhandler": "5.0.3", "eslint": "9.26.0", "eslint-config-prettier": "10.1.2", "eslint-nibble": "8.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ba75a56a9..7cacdbc4ba 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -383,6 +383,9 @@ importers: discord-api-types: specifier: 0.38.3 version: 0.38.3 + domhandler: + specifier: 5.0.3 + version: 5.0.3 eslint: specifier: 9.26.0 version: 9.26.0(jiti@2.4.2)