import { TemplateResult } from 'lit';
import type { IApiParametrizedSecurityScheme, IApiSecurityRequirement } from '@api-client/core/amf/definitions/Api.js';
import type { IRequestAuthorization } from '@api-client/core/models/RequestAuthorization.js';
import { Oauth2Credentials } from '../authorization/types.js';
import ApiElement from '../ApiElement.js';
import { Authorization } from '../authorization/ui/Authorization.js';
import '../../define/amf/authorization/amf-basic-authorization.js';
import '../../define/amf/authorization/amf-passthrough-authorization.js';
import '../../define/amf/authorization/amf-bearer-authorization.js';
import '../../define/amf/authorization/amf-apikey-authorization.js';
import '../../define/amf/authorization/amf-ramlcustom-authorization.js';
import '../../define/amf/authorization/amf-oauth2-authorization.js';
import '../../define/amf/authorization/amf-oidc-authorization.js';
export interface SecurityMethods {
    types: string[];
    schemes: IApiParametrizedSecurityScheme[];
}
export default class ApiAuthorizationEditor extends ApiElement {
    protected securityInternal: IApiSecurityRequirement | undefined;
    protected methodsInternal?: SecurityMethods;
    get security(): IApiSecurityRequirement | undefined;
    set security(value: IApiSecurityRequirement | undefined);
    get methods(): SecurityMethods | undefined;
    /**
     * Whether or not the element is invalid. The validation state changes
     * when settings change or when the `validate()` function is called.
     * @attribute
     */
    accessor invalid: boolean | undefined;
    /**
     * List of credentials source
     */
    accessor credentialsSource: Oauth2Credentials[] | undefined;
    /**
     * Redirect URL for the OAuth2 authorization.
     * @attribute
     */
    accessor oauth2RedirectUri: string | undefined;
    /**
     * When set it overrides the `authorizationUri` in the authorization editor,
     * regardless to the authorization scheme applied to the request.
     * This is to be used with the mocking service.
     * @attribute
     */
    accessor oauth2AuthorizationUri: string | undefined;
    /**
     * When set it overrides the `authorizationUri` in the authorization editor,
     * regardless to the authorization scheme applied to the request.
     * This is to be used with the mocking service.
     * @attribute
     */
    accessor oauth2AccessTokenUri: string | undefined;
    accessor editors: NodeListOf<Authorization>;
    /**
     * Reads list of authorization methods from the model.
     */
    protected processModel(): void;
    /**
     * Computes list of security schemes that can be applied to the element.
     *
     * @param schemes A list of security schemes to process.
     * @returns A list of authorization methods that can be applied to
     * the current endpoint. Each object describes the list of security types
     * that can be applied to the editor. In OAS an auth method may be an union
     * of methods.
     */
    protected computeMethods(schemes: IApiParametrizedSecurityScheme[]): SecurityMethods;
    /**
     * Reads authorization scheme's name and type from the AMF model.
     */
    protected listSchemeLabels(security: IApiParametrizedSecurityScheme): string | undefined;
    /**
     * A function called each time anything change in the editor.
     * Revalidates the component and dispatches the `change` event.
     */
    protected changeHandler(): void;
    /**
     * Validates state of the editor. It sets `invalid` property when called.
     *
     * Exception: OAuth 2 form reports valid even when the `accessToken` is not
     * set. This adjust for this and reports invalid when `accessToken` for OAuth 2
     * is missing.
     *
     * @returns True when the form has valid data.
     */
    validate(): boolean;
    /**
     * Creates a list of configuration by calling the `serialize()` function on each
     * currently rendered authorization form.
     *
     * @returns List of authorization settings.
     */
    serialize(): IRequestAuthorization[];
    /**
     * Calls the `authorize()` function on each rendered authorization methods.
     * Currently only `OAuth 1.0` and `OAuth 2.0` actually perform the authorization.
     *
     * Each method is called in order to make sure the user is not overwhelmed with
     * dialogs or other UI elements.
     *
     * The function rejects when at least one authorization method rejects.
     */
    authorize(): Promise<void>;
    render(): TemplateResult;
    protected methodTemplate(scheme: IApiParametrizedSecurityScheme, type: string): TemplateResult | string;
    /**
     * Renders a template for Basic authorization.
     */
    protected basicAuthTemplate(security: IApiParametrizedSecurityScheme): TemplateResult;
    /**
     * Renders a template for Digest authorization.
     */
    protected digestAuthTemplate(): TemplateResult;
    /**
     * Renders a template for Pass through authorization.
     */
    protected passThroughAuthTemplate(security: IApiParametrizedSecurityScheme): TemplateResult;
    /**
     * Renders a template for RAML custom authorization.
     */
    protected ramlCustomAuthTemplate(security: IApiParametrizedSecurityScheme): TemplateResult;
    /**
     * Renders a template for Bearer authorization (OAS).
     */
    protected bearerAuthTemplate(security: IApiParametrizedSecurityScheme): TemplateResult;
    /**
     * Renders a template for OAuth 1 authorization.
     */
    protected oa1AuthTemplate(): TemplateResult;
    /**
     * Renders a template for OAuth 2 authorization.
     */
    protected oa2AuthTemplate(security: IApiParametrizedSecurityScheme): TemplateResult;
    /**
     * Renders a template for OAuth 2 authorization.
     */
    protected openIdConnectTemplate(security: IApiParametrizedSecurityScheme): TemplateResult;
    /**
     * Renders a template for Api Keys authorization.
     */
    protected apiKeyTemplate(security: IApiParametrizedSecurityScheme): TemplateResult;
}
//# sourceMappingURL=ApiAuthorizationEditor.element.d.ts.map