Skip to content

fix(messaging): generate req/res types from handler exports in messaging.d.ts#1348

Open
ifeanyi-ugwu wants to merge 2 commits intoPlasmoHQ:mainfrom
ifeanyi-ugwu:main
Open

fix(messaging): generate req/res types from handler exports in messaging.d.ts#1348
ifeanyi-ugwu wants to merge 2 commits intoPlasmoHQ:mainfrom
ifeanyi-ugwu:main

Conversation

@ifeanyi-ugwu
Copy link

Closes #334

When a background message handler exports RequestBody and/or ResponseBody types, the generated .plasmo/messaging.d.ts now includes them in MessagesMetadata so callers get full type-safety without manual annotation.

sendToBackground, sendToBackgroundViaRelay, and usePort now infer body and return types from MessagesMetadata/PortsMetadata keyed on the message name, so calls resolve the correct types automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC] Messaging RequestBody and ResponseBody type export

1 participant