import { Logger, type ILogObj } from 'tslog';
import { IRequest } from '../../models/Request.js';
import { IHttpRequest } from '../../models/HttpRequest.js';
import { IRequestConfig } from '../../models/RequestConfig.js';
import { IRequestAuthorization } from '../../models/RequestAuthorization.js';
import { IRequestLog } from '../../models/RequestLog.js';
import { VariablesProcessor } from '../variables/VariablesProcessor.js';
import { IHttpFlow } from '../../models/http-flows/HttpFlows.js';
import { AssertionResult, IHttpAssertion } from '../../models/http-flows/HttpAssertion.js';
import type { HttpEngineOptions } from '../http-engine/CoreEngine.js';
import { CookieJar } from '../../cookies/CookieJar.js';
import { ISentRequest } from '../../models/SentRequest.js';
import { IResponse } from '../../models/Response.js';
import { IErrorResponse } from '../../models/ErrorResponse.js';
import { HttpCertificate } from '../../models/ClientCertificate.js';
/**
 * A class that takes a single HttpRequest definition and executes it.
 *
 * This class does the following (in order):
 *
 * - applies variables
 * - applies authorization configuration
 * - applies cookies
 * - runs request actions
 * - transports the request
 * - processes response and redirect cookies
 * - runs response actions
 * - reports the request log
 */
export declare class HttpRequestRunner {
    /**
     * Request processing configuration.
     */
    config?: IRequestConfig;
    /**
     * Request authorization configuration
     */
    authorization?: IRequestAuthorization[];
    /**
     * Actions to be performed when the request is executed.
     */
    flows?: IHttpFlow[];
    /**
     * The cumulative list of all variables to be applied to the request and other properties.
     * The variables must be already processed for variables in values (evaluated).
     *
     * These variables are passed by reference. Changes made anywhere to the variables will result
     * with updating this list.
     */
    variables?: Record<string, string>;
    /**
     * The variables processor instance.
     */
    variablesProcessor: VariablesProcessor;
    logger?: Logger<ILogObj>;
    /**
     * The abort signal to set on this request.
     * Aborts the request when the signal fires.
     * @type {(AbortSignal | undefined)}
     */
    signal?: AbortSignal;
    /**
     * An instance of a cookie jar (store) to put/read cookies.
     */
    cookies?: CookieJar;
    /**
     * Certificates to send with the request.
     */
    certificates?: HttpCertificate[];
    assertions?: IHttpAssertion[];
    /**
     * Creates an instance from the IRequest object with setting the corresponding variables.
     * @param request The request object to use.
     */
    static fromRequest(request: IRequest): HttpRequestRunner;
    /**
     * Runs the request and all tasks around the HTTp request execution like gathering
     * environment information, running actions, and HTTP modules.
     *
     * @param request The request object to execute.
     * @returns The execution log.
     */
    run(request: IHttpRequest): Promise<IRequestLog>;
    /**
     * @returns the configuration processed by the variables processor.
     */
    readConfig(): Promise<IRequestConfig | undefined>;
    /**
     * @returns the authorization data processed by the variables processor.
     */
    readAuthorization(): Promise<IRequestAuthorization[] | undefined>;
    /**
     * Prepares the request object before making the HTTP request
     * and runs actions and modules.
     *
     * @param request The request to execute.
     * @returns the copy of the request object.
     */
    processRequest(request: IHttpRequest): Promise<IHttpRequest>;
    /**
     * Runs the request through the variables processor.
     * @returns A copy of the passed request with possibly changed values.
     */
    applyVariables(request: IHttpRequest): Promise<IHttpRequest>;
    applyAuthorization(request: IHttpRequest): Promise<IHttpRequest>;
    applyCookies(request: IHttpRequest): Promise<IHttpRequest>;
    /**
     * Executes the request actions and modules.
     */
    runRequestFlows(request: IHttpRequest): Promise<void>;
    /**
     * Executes the request actions and modules.
     */
    runResponseFlows(request: ISentRequest, response: IResponse | IErrorResponse): Promise<void>;
    /**
     * Reads and evaluates action flows.
     *
     * @param trigger The trigger name to read the flows for.
     */
    protected readFlows(trigger: 'request' | 'response'): Promise<IHttpFlow[]>;
    /**
     * Prepares the HTTP engine configuration and executes the request,
     * @param request The request to execute.
     * @returns The execution log.
     */
    executeRequest(request: IHttpRequest): Promise<IRequestLog>;
    /**
     * Creates a configuration options for the HTTP engine.
     */
    prepareEngineConfig(): Promise<HttpEngineOptions>;
    processResponse(log: IRequestLog): Promise<void>;
    get sessionCookies(): boolean;
    /**
     * When defined it applies the serve's base URI to relative URLs.
     * @param currentUrl The URL to process.
     */
    prepareRequestUrl(currentUrl: string, variables: Record<string, string>): string;
    /**
     * Prepares and runs assertions on the response.
     * It changes the response object by setting the assertions result.
     */
    runAssertions(request: ISentRequest, response: IResponse | IErrorResponse): Promise<AssertionResult[] | undefined>;
    /**
     * @returns Prepared (evaluated with variables) assertions. Only not disabled assertions are returned.
     */
    protected readAssertions(): Promise<IHttpAssertion[]>;
}
//# sourceMappingURL=HttpRequestRunner.d.ts.map