import ManagementRoomOutput from "../managementroom/ManagementRoomOutput";
import { MatrixSendClient } from "matrix-protection-suite-for-matrix-bot-sdk";
import { RoomUpdateError } from "matrix-protection-suite";
import { StringRoomID, StringUserID } from "@the-draupnir-project/matrix-basic-types";
export interface QueuedRedaction {
    /** The room which the redaction will take place in. */
    readonly roomID: StringRoomID;
    /**
     * Carry out the redaction.
     * Called by the EventRedactionQueue.
     * @param client A MatrixClient to use to carry out the redaction.
     */
    redact(client: MatrixSendClient, managementRoom: ManagementRoomOutput): Promise<void>;
    /**
     * Used to test whether the redaction is the equivalent to another redaction.
     * @param redaction Another QueuedRedaction to test if this redaction is an equivalent to.
     */
    redactionEqual(redaction: QueuedRedaction): boolean;
}
/**
 * Redacts all of the messages a user has sent to one room.
 */
export declare class RedactUserInRoom implements QueuedRedaction {
    readonly userID: StringUserID;
    readonly roomID: StringRoomID;
    constructor(userID: StringUserID, roomID: StringRoomID);
    redact(client: MatrixSendClient, managementRoom: ManagementRoomOutput): Promise<void>;
    redactionEqual(redaction: QueuedRedaction): boolean;
}
/**
 * This is a queue for events so that other protections can happen first (e.g. applying room bans to every room).
 */
export declare class EventRedactionQueue {
    /**
     * This map is indexed by roomId and its values are a list of redactions waiting to be processed for that room.
     */
    private toRedact;
    /**
     * Test whether the redaction is already present in the queue.
     * @param redaction a QueuedRedaction.
     * @returns True if the queue already has the redaction, false otherwise.
     */
    has(redaction: QueuedRedaction): boolean;
    /**
     * Adds a `QueuedRedaction` to the queue. It will be processed when `process` is called.
     * @param redaction A `QueuedRedaction` to await processing
     * @returns `true` if the redaction was added to the queue, `false` if it is a duplicate of a redaction already present in the queue.
     */
    add(redaction: QueuedRedaction): boolean;
    /**
     * Process the redaction queue, carrying out the action of each `QueuedRedaction` in sequence.
     * If a redaction cannot be processed, the redaction is skipped and removed from the queue.
     * We then carry on processing the next redactions.
     * The reason we skip is at the moment is that we would have to think about all of the situations
     * where we would not want failures to try again (e.g. messages were already redacted) and handle them explicitly.
     * @param client The matrix client to use for processing redactions.
     * @param limitToRoomId If the roomId is provided, only redactions for that room will be processed.
     * @returns A description of any errors encountered by each QueuedRedaction that was processed.
     */
    process(client: MatrixSendClient, managementRoom: ManagementRoomOutput, limitToRoomID?: StringRoomID): Promise<RoomUpdateError[]>;
}
//# sourceMappingURL=EventRedactionQueue.d.ts.map