openai / openai-realtime-api-beta

Node.js + JavaScript reference client for the Realtime API (beta)
MIT License
616 stars 133 forks source link

TypeScript error trying to consume package from node.js. EventHandlerCallbackType not defined #3

Open Stevenic opened 1 month ago

Stevenic commented 1 month ago

Trying to use the package server side with TypeScript results in a compiler error because EventHandlerCallbackType isn't defined in event_handler.d.ts. I can see the definition in the code but that's not making it into the d.ts file so you can't even reference the package from a TypeScript project without an error.

Stevenic commented 1 month ago

To work around the issue I had to manually add the definition to the top of the .d.ts file in the distribution:

image