From d05eeac4465094232111f8c19713ee5371908bd4 Mon Sep 17 00:00:00 2001 From: WofWca Date: Tue, 16 Sep 2025 16:18:46 +0400 Subject: [PATCH] improvement: mark `_send` as `abstract`, add docs This should make it easier to understand the purpose of the class and how to work with it. --- typescript/client.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/typescript/client.ts b/typescript/client.ts index bee0f6f..50fda19 100644 --- a/typescript/client.ts +++ b/typescript/client.ts @@ -21,12 +21,14 @@ export abstract class BaseTransport { private _requests: RequestMap = new Map(); private _requestId = 0; - _send(_message: Message): void { - throw new Error("_send method not implemented"); - } + abstract _send(_message: Message): void close() {} + /** + * This must be invoked by the implementor of {@link BaseTransport}, + * on incoming messages. + */ protected _onmessage(message: Message): void { if ((message as Request).method) { const request = message as Request;