/**
 * @license
 * Copyright 2018 JBoss Inc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { QueryList } from "@angular/core";
import { AaiDocument, OasDocument, SecurityScheme } from "apicurio-data-models";
import { EntityEditor, EntityEditorEvent, IEntityEditorHandler } from "./entity-editor.component";
import { Scope } from "../../_models/scope.model";
import { NgModel } from "@angular/forms";
export interface Flow {
    enabled: boolean;
    authorizationUrl: string;
    tokenUrl: string;
    refreshUrl: string;
    scopes: Scope[];
}
export interface Flows {
    implicit: Flow;
    password: Flow;
    clientCredentials: Flow;
    authorizationCode: Flow;
}
export interface SecuritySchemeData {
    schemeName: string;
    description: string;
    type: string;
    name: string;
    in: string;
    flow: string;
    authorizationUrl: string;
    tokenUrl: string;
    scopes: Scope[];
}
export interface SecurityScheme20Data extends SecuritySchemeData {
    flow: string;
    authorizationUrl: string;
    tokenUrl: string;
    scopes: Scope[];
}
export interface SecurityScheme30Data extends SecuritySchemeData {
    scheme: string;
    bearerFormat: string;
    openIdConnectUrl: string;
    flows: Flows;
}
export interface SecuritySchemeAai20Data extends SecuritySchemeData {
    scheme: string;
    bearerFormat: string;
    openIdConnectUrl: string;
    flows: Flows;
}
export interface SecuritySchemeEditorEvent extends EntityEditorEvent<SecurityScheme> {
    data: SecurityScheme20Data | SecurityScheme30Data | SecuritySchemeAai20Data;
}
export interface ISecuritySchemeEditorHandler extends IEntityEditorHandler<SecurityScheme, SecuritySchemeEditorEvent> {
    onSave(event: SecuritySchemeEditorEvent): void;
    onCancel(event: SecuritySchemeEditorEvent): void;
}
export declare class SecuritySchemeEditorComponent extends EntityEditor<SecurityScheme, SecuritySchemeEditorEvent> {
    nameInput: QueryList<NgModel>;
    oauthTab: string;
    model: SecuritySchemeData;
    schemeNames: string[];
    schemeExists: boolean;
    /**
     * Called to open the editor.
     * @param handler
     * @param context
     * @param server
     */
    open(handler: ISecuritySchemeEditorHandler, context: OasDocument | AaiDocument, scheme?: SecurityScheme): void;
    is2x(): boolean;
    is3x(): boolean;
    isAai2x(): boolean;
    /**
     * Initializes the editor's data model from a provided entity.
     * @param entity
     */
    initializeModelFromEntity(entity: SecurityScheme): void;
    /**
     * Initializes the editor's data model to an empty state.
     */
    initializeModel(): void;
    /**
     * Returns true if the data model is valid.
     */
    isValid(): boolean;
    /**
     * Creates an entity event specific to this entity editor.
     */
    entityEvent(): SecuritySchemeEditorEvent;
    protected initModel(scheme?: SecurityScheme): void;
    /**
     * Reads the flow information from the security scheme and copies it to the model.
     * @param scheme
     */
    private readFlows;
    /**
     * Reads flow information from the data model into the local UI model.
     * @param flowModel
     * @param flow
     */
    private readFlowInto;
    /**
     * Converts from OAS30 scopes to an array of scope objects.
     * @param scopes
     */
    private toScopesArray;
    /**
     * Sets the flow.
     * @param flow
     */
    setFlow(flow: string): void;
    /**
     * Returns true only if all the defined scopes are valid (have names).
     * @return
     */
    scopesAreValid(): boolean;
    /**
     * Sets the type.
     * @param type
     */
    setType(type: string): void;
    /**
     * Gets the 2.0 version of the data model.
     */
    model20(): SecurityScheme20Data;
    /**
     * Gets the 3.0 version of the data model.
     */
    model30(): SecurityScheme30Data;
    /**
     * Gets the Aai 2.0 version of the data model.
     */
    modelAai20(): SecuritySchemeAai20Data;
}
