import { MatrixClient } from "matrix-js-sdk/src/matrix";
import { AuthType, AuthDict, IInputs, IStageStatus } from "matrix-js-sdk/src/interactive-auth";
import React from "react";
import { LocalisedPolicy, Policies } from "../../../Terms";
import { AccessibleButtonKind } from "../elements/AccessibleButton";
export declare const DEFAULT_PHASE = 0;
interface IAuthEntryProps {
    matrixClient: MatrixClient;
    loginType: string;
    authSessionId?: string;
    errorText?: string;
    errorCode?: string;
    busy?: boolean;
    onPhaseChange: (phase: number) => void;
    submitAuthDict: (auth: AuthDict) => void;
    requestEmailToken?: () => Promise<void>;
    fail: (error: Error) => void;
    clientSecret: string;
    showContinue: boolean;
}
interface IPasswordAuthEntryState {
    password: string;
}
export declare class PasswordAuthEntry extends React.Component<IAuthEntryProps, IPasswordAuthEntryState> {
    static LOGIN_TYPE: AuthType;
    constructor(props: IAuthEntryProps);
    componentDidMount(): void;
    private onSubmit;
    private onPasswordFieldChange;
    render(): React.ReactNode;
}
interface IRecaptchaAuthEntryProps extends IAuthEntryProps {
    stageParams?: {
        public_key?: string;
    };
}
export declare class RecaptchaAuthEntry extends React.Component<IRecaptchaAuthEntryProps> {
    static LOGIN_TYPE: AuthType;
    componentDidMount(): void;
    private onCaptchaResponse;
    render(): React.ReactNode;
}
interface ITermsAuthEntryProps extends IAuthEntryProps {
    stageParams?: {
        policies?: Policies;
    };
}
interface LocalisedPolicyWithId extends LocalisedPolicy {
    id: string;
}
interface ITermsAuthEntryState {
    policies: LocalisedPolicyWithId[];
    toggledPolicies: {
        [policy: string]: boolean;
    };
    errorText?: string;
}
export declare class TermsAuthEntry extends React.Component<ITermsAuthEntryProps, ITermsAuthEntryState> {
    static LOGIN_TYPE: AuthType;
    constructor(props: ITermsAuthEntryProps);
    componentDidMount(): void;
    private togglePolicy;
    private trySubmit;
    render(): React.ReactNode;
}
interface IEmailIdentityAuthEntryProps extends IAuthEntryProps {
    inputs?: {
        emailAddress?: string;
    };
    stageState?: {
        emailSid?: string;
    };
}
interface IEmailIdentityAuthEntryState {
    requested: boolean;
    requesting: boolean;
}
export declare class EmailIdentityAuthEntry extends React.Component<IEmailIdentityAuthEntryProps, IEmailIdentityAuthEntryState> {
    static LOGIN_TYPE: AuthType;
    constructor(props: IEmailIdentityAuthEntryProps);
    componentDidMount(): void;
    render(): React.ReactNode;
}
interface IMsisdnAuthEntryProps extends IAuthEntryProps {
    inputs?: {
        phoneCountry?: string;
        phoneNumber?: string;
    };
}
interface IMsisdnAuthEntryState {
    token: string;
    requestingToken: boolean;
    errorText: string | null;
}
export declare class MsisdnAuthEntry extends React.Component<IMsisdnAuthEntryProps, IMsisdnAuthEntryState> {
    static LOGIN_TYPE: AuthType;
    private submitUrl?;
    private sid?;
    private msisdn?;
    constructor(props: IMsisdnAuthEntryProps);
    componentDidMount(): void;
    private requestMsisdnToken;
    private onTokenChange;
    private onFormSubmit;
    render(): React.ReactNode;
}
interface IRegistrationTokenAuthEntryState {
    registrationToken: string;
}
export declare class RegistrationTokenAuthEntry extends React.Component<IAuthEntryProps, IRegistrationTokenAuthEntryState> {
    static readonly LOGIN_TYPE = AuthType.RegistrationToken;
    constructor(props: IAuthEntryProps);
    componentDidMount(): void;
    private onSubmit;
    private onRegistrationTokenFieldChange;
    render(): React.ReactNode;
}
export type ContinueKind = Extract<AccessibleButtonKind, "primary" | "danger">;
interface ISSOAuthEntryProps extends IAuthEntryProps {
    continueText?: string;
    continueKind?: ContinueKind;
    onCancel?: () => void;
}
interface ISSOAuthEntryState {
    phase: number;
    attemptFailed: boolean;
}
export declare class SSOAuthEntry extends React.Component<ISSOAuthEntryProps, ISSOAuthEntryState> {
    static LOGIN_TYPE: AuthType;
    static UNSTABLE_LOGIN_TYPE: AuthType;
    static PHASE_PREAUTH: number;
    static PHASE_POSTAUTH: number;
    private ssoUrl;
    private popupWindow;
    constructor(props: ISSOAuthEntryProps);
    componentDidMount(): void;
    componentWillUnmount(): void;
    attemptFailed: () => void;
    private onReceiveMessage;
    private onStartAuthClick;
    private onConfirmClick;
    render(): React.ReactNode;
}
export declare class FallbackAuthEntry extends React.Component<IAuthEntryProps> {
    private popupWindow;
    private fallbackButton;
    constructor(props: IAuthEntryProps);
    componentDidMount(): void;
    componentWillUnmount(): void;
    focus: () => void;
    private onShowFallbackClick;
    private onReceiveMessage;
    render(): React.ReactNode;
}
export interface IStageComponentProps extends IAuthEntryProps {
    stageParams?: Record<string, any>;
    inputs?: IInputs;
    stageState?: IStageStatus;
    continueText?: string;
    continueKind?: ContinueKind;
    setEmailSid?(sid: string): void;
    onCancel?(): void;
    requestEmailToken?(): Promise<void>;
}
export interface IStageComponent extends React.ComponentClass<React.PropsWithRef<IStageComponentProps>> {
    attemptFailed?(): void;
    focus?(): void;
}
export default function getEntryComponentForLoginType(loginType: AuthType): IStageComponent;
export {};
