/// <reference types="node" />
import { RequestMethod } from '@nestjs/common';
import { CorsOptions } from '@nestjs/common/interfaces/external/cors-options.interface';
import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter';
import { FastifyInstance, FastifyLoggerInstance, FastifyPlugin, FastifyPluginOptions, FastifyRegisterOptions, FastifyReply, FastifyRequest, FastifyServerOptions, RawReplyDefaultExpression, RawRequestDefaultExpression, RawServerBase, RawServerDefault, RequestGenericInterface } from 'fastify';
import * as http2 from 'http2';
import * as https from 'https';
import { InjectOptions } from 'light-my-request';
import { FastifyStaticOptions, PointOfViewOptions } from '../interfaces/external';
declare type FastifyHttp2SecureOptions<Server extends http2.Http2SecureServer, Logger extends FastifyLoggerInstance = FastifyLoggerInstance> = FastifyServerOptions<Server, Logger> & {
    http2: true;
    https: http2.SecureServerOptions;
};
declare type FastifyHttp2Options<Server extends http2.Http2Server, Logger extends FastifyLoggerInstance = FastifyLoggerInstance> = FastifyServerOptions<Server, Logger> & {
    http2: true;
    http2SessionTimeout?: number;
};
declare type FastifyHttpsOptions<Server extends https.Server, Logger extends FastifyLoggerInstance = FastifyLoggerInstance> = FastifyServerOptions<Server, Logger> & {
    https: https.ServerOptions;
};
export declare class FastifyAdapter<TServer extends RawServerBase = RawServerDefault, TRawRequest extends RawRequestDefaultExpression<TServer> = RawRequestDefaultExpression<TServer>, TRawResponse extends RawReplyDefaultExpression<TServer> = RawReplyDefaultExpression<TServer>> extends AbstractHttpAdapter<TServer, FastifyRequest<RequestGenericInterface, TServer, TRawRequest>, FastifyReply<TServer, TRawRequest, TRawResponse>> {
    protected readonly instance: FastifyInstance<TServer, TRawRequest, TRawResponse>;
    private isMiddieRegistered;
    constructor(instanceOrOptions?: FastifyInstance<TServer> | FastifyHttp2Options<TServer> | FastifyHttp2SecureOptions<any> | FastifyHttpsOptions<any> | FastifyServerOptions<TServer>);
    init(): Promise<void>;
    listen(port: string | number, callback?: () => void): void;
    listen(port: string | number, hostname: string, callback?: () => void): void;
    reply(response: TRawResponse | FastifyReply, body: any, statusCode?: number): FastifyReply<import("http").Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify/types/route").RouteGenericInterface, unknown>;
    status(response: TRawResponse | FastifyReply, statusCode: number): TRawResponse | FastifyReply<import("http").Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify/types/route").RouteGenericInterface, unknown>;
    render(response: FastifyReply & {
        view: Function;
    }, view: string, options: any): any;
    redirect(response: FastifyReply, statusCode: number, url: string): FastifyReply<import("http").Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify/types/route").RouteGenericInterface, unknown>;
    setErrorHandler(handler: Parameters<FastifyInstance<TServer, TRawRequest, TRawResponse>['setErrorHandler']>[0]): void;
    setNotFoundHandler(handler: Parameters<FastifyInstance<TServer, TRawRequest, TRawResponse>['setNotFoundHandler']>[0]): void;
    getHttpServer<T = TServer>(): T;
    getInstance<T = FastifyInstance<TServer, TRawRequest, TRawResponse>>(): T;
    register<Options extends FastifyPluginOptions>(plugin: FastifyPlugin<Options>, opts?: FastifyRegisterOptions<Options>): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyLoggerInstance> & PromiseLike<undefined>;
    inject(opts: InjectOptions | string): Promise<import("light-my-request").Response>;
    close(): Promise<undefined>;
    initHttpServer(): void;
    useStaticAssets(options: FastifyStaticOptions): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyLoggerInstance> & PromiseLike<undefined>;
    setViewEngine(options: PointOfViewOptions | string): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyLoggerInstance> & PromiseLike<undefined>;
    setHeader(response: FastifyReply, name: string, value: string): FastifyReply<import("http").Server, import("http").IncomingMessage, import("http").ServerResponse, import("fastify/types/route").RouteGenericInterface, unknown>;
    getRequestHostname(request: FastifyRequest): string;
    getRequestMethod(request: FastifyRequest): string;
    getRequestUrl(request: FastifyRequest): string;
    enableCors(options: CorsOptions): void;
    registerParserMiddleware(): void;
    createMiddlewareFactory(requestMethod: RequestMethod): Promise<(path: string, callback: Function) => any>;
    getType(): string;
    protected registerWithPrefix(factory: FastifyPlugin, prefix?: string): FastifyInstance<TServer, TRawRequest, TRawResponse, FastifyLoggerInstance> & PromiseLike<undefined>;
    private isNativeResponse;
    private registerMiddie;
}
export {};
