matrix-react-sdk
Version:
SDK for matrix.org using React
37 lines (36 loc) • 1.31 kB
TypeScript
import React from "react";
import { MatrixClient, UIAResponse } from "matrix-js-sdk/src/matrix";
import { AuthType } from "matrix-js-sdk/src/interactive-auth";
import { InteractiveAuthProps } from "../../structures/InteractiveAuth";
import { ContinueKind } from "../auth/InteractiveAuthEntryComponents";
type DialogAesthetics = Partial<{
[x in AuthType]: {
[x: number]: {
title: string;
body: string;
continueText: string;
continueKind: ContinueKind;
};
};
}>;
export interface InteractiveAuthDialogProps<T = unknown> extends Pick<InteractiveAuthProps<T>, "makeRequest" | "authData"> {
matrixClient: MatrixClient;
title?: string;
body?: string;
aestheticsForStagePhases?: DialogAesthetics;
onFinished(success?: boolean, result?: UIAResponse<T> | Error | null): void;
}
interface IState {
authError: Error | null;
uiaStage: AuthType | null;
uiaStagePhase: number | null;
}
export default class InteractiveAuthDialog<T> extends React.Component<InteractiveAuthDialogProps<T>, IState> {
constructor(props: InteractiveAuthDialogProps<T>);
private getDefaultDialogAesthetics;
private onAuthFinished;
private onUpdateStagePhase;
private onDismissClick;
render(): React.ReactNode;
}
export {};