Skip to content

Commit

Permalink
fix: native server types
Browse files Browse the repository at this point in the history
  • Loading branch information
richenlin committed Nov 27, 2024
1 parent 8639cca commit 6298470
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"dependencies": {
"@grpc/grpc-js": "^1.12.2",
"koatty_container": "^1.x.x",
"koatty_core": "^1.10.0-15",
"koatty_core": "^1.x.x",
"koatty_exception": "^1.x.x",
"koatty_lib": "^1.x.x",
"koatty_logger": "^2.x.x",
Expand All @@ -107,4 +107,4 @@
"koatty_proto": "^1.x.x",
"koatty_validation": "^1.x.x"
}
}
}
44 changes: 39 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/server/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* @Usage:
* @Author: richen
* @Date: 2021-06-28 15:06:13
* @LastEditTime: 2024-10-31 11:44:30
* @LastEditTime: 2024-11-27 17:47:17
*/
import { createServer, IncomingMessage, Server, ServerResponse } from "http";
import { createServer, Server } from "http";
import { KoattyApplication, KoattyServer } from "koatty_core";
import { DefaultLogger as Logger } from "koatty_logger";
import { ListeningOptions } from "../index";
Expand Down Expand Up @@ -38,7 +38,7 @@ export class HttpServer implements KoattyServer {
* @param {() => void} listenCallback
* @memberof Http
*/
Start(listenCallback?: () => void): Server<typeof IncomingMessage, typeof ServerResponse> {
Start(listenCallback?: () => void): Server {
listenCallback = listenCallback ? listenCallback : this.listenCallback;
return this.server.listen({
port: this.options.port,
Expand Down
2 changes: 1 addition & 1 deletion src/server/http2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Usage:
* @Author: richen
* @Date: 2021-06-28 15:06:13
* @LastEditTime: 2024-10-31 11:44:48
* @LastEditTime: 2024-11-27 17:44:37
*/
import { createSecureServer, Http2SecureServer, SecureServerOptions } from "http2";
import { KoattyApplication, KoattyServer } from "koatty_core";
Expand Down
3 changes: 1 addition & 2 deletions src/server/https.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* @Date: 2021-11-12 11:48:01
* @LastEditTime: 2024-10-31 11:45:01
*/
import { IncomingMessage, ServerResponse } from "http";
import { createServer, Server, ServerOptions } from "https";
import { KoattyApplication, KoattyServer } from "koatty_core";
import { DefaultLogger as Logger } from "koatty_logger";
Expand Down Expand Up @@ -51,7 +50,7 @@ export class HttpsServer implements KoattyServer {
* @param {() => void} listenCallback
* @memberof Https
*/
Start(listenCallback?: () => void): Server<typeof IncomingMessage, typeof ServerResponse> {
Start(listenCallback?: () => void): Server {
listenCallback = listenCallback ? listenCallback : this.listenCallback;
return this.server.listen({
port: this.options.port,
Expand Down

0 comments on commit 6298470

Please sign in to comment.