File tree Expand file tree Collapse file tree
packages/platform-fastify/adapters Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,16 +9,16 @@ import * as formBody from 'fastify-formbody';
99import * as Reply from 'fastify/lib/reply' ;
1010import * as pathToRegexp from 'path-to-regexp' ;
1111
12- export class FastifyAdapter extends AbstractHttpAdapter {
12+ export class FastifyAdapter < TInstance > extends AbstractHttpAdapter {
1313 constructor (
1414 instanceOrOptions :
15- | any
15+ | TInstance
1616 | fastify . ServerOptions
1717 | fastify . ServerOptionsAsHttp
1818 | fastify . ServerOptionsAsHttp2
1919 | fastify . ServerOptionsAsSecure
2020 | fastify . ServerOptionsAsSecureHttp
21- | fastify . ServerOptionsAsSecureHttp2 = fastify ( ) ,
21+ | fastify . ServerOptionsAsSecureHttp2 = fastify ( ) as any ,
2222 ) {
2323 const instance =
2424 instanceOrOptions &&
@@ -74,12 +74,12 @@ export class FastifyAdapter extends AbstractHttpAdapter {
7474 return this . instance . setNotFoundHandler ( handler ) ;
7575 }
7676
77- public getHttpServer < T = any > ( ) : T {
78- return this . instance . server as T ;
77+ public getHttpServer < TServer = any > ( ) : TServer {
78+ return this . instance . server as TServer ;
7979 }
8080
81- public getInstance < T = any > ( ) : T {
82- return this . instance as T ;
81+ public getInstance < TServer = any > ( ) : TServer {
82+ return this . instance as TServer ;
8383 }
8484
8585 public register ( ...args : any [ ] ) {
You can’t perform that action at this time.
0 commit comments