import { nothing, PropertyValues, TemplateResult } from 'lit';
import { type HttpProject } from '@api-client/core/models/HttpProject.js';
import type { IApplication } from '@api-client/core/models/Application.js';
import type { HttpRequest } from '@api-client/core/models/HttpRequest.js';
import type { ProjectRequest } from '@api-client/core/models/ProjectRequest.js';
import type { Environment } from '@api-client/core/models/Environment.js';
import type { IProperty } from '@api-client/core/models/Property.js';
import type { IHttpAssertion } from '@api-client/core/models/http-flows/HttpAssertion.js';
import type { IHttpFlow } from '@api-client/core/models/http-flows/HttpFlows.js';
import { type IRequestConfig } from '@api-client/core/models/RequestConfig.js';
import type { DeserializedPayload } from '@api-client/core/lib/transformers/PayloadSerializer.js';
import type { AuthorizationType } from '@api-client/core/models/Authorization.js';
import { type IRequestAuthorization, RequestAuthorization } from '@api-client/core/models/RequestAuthorization.js';
import type { IHttpProjectProxyInit, IHttpProjectStoreProxyInit } from '@api-client/core/proxy/HttpProjectProxy.js';
import type { IProjectExecutionLog } from '@api-client/core/models/ProjectExecution.js';
import type { IProxyResult } from '@api-client/core/proxy/Proxy.js';
import type { IRequestLog } from '@api-client/core/models/RequestLog.js';
import type { Operation } from '@api-client/json/types.js';
import RequestEditor from '../http/RequestEditor.js';
import '../../md/icons/ui-icon.js';
import '../../md/button/ui-button.js';
import '../../md/dropdown-list/ui-dropdown-list.js';
import '../../md/list/ui-list.js';
import '../../md/list/ui-list-item.js';
/**
 * An element that specializes in rendering an HTTP request that is defined on an HttpProject.
 *
 * When using this element set the `project` property to the currently opened
 * project and the `key` to the request to render.
 * The element will hook-up to the events to support project mutations.
 */
export default class HttpProjectRequest extends RequestEditor {
    /**
     * A reference to the global shared variables.
     * Used with the communication with the execution server.
     */
    accessor sharedVariables: Record<string, string> | undefined;
    /**
     * The source project
     */
    accessor project: HttpProject | undefined;
    /**
     * The key of the request being processed.
     * @attribute
     */
    accessor key: string | undefined;
    /**
     * This property is required for the API access to work.
     * Set it to the current application information.
     */
    accessor appInfo: IApplication | undefined;
    /**
     * The read `expects` value from the project request.
     */
    protected expects?: HttpRequest;
    /**
     * The read project request object from the project.
     */
    protected projectRequest?: ProjectRequest;
    /**
     * The list of environments that apply to the current request.
     */
    protected accessor environments: Environment[] | undefined;
    /**
     * Computed value of the environment to render in the environment selector.
     * Because of the complexity of finding the name, it is computed on `environment` change only.
     */
    protected accessor environmentLabel: string | undefined;
    /**
     * When set the requests sent from the editor will contain the entire project serialized with the request
     * rather just the id of the project. This is used in HTTP Client that doesn't use the net-store
     * and uses local proxy.
     * @attribute
     */
    accessor useNetStore: boolean | undefined;
    constructor();
    protected willUpdate(cp: PropertyValues<this>): void;
    applyPatch(info: Operation): void;
    protected cleanup(): void;
    protected setupRequest(): void;
    /**
     * Reads environments to be applies to the request and sets up local variables.
     */
    protected setupRequestEnvironments(request: ProjectRequest): void;
    selectVerb(verb: string): void;
    selectUrl(value: string): void;
    selectHeaders(model: IProperty[]): void;
    selectAssertions(assertions?: IHttpAssertion[]): void;
    selectFlows(flows?: IHttpFlow[]): void;
    selectRequestConfig(config: IRequestConfig): void;
    protected updatePayload(value: DeserializedPayload, mime?: string): Promise<void>;
    addAuthorization(type: AuthorizationType): RequestAuthorization;
    updateAuthorization(schema: IRequestAuthorization, isValid: boolean): void;
    removeAuthorization(type: string): void;
    protected notifySend(): void;
    protected prepareProxyInit(project: HttpProject, key: string, request: ProjectRequest): IHttpProjectProxyInit | IHttpProjectStoreProxyInit;
    protected proxyRequest(init: IHttpProjectProxyInit | IHttpProjectStoreProxyInit): Promise<IProxyResult<IProjectExecutionLog> | undefined>;
    protected execute(): Promise<void>;
    mergeExecutedVariables(vars: Record<string, string>): void;
    protected addHistory(report: IRequestLog): Promise<void>;
    protected handleEnvironmentSelection(e: CustomEvent): void;
    protected computeEnvironmentLabel(): void;
    protected computeSnippetsRequest(): Promise<void>;
    protected renderUrlMeta(): TemplateResult;
    protected renderEnvironmentSelector(): TemplateResult | typeof nothing;
    protected renderEnvironmentOptions(environments: Environment[]): TemplateResult[];
    protected renderEnvironmentItem(env: Environment): TemplateResult;
    protected renderEmptyAuthorization(): TemplateResult;
}
//# sourceMappingURL=HttpProjectRequest.d.ts.map