/** * just a definition use for inject */ import * as fastify from 'fastify'; import { ServerResponse } from 'http'; import { Http2ServerResponse } from 'http2'; export class HttpResponse implements fastify.FastifyReply { context: fastify.FastifyContext; request: fastify.FastifyRequest; res: ServerResponse; sent: boolean; callNotFound(): void { return void 0; } code(statusCode: number): fastify.FastifyReply { return undefined; } getHeader(name: string): string | undefined { return undefined; } getResponseTime(): number { return 0; } hasHeader(name: string): boolean { return false; } header(name: string, value: any): fastify.FastifyReply { return undefined; } headers(headers: { [p: string]: any }): fastify.FastifyReply { return undefined; } redirect(url: string): fastify.FastifyReply; redirect( statusCode: number, url: string, ): fastify.FastifyReply; redirect( statusCodeOrUrl: string | number, url?: string, ): fastify.FastifyReply { return undefined; } removeHeader(name: string): fastify.FastifyReply { return undefined; } send(payload?: any): fastify.FastifyReply { return undefined; } serialize(payload: any): string { return ''; } serializer(fn: Function): fastify.FastifyReply { return undefined; } status(statusCode: number): fastify.FastifyReply { return undefined; } type(contentType: string): fastify.FastifyReply { return undefined; } } export class Http2Response implements fastify.FastifyReply { context: fastify.FastifyContext; request: fastify.FastifyRequest; res: Http2ServerResponse; sent: boolean; callNotFound(): void { return; } code(statusCode: number): fastify.FastifyReply { return undefined; } getHeader(name: string): string | undefined { return undefined; } getResponseTime(): number { return 0; } hasHeader(name: string): boolean { return false; } header(name: string, value: any): fastify.FastifyReply { return undefined; } headers(headers: { [p: string]: any; }): fastify.FastifyReply { return undefined; } redirect(url: string): fastify.FastifyReply; redirect( statusCode: number, url: string, ): fastify.FastifyReply; redirect( statusCodeOrUrl: string | number, url?: string, ): fastify.FastifyReply { return undefined; } removeHeader(name: string): fastify.FastifyReply { return undefined; } send(payload?: any): fastify.FastifyReply { return undefined; } serialize(payload: any): string { return ''; } serializer(fn: Function): fastify.FastifyReply { return undefined; } status(statusCode: number): fastify.FastifyReply { return undefined; } type(contentType: string): fastify.FastifyReply { return undefined; } }