import { CrossSigningBootstrapRequests, OlmMachine, SignatureUploadRequest, ToDeviceRequest } from "@ixo/matrix-sdk-crypto-nodejs"; import * as AsyncLock from "async-lock"; import { MatrixClient } from "../MatrixClient"; import { ICryptoRoomInformation } from "./ICryptoRoomInformation"; import { BackupManager } from "./BackupManager"; /** * @internal */ export declare const SYNC_LOCK_NAME = "sync"; /** * @internal */ export declare class RustEngine { readonly machine: OlmMachine; private client; readonly lock: AsyncLock; backupManager: BackupManager | null; constructor(machine: OlmMachine, client: MatrixClient); /** * Set the backup manager for handling key backup requests. */ setBackupManager(manager: BackupManager): void; run(): Promise; private runOnly; addTrackedUsers(userIds: string[]): Promise; /** * Force a fresh /keys/query for the given users, without waiting for the * device tracker to consider them outdated. Used to get an up-to-date view * of a user's devices and cross-signing identity before sharing or * accepting an MSC4268 room key bundle. */ forceKeysQueryForUsers(userIds: string[]): Promise; /** * Fetch a fresh device list for the given users and establish Olm sessions * with any of their devices we do not have a session with yet. */ ensureSessionsForUsers(userIds: string[]): Promise; /** * Upload a signature request (e.g. produced by importing cross-signing * secrets, which self-signs the device). */ uploadSignatures(request: SignatureUploadRequest): Promise; /** * Send a batch of to-device requests produced by the OlmMachine (outside of * the outgoingRequests loop), marking each as sent. */ sendToDeviceRequests(requests: ToDeviceRequest[]): Promise; /** * Upload the cross-signing keys produced by `OlmMachine.bootstrapCrossSigning`. * * The signing-keys request has no request ID and must not be marked as sent; * the device-keys and signatures requests go through the normal processors. */ processCrossSigningBootstrapRequests(requests: CrossSigningBootstrapRequests): Promise; prepareEncrypt(roomId: string, roomInfo: ICryptoRoomInformation): Promise; private processKeysClaimRequest; private processKeysUploadRequest; private processKeysQueryRequest; private processToDeviceRequest; private actuallyProcessToDeviceRequest; private processSignatureUploadRequest; private processKeysBackupRequest; }