feat(fastify): added description of the listen method

This commit is contained in:
Aleksey Tsvetkov
2020-01-11 18:18:10 +03:00
parent 00d9574878
commit 7dab2d9d3b
4 changed files with 21 additions and 0 deletions

View File

@@ -7,3 +7,4 @@
export * from './adapters';
export * from './interfaces';
export * from './types';

View File

@@ -1,5 +1,6 @@
import { INestApplication } from '@nestjs/common';
import { HTTPInjectOptions, HTTPInjectResponse } from 'fastify';
import { NestFastifyListenCallback } from '../types/nest-fastify-listen-callback.type';
export interface NestFastifyApplication extends INestApplication {
/**
@@ -35,4 +36,21 @@ export interface NestFastifyApplication extends INestApplication {
* @returns {void}
*/
inject(opts: HTTPInjectOptions | string): Promise<HTTPInjectResponse>;
/**
* Starts the application.
* @returns A Promise that, when resolved, is a reference to the underlying HttpServer.
*/
listen(port: number, callback: NestFastifyListenCallback): Promise<any>;
listen(
port: number,
address: string,
callback: NestFastifyListenCallback,
): Promise<any>;
listen(
port: number,
address: string,
backlog: number,
callback: NestFastifyListenCallback,
): Promise<any>;
}

View File

@@ -0,0 +1 @@
export * from './nest-fastify-listen-callback.type';

View File

@@ -0,0 +1 @@
export type NestFastifyListenCallback = (err: Error, address: string) => void;