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 e209578c3..096c4c64c 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 a1b0b4b33..6e88ff538 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 97c063fc4..2816677eb 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 003043fc7..83cf24e5a 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 6f88d983b..443ede034 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 b6dbda099..1896c88df 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 e1e112bdf..c41d832b9 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 43914b722..ac72236f3 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 497bec89f..05e7dac65 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 34035a9af..6eaef7fe3 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 8839f8821..d4d3ef356 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 ecef8a97a..71e50c1e0 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 6670bf101..c0dea3494 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 753994413..2c23064c1 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 a98d4b2b5..9c625f36c 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 b861b0a70..cbd4508e3 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 7aa14528b..4dd012758 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 fb6dc40f5..02d482ed6 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 8fe19bc25..53c0db625 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 9d0cc82f0..cd5be2a0d 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 8be42fda7..d9b291829 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 a4ab19b22..d0b4a0551 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 69419e4d5..d93d754b6 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 7254beb1c..fba4e3600 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 343bef215..df4e59cd4 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 e993b2cec..0cf4746bd 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 d35f9f37e..37c9c07c5 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 c24b2887d..dd8d0ee5b 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 ad7d47550..54100997b 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 65c312b3c..f020c4496 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 47f73b9a2..27618481e 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 65c3b7971..2de32318d 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 755c5e0e5..ca4d29319 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 9a980e050..9e81da756 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 39d9264e4..746a166ed 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 86c058bf0..764a44878 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 20d721973..6a4c7a68f 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 2beb8544f..00ec62740 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 93545d939..a8ab609ad 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 cf993d59d..bf1c17372 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 8ba75a56a..7cacdbc4b 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)