matrix-js-sdk
Version:
Matrix Client-Server SDK for Javascript
43 lines • 1.66 kB
TypeScript
import { OlmMachine, PutDehydratedDeviceRequest, UploadSigningKeysRequest } from "@matrix-org/matrix-sdk-crypto-wasm";
import { IHttpOpts, MatrixHttpApi } from "../http-api";
import { UIAuthCallback } from "../interactive-auth";
/**
* Common interface for all the request types returned by `OlmMachine.outgoingRequests`.
*
* @internal
*/
export interface OutgoingRequest {
readonly id: string | undefined;
readonly type: number;
}
/**
* OutgoingRequestManager: turns `OutgoingRequest`s from the rust sdk into HTTP requests
*
* We have one of these per `RustCrypto` (and hence per `MatrixClient`), not that it does anything terribly complicated.
* It's responsible for:
*
* * holding the reference to the `MatrixHttpApi`
* * turning `OutgoingRequest`s from the rust backend into HTTP requests, and sending them
* * sending the results of such requests back to the rust backend.
*
* @internal
*/
export declare class OutgoingRequestProcessor {
private readonly olmMachine;
private readonly http;
constructor(olmMachine: OlmMachine, http: MatrixHttpApi<IHttpOpts & {
onlyData: true;
}>);
makeOutgoingRequest<T>(msg: OutgoingRequest | UploadSigningKeysRequest | PutDehydratedDeviceRequest, uiaCallback?: UIAuthCallback<T>): Promise<void>;
/**
* Send the HTTP request for a `ToDeviceRequest`
*
* @param request - request to send
* @returns JSON-serialized body of the response, if successful
*/
private sendToDeviceRequest;
private makeRequestWithUIA;
private requestWithRetry;
private rawJsonRequest;
}
//# sourceMappingURL=OutgoingRequestProcessor.d.ts.map