buttercms-js icon indicating copy to clipboard operation
buttercms-js copied to clipboard

Improve typings

Open jackdomleo7 opened this issue 1 year ago • 0 comments

Hi, would you consider improving the TypeScript for the methods included in this package?

I am a user of Butter CMS and understand the API relatively well and noticed that the TypeScript could be massively improved for better DX. We have been using these types locally in our various projects and haven't had any issues for the past few months.

I have thoroughly read the README for this package and the official API documentation to help me create these types.

There is nothing in here that is specific to my/our needs, it should all be ok for anyone using this package to use.

If you have any questions, please reach out.

I have done as much testing as I can to try and find any faults with these types, but could use more eyes on it to test the types out.

I have not edited the names of any existing types.


I was wondering if the data property in Butter.Response has to be optional? What cases will data ever be undefined?


If you're happy with this PR, then I feel the README may need updating to better reflect the TypeScript support.

jackdomleo7 avatar Aug 26 '22 15:08 jackdomleo7