/// <reference types="node" />
/// <reference types="cors" />
import { GraphQLRequestContext, GraphQLResponse } from 'apollo-server-core';
import { ApolloServer, CorsOptions } from 'apollo-server-express';
import express from 'express';
import { GraphQLError, GraphQLFormattedError, ValidationContext } from 'graphql';
import { Server } from 'http';
import 'reflect-metadata';
import { SubscriptionServer } from 'subscriptions-transport-ws';
import { Middlewares } from './middlewares';
import { CustomRoute } from './routes/rest';
export interface GraphQlServerOptions {
    customContext?: Context;
    validationRules?: ((context: ValidationContext) => any)[];
    formatResponse?: (response: GraphQLResponse, requestContext: GraphQLRequestContext<Record<string, any>>) => GraphQLResponse | null;
    formatError?: (error: GraphQLError) => GraphQLFormattedError;
    hooks?: {
        preInit?: () => void;
        postInit?: () => void;
    };
    middlewares?: Middlewares;
    restRoutes?: CustomRoute[];
    resolvers?: any[];
}
export declare type Context = ({ req, res, }: {
    req: any;
    res: any;
}) => Record<string, unknown>;
declare class GraphQlServer {
    static server: ApolloServer;
    static subscriptionServer: SubscriptionServer;
    static httpServer: Server;
    static createServer(path: string, app: express.Express, corsOpts: CorsOptions | boolean, developmentMode: boolean, serverOpts: GraphQlServerOptions): Promise<void>;
}
export { GraphQlServer };
