import { MessageSendingStatus, QualifiedUserClients } from '@wireapp/api-client/lib/conversation'; import { QualifiedId, QualifiedUserPreKeyBundleMap } from '@wireapp/api-client/lib/user'; import { APIClient } from '@wireapp/api-client'; import type { ProteusService } from '../../messagingProtocols/proteus'; export declare class MessageService { private readonly apiClient; private readonly proteusService; constructor(apiClient: APIClient, proteusService: ProteusService); /** * Sends a message to a federated backend. * * @param sendingClientId The clientId of the current user * @param recipients The list of recipients to send the message to * @param plainText The plainText data to send * @param options.conversationId? the conversation to send the message to. Will broadcast if not set * @param options.reportMissing? trigger a mismatch error when there are missing recipients in the payload * @param options.sendAsProtobuf? * @param options.onClientMismatch? Called when a mismatch happens on the server * @return the MessageSendingStatus returned by the backend */ sendMessage(sendingClientId: string, recipients: QualifiedUserClients | QualifiedUserPreKeyBundleMap, plainText: Uint8Array, options?: { assetData?: Uint8Array; conversationId?: QualifiedId; reportMissing?: boolean | QualifiedId[]; nativePush?: boolean; onClientMismatch?: (mismatch: MessageSendingStatus) => void | boolean | Promise; }): Promise; private sendOtrMessage; private isClientMismatchError; /** * Will re-encrypt a message when there were some missing clients in the initial send (typically when the server replies with a client mismatch error) * * @param {ProtobufOTR.QualifiedNewOtrMessage} messageData The initial message that was sent * @param {MessageSendingStatus} messageSendingStatus Info about the missing/deleted clients * @param {Uint8Array} plainText The text that should be encrypted for the missing clients * @return resolves with a new message payload that can be sent */ private reencryptAfterMismatch; } //# sourceMappingURL=MessageService.d.ts.map