import type { IOAuth2Authorization, IOauth2GrantType, ITokenInfo } from '@api-client/core/models/Authorization.js';
import type { OAuth2DeliveryMethod } from '@api-client/core/models/Authorization.js';
import { nothing, TemplateResult } from 'lit';
import { CredentialsInfo, Oauth2Credentials } from '../types.js';
import { Authorization } from './Authorization.js';
import { SupportedInputTypes } from '../../../types/input.js';
import '../../../md/button/ui-button.js';
import '../../../md/text-field/ui-filled-text-field.js';
import '../../../md/list/ui-list.js';
import '../../../md/list/ui-list-item.js';
import '../../../md/dropdown-list/ui-dropdown-list.js';
import '../../../md/icon-button/ui-icon-button.js';
import '../../../md/checkbox/ui-checkbox.js';
import '../../../md/icons/ui-icon.js';
/**
 * List of OAuth 2.0 default response types.
 * This list can be extended by custom grants
 *
 * @returns List of objects with `type` and `label` properties.
 */
export declare const oauth2GrantTypes: IOauth2GrantType[];
export default class OAuth2Authorization extends Authorization {
    get config(): IOAuth2Authorization;
    /**
     * @return Computed value, true if the response type is a custom definition.
     */
    get isCustomGrantType(): boolean;
    /**
     * @returns true when the client id field is required.
     */
    get clientIdRequired(): boolean;
    /**
     * @returns true when the client id field is rendered.
     */
    get hasClientId(): boolean;
    /**
     * @returns true when the client secret field is rendered.
     */
    get hasClientSecret(): boolean;
    /**
     * @returns true when the client secret field is required.
     */
    get clientSecretRequired(): boolean;
    /**
     * @returns true when the authorization URI field is rendered.
     */
    get authorizationUriRendered(): boolean;
    /**
     * @returns true when the token URI field is rendered.
     */
    get accessTokenUriRendered(): boolean;
    /**
     * @returns true when the username and password fields are rendered.
     */
    get passwordRendered(): boolean;
    /**
     * @returns True when the current `grantType` can support redirect URI.
     */
    get hasRedirectUri(): boolean;
    /**
     * Currently available grant types.
     */
    accessor grantTypes: IOauth2GrantType[] | undefined;
    /**
     * The definition of client credentials to be rendered for a given grant type.
     * When set on the editor it renders a drop down where the user can choose from predefined
     * credentials (client id & secret).
     *
     */
    accessor credentialsSource: Oauth2Credentials[] | undefined;
    /**
     * Selected credential source
     */
    accessor credentialSource: string | undefined;
    /**
     * The default redirect URI to use if not define din the config.
     * @attribute
     */
    accessor defaultRedirectUri: string | undefined;
    accessor credentialsDisabled: boolean;
    /**
     * The base URI to use to construct the correct URLs to the authorization endpoints.
     *
     * When the paths are relative then base URI is added to the path.
     * Relative paths must start with '/'.
     *
     * Note, URL processing is happening internally in the component. The produced authorize event
     * will have base URI already applied.
     */
    accessor baseUri: string | undefined;
    /**
     * The error message returned by the authorization library.
     * It renders error dialog when an error ocurred.
     * It is automatically cleared when the user request the token again.
     */
    accessor lastErrorMessage: string | undefined;
    /**
     * When this property is set then the PKCE option is not rendered for the
     * `authorization_code`. This is mainly meant to be used by the `api-authorization-method`
     * to keep this control disabled and override generated settings when the API spec
     * says that the PKCE is supported.
     * @attribute
     */
    accessor noPkce: boolean;
    /**
     * If set, the response type selector is hidden from the UI.
     * @attribute
     */
    accessor noGrantType: boolean;
    /**
     * @returns The list of client credentials to render in the credentials selector.
     */
    listCredentials(): CredentialsInfo[];
    /**
     * Sets the client credentials after updating them from the credentials source selector.
     * @param clientId The client id to set on the editor.
     * @param clientSecret The client secret to set on the editor.
     * @param disabled Whether the credentials input is disabled.
     */
    updateCredentials(clientId: string, clientSecret: string, disabled: boolean): void;
    /**
     * This triggers change in the client id & secret of the editor after selecting
     * a credentials source by the user.
     *
     * @param selectedSource The name of the selected credentials source to select.
     */
    updateClientCredentials(selectedSource: string): void;
    /**
     * @returns true when a credentials source is being selected.
     */
    isSourceSelected(): boolean;
    /**
     * Adds a scope value. If the value has a comma then it is split.
     * @param scope The scope string to add.
     */
    addScope(scope: string): void;
    removeScope(index: number): void;
    /**
     * Selects a grant type. It has no effect when the type is already selected.
     * @param value The grant type value to use.
     */
    updateGrantType(value: string): void;
    /**
     * It does nothing when the value is already set.
     * @param value The credentials source to use
     */
    updateCredentialSource(value: string): void;
    updateClientId(value?: string): void;
    updateClientSecret(value?: string): void;
    updateAuthorizationUri(value?: string): void;
    updateAccessTokenUri(value?: string): void;
    updateUsername(value?: string): void;
    updatePassword(value?: string): void;
    updateDeliveryMethod(value: OAuth2DeliveryMethod): void;
    updatePkce(enabled: boolean): void;
    updateAssertion(value?: string): void;
    updateDeviceCode(value?: string): void;
    updateRedirectUri(value: string): void;
    /**
     * Serialized input values
     * @returns An object with user input
     */
    serialize(): IOAuth2Authorization;
    checkValidity(): boolean;
    authorize(): Promise<ITokenInfo | null>;
    protected handleGrantTypeSelect(e: CustomEvent): void;
    protected handleCredentialSource(e: CustomEvent): void;
    protected handleClientId(e: Event): void;
    protected handleClientSecret(e: Event): void;
    protected handleAuthorizationUri(e: Event): void;
    protected handleAccessTokenUri(e: Event): void;
    protected handleUsername(e: Event): void;
    protected handlePassword(e: Event): void;
    protected handleDeliveryMethod(e: CustomEvent): void;
    protected handlePkceChange(e: Event): void;
    protected handleAssertion(e: Event): void;
    protected handleDeviceCode(e: Event): void;
    /**
     * A handler for `focus` event on a label that contains text and
     * should be copied to clipboard when user is interacting with it.
     */
    protected handleClickCopy(e: Event): void;
    protected handlerCopyKeydown(e: KeyboardEvent): void;
    /**
     * Copies the content of the node to clipboard.
     */
    protected copyFromNode(node: HTMLElement): Promise<void>;
    protected handleRedirectUri(e: Event): void;
    protected handleScopeAdd(e: Event): void;
    protected handleScopeRemove(e: Event): void;
    render(): TemplateResult;
    protected renderEditor(): TemplateResult | typeof nothing;
    protected renderAuthAction(): TemplateResult | typeof nothing;
    protected renderError(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the OAuth 2 token value
     */
    protected renderOAuth2Token(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the "authorize" button.
     */
    protected renderOAth2Authorize(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the <form> content.
     */
    protected renderFormContent(): (TemplateResult | typeof nothing)[];
    /**
     * @return The template for API custom properties (annotations)
     */
    protected renderCustomProperties(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the OAuth 2 response type selector
     */
    protected renderGrantType(): TemplateResult | typeof nothing;
    /**
     * @return The template for the client credentials source.
     */
    protected renderCredentialsSource(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the OAuth 2 client id input.
     */
    protected renderClientId(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the OAuth 2 client secret input.
     */
    protected renderClientSecret(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the assertion (JWT) input, when needed.
     */
    protected renderAssertion(): TemplateResult | typeof nothing;
    /**
     * @return The template for the device code input, when needed.
     */
    protected renderDeviceCode(): TemplateResult | typeof nothing;
    /**
     * @param urlType The input type to render
     * @returns The template for the authorization URI input
     */
    protected renderAuthorizationUri(urlType: SupportedInputTypes): TemplateResult | typeof nothing;
    /**
     * @param urlType The input type to render
     * @returns The template for the access token URI input
     */
    protected renderAccessTokenUri(urlType: SupportedInputTypes): TemplateResult | typeof nothing;
    /**
     * @returns The template for the user name input
     */
    protected renderUsernameTemplate(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the user password input
     */
    protected renderPassword(): TemplateResult | typeof nothing;
    /**
     * For client_credentials grant this renders the dropdown with an option to select
     * where the credentials should be used. Current values:
     * - authorization header
     * - message body
     */
    protected renderParamsLocation(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the PKCE option of the OAuth 2 extension.
     */
    protected renderPkce(): TemplateResult | typeof nothing;
    /**
     * @returns The template for the OAuth 2 redirect URI label
     */
    protected renderRedirect(): TemplateResult | typeof nothing;
    protected renderScopes(): TemplateResult | typeof nothing;
    protected renderScopesList(scopes: string[]): TemplateResult | typeof nothing;
}
//# sourceMappingURL=OAuth2Authorization.d.ts.map