Skip to content

Commit

Permalink
fix(express,fastify): return type of #listen method
Browse files Browse the repository at this point in the history
  • Loading branch information
micalevisk committed Jul 23, 2023
1 parent 3e60056 commit 779d978
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { INestApplication, HttpServer } from '@nestjs/common';
import type { Server as CoreHttpServer } from 'http';
import type { Server as CoreHttpsServer } from 'https';
import type { Server } from 'net';
import type { Express } from 'express';
import { NestExpressBodyParserOptions } from './nest-express-body-parser-options.interface';
import { NestExpressBodyParserType } from './nest-express-body-parser.interface';
Expand Down Expand Up @@ -32,12 +31,12 @@ export interface NestExpressApplication<
* @param {Function} [callback] Optional callback
* @returns {Promise} A Promise that, when resolved, is a reference to the underlying HttpServer.
*/
listen(port: number | string, callback?: () => void): Promise<Server>;
listen(port: number | string, callback?: () => void): Promise<TServer>;
listen(
port: number | string,
hostname: string,
callback?: () => void,
): Promise<Server>;
): Promise<TServer>;

/**
* A wrapper function around native `express.set()` method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,16 @@ export interface NestFastifyApplication<
listen(
port: number | string,
callback?: (err: Error, address: string) => void,
): Promise<any>;
): Promise<TServer>;
listen(
port: number | string,
address: string,
callback?: (err: Error, address: string) => void,
): Promise<any>;
): Promise<TServer>;
listen(
port: number | string,
address: string,
backlog: number,
callback?: (err: Error, address: string) => void,
): Promise<any>;
): Promise<TServer>;
}

0 comments on commit 779d978

Please sign in to comment.