Skip to content

Commit 35a9628

Browse files
fix: apply RequestMethod|string discoverability hint to public removeRequestHandler/removeNotificationHandler/assertCanSetRequestHandler
1 parent d49a02b commit 35a9628

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/core/src/shared/protocol.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,14 +1126,14 @@ export abstract class Protocol<ContextT extends BaseContext> {
11261126
/**
11271127
* Removes the request handler for the given method.
11281128
*/
1129-
removeRequestHandler(method: string): void {
1129+
removeRequestHandler(method: RequestMethod | string): void {
11301130
this._requestHandlers.delete(method);
11311131
}
11321132

11331133
/**
11341134
* Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
11351135
*/
1136-
assertCanSetRequestHandler(method: string): void {
1136+
assertCanSetRequestHandler(method: RequestMethod | string): void {
11371137
if (this._requestHandlers.has(method)) {
11381138
throw new Error(`A request handler for ${method} already exists, which would be overridden`);
11391139
}
@@ -1192,7 +1192,7 @@ export abstract class Protocol<ContextT extends BaseContext> {
11921192
/**
11931193
* Removes the notification handler for the given method.
11941194
*/
1195-
removeNotificationHandler(method: string): void {
1195+
removeNotificationHandler(method: NotificationMethod | string): void {
11961196
this._notificationHandlers.delete(method);
11971197
}
11981198
}

0 commit comments

Comments
 (0)