UNPKG

matrix-js-sdk

Version:
46 lines 2.84 kB
import { type MatrixClient } from "../matrix.ts"; import { type RendezvousFailureListener } from "./RendezvousFailureReason.ts"; import { MSC4108SignInWithQR } from "./MSC4108SignInWithQR.ts"; export * from "./MSC4108SignInWithQR.ts"; export type * from "./RendezvousChannel.ts"; export type * from "./RendezvousCode.ts"; export * from "./RendezvousError.ts"; export * from "./RendezvousFailureReason.ts"; export * from "./RendezvousIntent.ts"; export type * from "./RendezvousTransport.ts"; export * from "./transports/index.ts"; export * from "./channels/index.ts"; /** * Check if the homeserver that the client is connected to supports a variant of sign-in with QR that we can use. * * @param client the client to check for sign-in with QR support * @returns true if the homeserver that the client is connected to supports a variant of sign-in with QR that we can use, false otherwise. */ export declare function isSignInWithQRAvailable(client: MatrixClient): Promise<boolean>; /** * Start a linking flow from an existing authenticated client by generating a QR code that can be scanned by the new device. * The new device will then authenticate with the server and link itself to the same account as the existing client and * share the end-to-end encryption keys. * * @param client the existing client * @param onFailure callback for when the linking process fails * @param abortSignal an AbortSignal that can be used to cancel the linking process, * for example when the user cancels out of the flow. * This will unbind the {@link onFailure} callback and prevent any further steps in the flow from being executed. * @returns a promise that resolves to an instance of the linking flow */ export declare function linkNewDeviceByGeneratingQR(client: MatrixClient, onFailure: RendezvousFailureListener, abortSignal: AbortSignal): Promise<MSC4108SignInWithQR>; /** * Start a sign-in flow by generating a QR code that can be scanned by an existing authenticated client. * The existing client will then help complete the authentication of the new device and link it to the same account, * sharing the end-to-end encryption keys. * * @param tempClient temporary client used during the flow for the rendezvous channel * @param onFailure callback for when the sign-in process fails * @param abortSignal an AbortSignal that can be used to cancel the linking process, * for example when the user cancels out of the flow. * This will unbind the {@link onFailure} callback and prevent any further steps in the flow from being executed. * @returns a promise that resolves to an instance of the sign-in flow */ export declare function signInByGeneratingQR(tempClient: MatrixClient, onFailure: RendezvousFailureListener, abortSignal: AbortSignal): Promise<MSC4108SignInWithQR>; //# sourceMappingURL=index.d.ts.map