claus / storyblok-rich-text-react-renderer

A React renderer for Storyblok rich text content
MIT License
87 stars 16 forks source link

Add index.d.ts #9

Closed TGlide closed 2 years ago

TGlide commented 3 years ago

Description

To address the request in #4 and the issues in #5, I've created this simple PR that adds an index.d.ts file, giving this project typescript support while maintaining its existing codebase. I've tested this with a project of mine, and the types seem to work well, but please feel free to discuss any possible improvements.

I hope that this is helpful to the project 😃

claus commented 2 years ago

Thanks a lot, @TGlide! Does index.d.ts have to be referenced in package.json?

TGlide commented 2 years ago

Thanks a lot, @TGlide! Does index.d.ts have to be referenced in package.json?

While it worked for me without adding it to package.json, upon looking at the Typescript documentation, it seems that indeed it is necessary. I've already committed the changes to package.json to reflect this.