import { nothing, PropertyValues, TemplateResult } from 'lit';
import '@github/relative-time-element';
import type { IOauth2GrantType, IOauth2ResponseType, IOidcAuthorization, IOidcTokenError, IOidcTokenInfo } from '@api-client/core/models/Authorization.js';
import type { IOpenIdProviderMetadata } from '@api-client/core/authorization/types.js';
import OAuth2Authorization from './OAuth2Authorization.js';
import '../../../md/icons/ui-icon.js';
import '../../../md/button/ui-button.js';
export declare const GrantLabels: Record<string, string>;
export declare const ResponseTypeLabels: Record<string, string>;
export declare const discoveryCache: Map<string, IOpenIdProviderMetadata>;
/**
 * @returns The default grant types for OIDC
 */
export declare const defaultGrantTypes: IOauth2GrantType[];
export default class OidcAuthorization extends OAuth2Authorization {
    accessor discovered: boolean;
    /**
     * The index of the response from the `supportedResponses`.
     * By default it selects the first one.
     */
    accessor selectedResponse: number | undefined;
    /**
     * @returns True when the current `grantType` can support redirect URI.
     */
    get hasRedirectUri(): boolean;
    get config(): IOidcAuthorization;
    protected update(cp: PropertyValues<void>): void;
    /**
     * Serialized input values
     * @returns An object with user input
     */
    serialize(): IOidcAuthorization;
    authorize(): Promise<null>;
    readTokenLabel(token: IOidcTokenInfo | IOidcTokenError): string;
    readTokenValue(token: IOidcTokenInfo): string;
    updateIssuerUri(value?: string): void;
    /**
     * Downloads the OIDC info and pre-populates the form inputs.
     */
    discover(): Promise<void>;
    /**
     * Constructs the OIDC discovery URL.
     * @param baseUri The issues URI.
     */
    protected buildIssuerUrl(baseUri: string): string;
    /**
     * Requests the data from the discovery endpoint.
     */
    protected transportDiscovery(url: string): Promise<IOpenIdProviderMetadata | undefined>;
    propagateOidc(meta: IOpenIdProviderMetadata): void;
    protected translateGrantTypesMeta(types: string[]): IOauth2GrantType[];
    /**
     * This generates a 2-dimensional array with the response codes
     * supported by the authorization server. Next to the grant type
     * it describes how token is received by the
     */
    protected translateResponseCodes(codes: string[]): IOauth2ResponseType[][];
    /**
     * Sets the `discovered` flag depending on the current configuration.
     */
    protected detectDiscovered(): void;
    /**
     * A function called from the auth element `updated` lifecycle method.
     * It tries to figure out the `selectedResponse` from the current list of
     * `supportedResponses` and the `responseType`.
     */
    protected detectSelectedResponseType(): void;
    selectResponseType(index: number): void;
    protected handleIssuerUri(e: Event): void;
    protected handleIssuerRead(): void;
    protected handleResponseTypeSelect(e: CustomEvent): void;
    protected handleTokenInUse(e: Event): void;
    protected renderEditor(): TemplateResult | typeof nothing;
    protected renderIssuerInput(): TemplateResult;
    protected renderFormContent(): (typeof nothing | TemplateResult)[];
    /**
     * @returns The template for the response types drop down.
     */
    protected renderResponses(): TemplateResult | typeof nothing;
    /**
     * @param item The responses list to render as a single item.
     * @returns The template for the response types drop down item.
     */
    protected renderResponseItem(item: IOauth2ResponseType[], index: number): TemplateResult | string;
    protected renderAuthAction(): TemplateResult | typeof nothing;
    protected renderOAuth2Token(): TemplateResult | typeof nothing;
    protected renderToken(token: IOidcTokenInfo | IOidcTokenError, index: number): TemplateResult;
    protected renderErrorToken(token: IOidcTokenError): TemplateResult;
    protected renderInfoToken(token: IOidcTokenInfo, index: number): TemplateResult;
    protected renderTokenExpiration(token: IOidcTokenInfo): TemplateResult | string;
    protected renderOAth2Authorize(): TemplateResult | typeof nothing;
}
//# sourceMappingURL=OidcAuthorization.d.ts.map