You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/shared/protocol.ts
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,8 @@ export type ProtocolOptions = {
28
28
/**
29
29
* Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.
30
30
*
31
+
* Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those.
32
+
*
31
33
* Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true.
32
34
*/
33
35
enforceStrictCapabilities?: boolean;
@@ -266,6 +268,15 @@ export abstract class Protocol<
266
268
method: SendRequestT["method"],
267
269
): void;
268
270
271
+
/**
272
+
* A method to check if a notification is supported by the local side, for the given method to be sent.
273
+
*
274
+
* This should be implemented by subclasses.
275
+
*/
276
+
protectedabstractassertNotificationCapability(
277
+
method: SendNotificationT["method"],
278
+
): void;
279
+
269
280
/**
270
281
* Sends a request and wait for a response, with optional progress notifications in the meantime (if supported by the server).
271
282
*
@@ -326,6 +337,8 @@ export abstract class Protocol<
0 commit comments