andrewf
Recommended Typescript definitions for Phoenix Javascript library
Hi, I’m relatively new to Phoenix and Typescript, and ran into a problem. The type definitions installed in the “@types/phoenix” npm package (GitHub - DefinitelyTyped/DefinitelyTyped: The repository for high quality TypeScript type definitions. · GitHub) don’t include the “params” property on the Channel object. I kind of need that property, but when I use it Typescript throws a bunch of errors.
What’s the recommended approach for using Phoenix’s JS library from Typescript? Is there a different type definition package I should use, or do most people just copy type definitions from somewhere else into their own code? Is there another approach I don’t see?
Thanks! As I said, I’m new to this ecosystem, so if I missed some documentation go ahead and just link it.
Marked As Solved
John-Goff
If the types in this package are wrong, please submit a PR! I’ve done so myself in the past and it’s not terribly hard to do, and it’ll get accepted pretty fast.
To answer your question though, no I am not aware of any other typescript types for Phoenix.








