import type { AxiosError, AxiosResponse } from 'axios';
import type { HTTP_METHOD, ServiceResponse } from '../models/Generic.js';
import type { ApplicationConstructedProxyConfiguration, UserProvidedProxyConfiguration, InternalProxyConfiguration } from '../models/Proxy.js';
import type { MessageRowInsert } from '@nangohq/types';
interface Logs {
    logs: MessageRowInsert[];
}
interface RouteResponse {
    response: AxiosResponse | AxiosError | Error;
}
interface RetryHandlerResponse {
    shouldRetry: boolean;
}
declare class ProxyService {
    route(externalConfig: ApplicationConstructedProxyConfiguration | UserProvidedProxyConfiguration, internalConfig: InternalProxyConfiguration): Promise<RouteResponse & Logs>;
    configure(externalConfig: ApplicationConstructedProxyConfiguration | UserProvidedProxyConfiguration, internalConfig: InternalProxyConfiguration): ServiceResponse<ApplicationConstructedProxyConfiguration> & Logs;
    retryHandler: (error: AxiosError, type: 'at' | 'after', retryHeader: string) => Promise<RetryHandlerResponse & Logs>;
    /**
     * Retry
     * @desc if retries are set the retry function to determine if retries are
     * actually kicked off or not
     * @param {AxiosError} error
     * @param {attemptNumber} number
     */
    retry: (config: ApplicationConstructedProxyConfiguration, logs: MessageRowInsert[], error: AxiosError, attemptNumber: number) => Promise<boolean>;
    /**
     * Send to http method
     * @desc route the call to a HTTP request based on HTTP method passed in
     * @param {Request} req Express request object
     * @param {Response} res Express response object
     * @param {NextFuncion} next callback function to pass control to the next middleware function in the pipeline.
     * @param {HTTP_METHOD} method
     * @param {ApplicationConstructedProxyConfiguration} configBody
     */
    private sendToHttpMethod;
    stripSensitiveHeaders(headers: ApplicationConstructedProxyConfiguration['headers'], config: ApplicationConstructedProxyConfiguration): {
        [x: string]: string;
    };
    private request;
    /**
     * Construct URL
     * @param {ApplicationConstructedProxyConfiguration} config
     *
     */
    constructUrl(config: ApplicationConstructedProxyConfiguration): string;
    /**
     * Construct Headers
     */
    constructHeaders(config: ApplicationConstructedProxyConfiguration, method: HTTP_METHOD, url: string): Record<string, string>;
    private handleResponse;
    private handleErrorResponse;
}
declare const _default: ProxyService;
export default _default;
