import { nothing, TemplateResult } from 'lit';
import { ApiDefinitions, IRequest } from '@api-client/core/build/browser.js';
import { ApiDocumentationBase } from './ApiDocumentationBase.js';
import ApiRequestElement from './ApiRequest.element.js';
import { Oauth2Credentials } from '../authorization/types.js';
import '../../define/amf/api-request.js';
import '../../define/amf/api-operation-document.js';
import '../../define/amf/api-parameter-document.js';
import '../../define/http/http-snippets.js';
interface SnippetInfo {
    value?: IRequest;
    reading: boolean;
}
/**
 * A web component that renders the resource documentation page for an API resource built from
 * the AMF graph model.
 *
 * @fires tryit
 */
export default class ApiResourceDocument extends ApiDocumentationBase {
    protected endpointValue?: ApiDefinitions.IApiEndPoint;
    protected serverInternal?: ApiDefinitions.IApiServer;
    protected serversValue?: ApiDefinitions.IApiServer[];
    protected operationIdValue?: string;
    protected serverIdValue?: string;
    protected baseUriValue?: string;
    protected urlValue?: string;
    protected protocolsValue?: string[];
    protected snippetsInternal: Record<string, SnippetInfo>;
    get snippets(): Record<string, SnippetInfo>;
    protected processSelectionTimeout?: number;
    get endpoint(): ApiDefinitions.IApiEndPoint | undefined;
    set endpoint(value: ApiDefinitions.IApiEndPoint | undefined);
    get operationId(): string | undefined;
    /**
     * When set it scrolls to the operation with the given id, if exists.
     * The operation is performed after render.
     * @attribute
     */
    set operationId(value: string | undefined);
    get serverId(): string | undefined;
    /**
     * The id of the currently selected server to use to construct the URL.
     * If not set a first server in the API servers array is used.
     * @attribute
     */
    set serverId(value: string | undefined);
    get server(): ApiDefinitions.IApiServer | undefined;
    set server(value: ApiDefinitions.IApiServer | undefined);
    /**
     * The list of the servers read from the API and the endpoint.
     */
    get servers(): ApiDefinitions.IApiServer[] | undefined;
    /**
     * The list of protocols to render.
     */
    get protocol(): string | undefined;
    /**
     * A property to set to override AMF's model base URI information.
     * When this property is set, the `endpointUri` property is recalculated.
     * @attribute
     */
    get baseUri(): string | undefined;
    set baseUri(value: string | undefined);
    /**
     * The computed URI for the endpoint.
     */
    get endpointUri(): string | undefined;
    /**
     * The API's protocols.
     */
    get protocols(): string[] | undefined;
    /**
     * When set it renders the "try it" button that dispatches the `tryit` event.
     * @attribute
     */
    tryItButton?: boolean;
    /**
     * When set it renders the "try it" panel next to the operation documentation.
     * Setting this automatically disables the `tryItButton` property.
     *
     * Note, use this only when there's enough space on the screen to render 2 panels side-by-side.
     * @attribute
     */
    tryItPanel?: boolean;
    /**
     * When set it renders the URL input above the URL parameters in the HTTP editor.
     * @attribute
     */
    httpUrlEditor?: boolean;
    /**
     * List of credentials source passed to the HTTP editor
     */
    httpCredentialsSource?: Oauth2Credentials[];
    /**
     * OAuth2 redirect URI.
     * This value **must** be set in order for OAuth 1/2 to work properly.
     * This is only required in inline mode (`inlineMethods`).
     * @attribute
     */
    redirectUri?: string;
    /**
     * Optional property to set on the request editor.
     * When true, the server selector is not rendered
     * @attribute
     */
    httpNoServerSelector?: boolean;
    /**
     * When set it renders "add custom" item button in the HTTP request editor.
     * If the element is to be used without AMF model this should always
     * be enabled. Otherwise users won't be able to add a parameter.
     * @attribute
     */
    httpAllowCustom?: boolean;
    /**
     * Optional property to set on the request editor.
     * If true, the server selector custom base URI option is rendered
     * @attribute
     */
    httpAllowCustomBaseUri?: boolean;
    /**
     * When set it renders the view optimised for asynchronous API operation.
     * @attribute
     */
    asyncApi?: boolean;
    /**
     * Holds the value of the currently selected server
     * Data type: URI
     * @attribute
     */
    serverValue?: string;
    /**
     * Holds the type of the currently selected server
     * Values: `server` | `uri` | `custom`
     * @attribute
     */
    serverType?: string;
    constructor();
    disconnectedCallback(): void;
    /**
     * Scrolls the view to the operation, when present in the DOM.
     * @param id The operation domain id to scroll into.
     */
    scrollToOperation(id: string): void;
    processGraph(): Promise<void>;
    /**
     * Queries the API store for the API summary object.
     */
    queryProtocols(): Promise<void>;
    /**
     * Queries the store for the endpoint data.
     * @returns {Promise<void>}
     */
    queryEndpoint(): Promise<void>;
    /**
     * Scrolls to the selected operation after view update.
     */
    protected operationIdChanged(): Promise<void>;
    /**
     * Queries the store for the current servers value.
     */
    queryServers(): Promise<void>;
    /**
     * Sets the private server value for the current server defined by `serverId`.
     * Calls the `.processServerSelection()` function to set server related values.
     */
    protected selectServer(): void;
    /**
     * Performs actions after a server is selected.
     */
    protected processServerSelection(): void;
    /**
     * Computes the URL value for the current serves, selected server, and endpoint's path.
     */
    protected computeUrlValue(): void;
    /**
     * Runs over each request editor and collects request values for code snippets generators.
     */
    protected collectCodeSnippets(): void;
    protected requestChangeHandler(e: Event): void;
    /**
     * Reads the request data from the request panel for the code snippets.
     */
    protected readCodeSnippets(panel: ApiRequestElement): Promise<void>;
    render(): TemplateResult;
    /**
     * @returns The template for the Operation title.
     */
    protected renderTitle(endpoint: ApiDefinitions.IApiEndPoint): TemplateResult | string;
    /**
     * @returns The template for the operation's URL.
     */
    protected renderUrl(): TemplateResult;
    /**
     * @returns The template for the list of operations.
     */
    protected renderOperations(endpoint: ApiDefinitions.IApiEndPoint): TemplateResult | string;
    /**
     * @param operation The operation to render.
     * @returns The template for the API operation.
     */
    protected renderOperation(endpoint: ApiDefinitions.IApiEndPoint, operation: ApiDefinitions.IApiOperation): TemplateResult;
    /**
     * @param operation The operation to render.
     * @returns The template for the try it column panel rendered next to the operation documentation/
     */
    protected renderTryItColumn(operation: ApiDefinitions.IApiOperation): TemplateResult | string;
    /**
     * @param operation The operation to render.
     * @returns The template for the request editor.
     */
    protected renderHttpRequest(operation: ApiDefinitions.IApiOperation): TemplateResult;
    /**
     * @param operation The operation to render.
     * @returns The template for the request's code snippets.
     */
    protected renderCodeSnippetsPanel(operation: ApiDefinitions.IApiOperation): TemplateResult | typeof nothing;
    /**
     * @return The template for the endpoint's extensions.
     */
    protected renderExtensions(endpoint: ApiDefinitions.IApiEndPoint): TemplateResult | typeof nothing;
    /**
     * @returns The template for the parent resource type.
     */
    protected renderExtends(label?: string): TemplateResult | typeof nothing;
    /**
     * @returns The template for the traits applied to the resource.
     */
    protected renderTraits(label?: string): TemplateResult | typeof nothing;
}
export {};
//# sourceMappingURL=ApiResourceDocument.element.d.ts.map