/** * Ensures sticky events with the same room, event type and sticky key are sent in the order * they were queued and at least 1 millisecond apart. Otherwise both events could get the same * `origin_server_ts` which would make them tie break on event ID in the ephemeral sticky map. */ export declare class StickyEventSendQueue { /** * The latest send per room, event type and sticky key, resolving to when it completed. * The map key is the JSON serialization of [roomId, eventType, stickyKey]. */ private readonly latestSends; /** * Queues a send behind earlier sends with the same room, event type and sticky key. * * Call this before doing anything asynchronous, so that concurrent sends go out in the order * they were queued. * * @param roomId - The room the event is sent to. * @param eventType - The type of the event. * @param stickyKey - The sticky key of the event. Events without a sticky key are sent right away. * @param send - Sends the event. * @returns The result of `send`. */ enqueue(roomId: string, eventType: string, stickyKey: string | undefined, send: () => Promise): Promise; } //# sourceMappingURL=StickyEventSendQueue.d.ts.map