import { Response } from 'superagent';
import { Macroable } from 'macroable';
import { Assert } from '@japa/assert';
import { ApiRequest } from './request';
import { RequestConfig, ResponseCookie, ResponseCookies, SuperAgentResponseFile } from './types';
export declare class ApiResponse extends Macroable {
    request: ApiRequest;
    response: Response;
    private config;
    assert?: Assert | undefined;
    static macros: {};
    static getters: {};
    private valuesDumped;
    /**
     * Parsed cookies
     */
    cookiesJar: ResponseCookies;
    constructor(request: ApiRequest, response: Response, config: RequestConfig, assert?: Assert | undefined);
    /**
     * Parse response header to collect cookies
     */
    private parseCookies;
    /**
     * Process cookies using the serializer
     */
    private processCookies;
    /**
     * Ensure assert plugin is installed
     */
    ensureHasAssert(): void;
    /**
     * Response content-type charset. Undefined if no charset
     * is mentioned.
     */
    charset(): string | undefined;
    /**
     * Parsed files from the multipart response.
     */
    files<Properties extends string>(): {
        [K in Properties]: SuperAgentResponseFile;
    };
    /**
     * Returns an object of links by parsing the "Link" header.
     *
     * @example
     * Link: <https://one.example.com>; rel="preconnect", <https://two.example.com>; rel="preload"
     * response.links()
     * // {
     * //   preconnect: 'https://one.example.com',
       //   preload: 'https://two.example.com',
     * // }
     */
    links(): Record<string, string>;
    /**
     * Response status type
     */
    statusType(): number;
    /**
     * Request raw parsed text
     */
    text(): string;
    /**
     * Response body
     */
    body(): any;
    /**
     * Read value for a given response header
     */
    header(key: string): string | undefined;
    /**
     * Get all response headers
     */
    headers(): Record<string, string>;
    /**
     * Get response status
     */
    status(): number;
    /**
     * Get response content-type
     */
    type(): string;
    /**
     * Get redirects URLs the request has followed before
     * getting the response
     */
    redirects(): string[];
    /**
     * Find if the response has parsed body. The check is performed
     * by inspecting the response content-type and returns true
     * when content-type is either one of the following.
     *
     * - application/json
     * - application/x-www-form-urlencoded
     * - multipart/form-data
     *
     * Or when the response body is a buffer.
     */
    hasBody(): boolean;
    /**
     * Find if the response body has files
     */
    hasFiles(): boolean;
    /**
     * Find if response is an error
     */
    hasError(): boolean;
    /**
     * Find if response is an fatal error. Response with >=500
     * status code are concerned as fatal errors
     */
    hasFatalError(): boolean;
    /**
     * Find if the request client failed to make the request
     */
    hasClientError(): boolean;
    /**
     * Find if the server responded with an error
     */
    hasServerError(): boolean;
    /**
     * Access to response error
     */
    error(): false | import("superagent").HTTPError;
    /**
     * Get cookie by name
     */
    cookie(name: string): ResponseCookie | undefined;
    /**
     * Parsed response cookies
     */
    cookies(): ResponseCookies;
    /**
     * Dump request headers
     */
    dumpHeaders(): this;
    /**
     * Dump request cookies
     */
    dumpCookies(): this;
    /**
     * Dump request body
     */
    dumpBody(): this;
    /**
     * Dump request body
     */
    dumpError(): this;
    /**
     * Dump request
     */
    dump(): this;
    /**
     * Assert response status to match the expected status
     */
    assertStatus(expectedStatus: number): void;
    /**
     * Assert response body to match the expected body
     */
    assertBody(expectedBody: any): void;
    /**
     * Assert response body to match the subset from the
     * expected body
     */
    assertBodyContains(expectedBody: any): void;
    /**
     * Assert response to contain a given cookie and optionally
     * has the expected value
     */
    assertCookie(name: string, value?: any): void;
    /**
     * Assert response to not contain a given cookie
     */
    assertCookieMissing(name: string): void;
    /**
     * Assert response to contain a given header and optionally
     * has the expected value
     */
    assertHeader(name: string, value?: any): void;
    /**
     * Assert response to not contain a given header
     */
    assertHeaderMissing(name: string): void;
    /**
     * Assert response text to include the expected value
     */
    assertTextIncludes(expectedSubset: string): void;
    /**
     * Assert response body is valid as per the API spec.
     */
    assertAgainstApiSpec(): void;
    /**
     * Assert there is a matching redirect
     */
    assertRedirectsTo(pathname: string): void;
}
