/// <reference types="webpack-env" />
/// <reference types="node" />
/// <reference types="node" />
import { Config } from '@backstage/config';
import cors from 'cors';
import { Router, ErrorRequestHandler } from 'express';
import { ContentSecurityPolicyOptions } from 'helmet/dist/types/middlewares/content-security-policy';
import * as http from 'http';
import { LoggerService } from '@backstage/backend-plugin-api';
import { RequestLoggingHandlerFactory, ServiceBuilder } from '../types';
export type CspOptions = Record<string, string[]>;
export declare class ServiceBuilderImpl implements ServiceBuilder {
    private logger;
    private serverOptions;
    private helmetOptions;
    private corsOptions;
    private routers;
    private requestLoggingHandler;
    private errorHandler;
    private useDefaultErrorHandler;
    private module;
    constructor(moduleRef: NodeModule);
    loadConfig(config: Config): ServiceBuilder;
    setPort(port: number): ServiceBuilder;
    setHost(host: string): ServiceBuilder;
    setLogger(logger: LoggerService): ServiceBuilder;
    setHttpsSettings(settings: {
        certificate: {
            key: string;
            cert: string;
        } | {
            hostname: string;
        };
    }): ServiceBuilder;
    enableCors(options: cors.CorsOptions): ServiceBuilder;
    setCsp(options: CspOptions): ServiceBuilder;
    addRouter(root: string, router: Router): ServiceBuilder;
    setRequestLoggingHandler(requestLoggingHandler: RequestLoggingHandlerFactory): this;
    setErrorHandler(errorHandler: ErrorRequestHandler): this;
    disableDefaultErrorHandler(): this;
    start(): Promise<http.Server>;
}
export declare function applyCspDirectives(directives: Record<string, string[] | false> | undefined): ContentSecurityPolicyOptions['directives'];
