diff --git a/package.json b/package.json index 9688b93..39ed786 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dailyhot-api", - "version": "2.0.0", + "version": "2.0.1", "description": "An Api on Today's Hot list", "keywords": [ "API", diff --git a/src/index.ts b/src/index.ts index e7e44da..3c1dd93 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import logger from "./utils/logger.js"; import app from "./app.js"; // 启动服务器 -const serveHotApi = (port: number = config.PORT) => { +const serveHotApi: (port?: number) => void = (port: number = config.PORT) => { try { const apiServer = serve({ fetch: app.fetch, diff --git a/src/types.d.ts b/src/types.d.ts index 909432c..a642f97 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -62,7 +62,4 @@ export type Web = { // 参数类型 export type Options = { [key: string]: string | undefined; -}; - -// serveHotApi -export default function serveHotApi(port?: number): unknown; \ No newline at end of file +}; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index f42512f..eed4e0c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,11 +3,13 @@ "target": "ESNext", "module": "ESNext", "moduleResolution": "Bundler", + "declaration": true, + "declarationMap": true, "strict": false, "types": ["node"], "jsx": "react-jsx", "jsxImportSource": "hono/jsx", "outDir": "./dist" }, - "exclude": ["node_modules", "*.test.*"] + "exclude": ["node_modules", "*.test.*", "./dist/**/*"] }