fix: add | undefined to transport option callbacks for exactOptionalPropertyTypes (#1855)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4fbcfcd176
commit
2c0c481cb9
1 changed files with 14 additions and 7 deletions
7
.changeset/gentle-planets-rest.md
Normal file
7
.changeset/gentle-planets-rest.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
'@modelcontextprotocol/server': patch
|
||||
---
|
||||
|
||||
Add `| undefined` to optional callback and function properties on `WebStandardStreamableHTTPServerTransportOptions` (`sessionIdGenerator`, `onsessioninitialized`, `onsessionclosed`) and corresponding private fields.
|
||||
|
||||
This fixes TS2430 errors for consumers using `exactOptionalPropertyTypes: true` without `skipLibCheck`, where optional properties with function types need explicit `| undefined` to match their emitted declarations.
|
||||
Loading…
Reference in a new issue