import * as RustSdkCryptoJs from "@matrix-org/matrix-sdk-crypto-js"; import type { IEventDecryptionResult, IMegolmSessionData } from "../@types/crypto"; import type { IToDeviceEvent } from "../sync-accumulator"; import type { IEncryptedEventInfo } from "../crypto/api"; import { MatrixEvent } from "../models/event"; import { Room } from "../models/room"; import { RoomMember } from "../models/room-member"; import { CryptoBackend, OnSyncCompletedData } from "../common-crypto/CryptoBackend"; import { IHttpOpts, MatrixHttpApi } from "../http-api"; import { DeviceTrustLevel, UserTrustLevel } from "../crypto/CrossSigning"; /** * An implementation of {@link CryptoBackend} using the Rust matrix-sdk-crypto. */ export declare class RustCrypto implements CryptoBackend { private readonly olmMachine; globalErrorOnUnknownDevices: boolean; /** whether {@link stop} has been called */ private stopped; /** whether {@link outgoingRequestLoop} is currently running */ private outgoingRequestLoopRunning; /** mapping of roomId → encryptor class */ private roomEncryptors; private keyClaimManager; private outgoingRequestProcessor; constructor(olmMachine: RustSdkCryptoJs.OlmMachine, http: MatrixHttpApi, _userId: string, _deviceId: string); stop(): void; encryptEvent(event: MatrixEvent, _room: Room): Promise; decryptEvent(event: MatrixEvent): Promise; getEventEncryptionInfo(event: MatrixEvent): IEncryptedEventInfo; checkUserTrust(userId: string): UserTrustLevel; checkDeviceTrust(userId: string, deviceId: string): DeviceTrustLevel; globalBlacklistUnverifiedDevices: boolean; userHasCrossSigningKeys(): Promise; prepareToEncrypt(room: Room): void; forceDiscardSession(roomId: string): Promise; exportRoomKeys(): Promise; /** * Apply sync changes to the olm machine * @param events - the received to-device messages * @param oneTimeKeysCounts - the received one time key counts * @param unusedFallbackKeys - the received unused fallback keys * @returns A list of preprocessed to-device messages. */ private receiveSyncChanges; /** called by the sync loop to preprocess incoming to-device messages * * @param events - the received to-device messages * @returns A list of preprocessed to-device messages. */ preprocessToDeviceMessages(events: IToDeviceEvent[]): Promise; /** called by the sync loop to preprocess one time key counts * * @param oneTimeKeysCounts - the received one time key counts * @returns A list of preprocessed to-device messages. */ preprocessOneTimeKeyCounts(oneTimeKeysCounts: Map): Promise; /** called by the sync loop to preprocess unused fallback keys * * @param unusedFallbackKeys - the received unused fallback keys * @returns A list of preprocessed to-device messages. */ preprocessUnusedFallbackKeys(unusedFallbackKeys: Set): Promise; /** called by the sync loop on m.room.encrypted events * * @param room - in which the event was received * @param event - encryption event to be processed */ onCryptoEvent(room: Room, event: MatrixEvent): Promise; /** called by the sync loop after processing each sync. * * TODO: figure out something equivalent for sliding sync. * * @param syncState - information on the completed sync. */ onSyncCompleted(syncState: OnSyncCompletedData): void; /** called by the MatrixClient on a room membership event * * @param event - The matrix event which caused this event to fire. * @param member - The member whose RoomMember.membership changed. * @param oldMembership - The previous membership state. Null if it's a new member. */ onRoomMembership(event: MatrixEvent, member: RoomMember, oldMembership?: string): void; private outgoingRequestLoop; } //# sourceMappingURL=rust-crypto.d.ts.map