From 57f7734f7f83a93ba23a382ff351591e0a9928db Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Wed, 5 Jul 2023 21:24:46 +0200 Subject: [PATCH] fix: add docs to sendMessage Signed-off-by: Tilman Vatteroth --- commons/src/message-transporters/message-transporter.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/commons/src/message-transporters/message-transporter.ts b/commons/src/message-transporters/message-transporter.ts index 0e3dbe032..b3112c985 100644 --- a/commons/src/message-transporters/message-transporter.ts +++ b/commons/src/message-transporters/message-transporter.ts @@ -34,6 +34,13 @@ export class MessageTransporter extends EventEmitter2 { private otherSideReady = false private readyInterval: NodeJS.Timer | undefined + /** + * Send a message to the other side using the currently set message transporter. + * + * @param content The complete message to send + * @throws Error if this or the other side are not ready yet and the message is not a READY_ANSWER or READY_REQUEST + * @throws Error if no transport adapter has been set + */ public sendMessage(content: Message): void { if (!this.isConnected()) { this.onDisconnecting()