🔧 build: 修正类型错误

This commit is contained in:
imsyy
2024-06-12 17:37:37 +08:00
parent e1beb5b534
commit d5217c3dff
4 changed files with 6 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "dailyhot-api", "name": "dailyhot-api",
"version": "2.0.0", "version": "2.0.1",
"description": "An Api on Today's Hot list", "description": "An Api on Today's Hot list",
"keywords": [ "keywords": [
"API", "API",

View File

@@ -4,7 +4,7 @@ import logger from "./utils/logger.js";
import app from "./app.js"; import app from "./app.js";
// 启动服务器 // 启动服务器
const serveHotApi = (port: number = config.PORT) => { const serveHotApi: (port?: number) => void = (port: number = config.PORT) => {
try { try {
const apiServer = serve({ const apiServer = serve({
fetch: app.fetch, fetch: app.fetch,

3
src/types.d.ts vendored
View File

@@ -63,6 +63,3 @@ export type Web = {
export type Options = { export type Options = {
[key: string]: string | undefined; [key: string]: string | undefined;
}; };
// serveHotApi
export default function serveHotApi(port?: number): unknown;

View File

@@ -3,11 +3,13 @@
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Bundler", "moduleResolution": "Bundler",
"declaration": true,
"declarationMap": true,
"strict": false, "strict": false,
"types": ["node"], "types": ["node"],
"jsx": "react-jsx", "jsx": "react-jsx",
"jsxImportSource": "hono/jsx", "jsxImportSource": "hono/jsx",
"outDir": "./dist" "outDir": "./dist"
}, },
"exclude": ["node_modules", "*.test.*"] "exclude": ["node_modules", "*.test.*", "./dist/**/*"]
} }