-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
featureA new feature or a major change to an existing featureA new feature or a major change to an existing feature
Description
Proposal
As more projects integrate Typescript, it would be nice if the @synapsestudios/fetch-client provided types so that developers can get type safety and intellisense on the inputs and outputs of the client methods.
What should be typed?
- all client method arguments (including options) and return types.
- the
client.addPluginmethod. We should also export aClientPlugintype so developers can build against that interface. - the client itself should have a type. It should take type parameters in such a way that we can properly expose helper methods that the developer expects to be accessible on the client.
How do we do this?
There are a few possible options
- Re-write the library in TypeScript
- Create Typescript declaration files that live alongside our JavaScript
Option 1 is the most work, but provides a better guarantee that the types provided by the library are correct. Option 2 is less work, but there is more risk that declared types will not be correct.
Metadata
Metadata
Assignees
Labels
featureA new feature or a major change to an existing featureA new feature or a major change to an existing feature