wingkwong / react-quiz-component

:orange_book: React Quiz Component
https://wingkwong.github.io/react-quiz-component/
MIT License
376 stars 147 forks source link

Types file #352

Open julix-unity opened 1 week ago

julix-unity commented 1 week ago

Adding Types file as lib/react-quiz-component.d.ts and target in package.json

Closes https://github.com/wingkwong/react-quiz-component/issues/273

Credit to @d3vAdv3ntur3s for the writing of initial type file.

julix-unity commented 1 week ago

@wingkwong do you know if there's a good way to test that this works as expected before merging? -- also how would you feel about a bigger change that converts the project to TypeScript fully?

julix-unity commented 1 week ago

Force pushed to use index.d.ts in dist folder instead.

wingkwong commented 1 week ago

dist should be generated. I think this file should be gone after build?

julix-unity commented 1 week ago

dist should be generated. I think this file should be gone after build?

It's only generated if the project is in typescript and the right tsconfig settings are there. How would it auto generate the file if it doesn't have types in main files?