refactor: fix Element type import

This commit is contained in:
Tony 2025-05-07 04:18:23 +08:00
parent 74fd9ee55c
commit 8faec7fbfd
41 changed files with 82 additions and 39 deletions

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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<Data> => {

View File

@ -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';

View File

@ -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';

View File

@ -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<Data> => {

View File

@ -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';

View File

@ -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';

View File

@ -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<Data> => {

View File

@ -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<Data> => {

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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<Data> => {

View File

@ -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<Data> => {

View File

@ -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<Data> => {

View File

@ -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';

View File

@ -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';

View File

@ -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<Data> => {

View File

@ -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<Data> => {

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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<Data> => {

View File

@ -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';

View File

@ -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<Data> => {

View File

@ -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<Data> => {

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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';

View File

@ -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<Data> => {

View File

@ -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';

View File

@ -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<Data> => {

View File

@ -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';

View File

@ -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",

View File

@ -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)