import { type Logger } from '@restorecommerce/logger';
import { type Server, ServerResponse } from 'node:http';
import Koa from 'koa';
import { type AddressInfo } from 'node:net';
import { type Facade, type FacadeBaseContext, type FacadeModule, type FacadeModuleBase, type FacadeModulesContext, FileUploadOptionsConfig } from './interfaces.js';
import { type KafkaProviderConfig } from '@restorecommerce/kafka-client';
export * from './modules/index.js';
export * from './middlewares/index.js';
export * from './interfaces.js';
export * from './utils.js';
export * from './gql/index.js';
interface RestoreCommerceFacadeImplConfig {
    koa: Koa<any, any>;
    logger: Logger;
    port?: number;
    hostname?: string;
    env?: string;
    kafka?: KafkaProviderConfig['kafka'];
    fileUploadOptions?: FileUploadOptionsConfig['fileUploadOptions'];
    jsonLimit?: string;
    extraServices?: {
        name: string;
        url: string;
    }[];
}
export declare class RestoreCommerceFacade<TModules extends FacadeModuleBase[] = []> implements Facade<TModules> {
    private apolloServices;
    private allResolvers;
    private _server?;
    private _gqlServer?;
    private _initialized;
    readonly logger: Logger;
    readonly port: number;
    readonly hostname: string;
    readonly koa: Koa<any, FacadeModulesContext<TModules>>;
    readonly env: string;
    readonly modules: FacadeModule[];
    readonly kafkaConfig?: KafkaProviderConfig['kafka'];
    readonly fileUploadOptionsConfig?: FileUploadOptionsConfig['fileUploadOptions'];
    readonly jsonLimit?: string;
    readonly extraServices?: {
        name: string;
        url: string;
    }[];
    private startFns;
    private stopFns;
    constructor({ koa, logger, port, hostname, env, kafka, fileUploadOptions, jsonLimit, extraServices }: RestoreCommerceFacadeImplConfig);
    get server(): Server<typeof import("node:http").IncomingMessage, typeof ServerResponse>;
    get address(): AddressInfo | undefined;
    get listening(): boolean;
    useMiddleware<TNewState extends object = {}, TNewContext extends object = {}>(middleware: Koa.Middleware<TNewState, TNewContext>): any;
    useModule<TNewModule extends FacadeModule>(module: TNewModule): any;
    supportsModule<TSupportedModule extends FacadeModuleBase<FacadeBaseContext>>(module: TSupportedModule): this is Facade<[TSupportedModule, ...TModules]> & Facade<[...TModules]>;
    addApolloService({ name, schema, url }: {
        name: string;
        schema: any;
        url: string;
    }): void;
    onStart(fn: () => Promise<void>): void;
    onStop(fn: () => Promise<void>): void;
    private runFnQueue;
    start(): Promise<void>;
    stop(): Promise<void>;
    private mountApolloServer;
}
export interface FacadeConfig {
    port?: number;
    logger?: Logger;
    hostname?: string;
    env?: string;
    keys?: string[];
    kafka?: KafkaProviderConfig['kafka'];
    fileUploadOptions?: FileUploadOptionsConfig['fileUploadOptions'];
    jsonLimit?: string;
    extraServices?: {
        name: string;
        url: string;
    }[];
}
export declare const createFacade: (config: FacadeConfig) => Facade;
//# sourceMappingURL=index.d.ts.map