import { OlmMachine, HistoryVisibility as RustHistoryVisibility } from "@matrix-org/matrix-sdk-crypto-wasm";
import { IContent, MatrixEvent } from "../models/event";
import { Room } from "../models/room";
import { KeyClaimManager } from "./KeyClaimManager";
import { RoomMember } from "../models/room-member";
import { HistoryVisibility } from "../@types/partials";
import { OutgoingRequestsManager } from "./OutgoingRequestsManager";
/**
 * RoomEncryptor: responsible for encrypting messages to a given room
 *
 * @internal
 */
export declare class RoomEncryptor {
    private readonly olmMachine;
    private readonly keyClaimManager;
    private readonly outgoingRequestManager;
    private readonly room;
    private encryptionSettings;
    private readonly prefixedLogger;
    /** whether the room members have been loaded and tracked for the first time */
    private lazyLoadedMembersResolved;
    /**
     * @param olmMachine - The rust-sdk's OlmMachine
     * @param keyClaimManager - Our KeyClaimManager, which manages the queue of one-time-key claim requests
     * @param outgoingRequestManager - The OutgoingRequestManager, which manages the queue of outgoing requests.
     * @param room - The room we want to encrypt for
     * @param encryptionSettings - body of the m.room.encryption event currently in force in this room
     */
    constructor(olmMachine: OlmMachine, keyClaimManager: KeyClaimManager, outgoingRequestManager: OutgoingRequestsManager, room: Room, encryptionSettings: IContent);
    /**
     * Handle a new `m.room.encryption` event in this room
     *
     * @param config - The content of the encryption event
     */
    onCryptoEvent(config: IContent): void;
    /**
     * Handle a new `m.room.member` event in this room
     *
     * @param member - new membership state
     */
    onRoomMembership(member: RoomMember): void;
    /**
     * Prepare to encrypt events in this room.
     *
     * This ensures that we have a megolm session ready to use and that we have shared its key with all the devices
     * in the room.
     *
     * @param globalBlacklistUnverifiedDevices - When `true`, it will not send encrypted messages to unverified devices
     */
    ensureEncryptionSession(globalBlacklistUnverifiedDevices: boolean): Promise<void>;
    /**
     * Discard any existing group session for this room
     */
    forceDiscardSession(): Promise<void>;
    /**
     * Encrypt an event for this room
     *
     * This will ensure that we have a megolm session for this room, share it with the devices in the room, and
     * then encrypt the event using the session.
     *
     * @param event - Event to be encrypted.
     * @param globalBlacklistUnverifiedDevices - When `true`, it will not send encrypted messages to unverified devices
     */
    encryptEvent(event: MatrixEvent, globalBlacklistUnverifiedDevices: boolean): Promise<void>;
}
/**
 * Convert a HistoryVisibility to a RustHistoryVisibility
 * @param visibility - HistoryVisibility enum
 * @returns a RustHistoryVisibility enum
 */
export declare function toRustHistoryVisibility(visibility: HistoryVisibility): RustHistoryVisibility;
//# sourceMappingURL=RoomEncryptor.d.ts.map