import React from "react";
import { MSC3906Rendezvous, RendezvousFailureReason } from "matrix-js-sdk/src/rendezvous";
import { MatrixClient } from "matrix-js-sdk/src/matrix";
/**
 * The intention of this enum is to have a mode that scans a QR code instead of generating one.
 */
export declare enum Mode {
    /**
     * A QR code with be generated and shown
     */
    Show = "show"
}
export declare enum Phase {
    Loading = 0,
    ShowingQR = 1,
    Connecting = 2,
    Connected = 3,
    WaitingForDevice = 4,
    Verifying = 5,
    Error = 6
}
export declare enum Click {
    Cancel = 0,
    Decline = 1,
    Approve = 2,
    TryAgain = 3,
    Back = 4
}
interface IProps {
    client: MatrixClient;
    mode: Mode;
    onFinished(...args: any): void;
}
interface IState {
    phase: Phase;
    rendezvous?: MSC3906Rendezvous;
    confirmationDigits?: string;
    failureReason?: FailureReason;
    mediaPermissionError?: boolean;
}
export declare enum LoginWithQRFailureReason {
    RateLimited = "rate_limited"
}
export type FailureReason = RendezvousFailureReason | LoginWithQRFailureReason;
/**
 * A component that allows sign in and E2EE set up with a QR code.
 *
 * It implements `login.reciprocate` capabilities and showing QR codes.
 *
 * This uses the unstable feature of MSC3906: https://github.com/matrix-org/matrix-spec-proposals/pull/3906
 */
export default class LoginWithQR extends React.Component<IProps, IState> {
    constructor(props: IProps);
    componentDidMount(): void;
    componentDidUpdate(prevProps: Readonly<IProps>): void;
    private updateMode;
    componentWillUnmount(): void;
    private approveLogin;
    private generateCode;
    private onFailure;
    reset(): void;
    private onClick;
    render(): React.ReactNode;
}
export {};
