Background
I have created a component library using react (plain js). I am in the process of creating Typescript definitions for the components so that consumers of the component library can use the components in a type-safe manner in their Typescript applications.
Question
What is the recommended way, if there is one, to check that the definitions manually created are correct? I am trying to catch issues before consumers have to highlighting any problems.
Investigation so far...
I have looked at https://github.com/asgerf/tscheck but it doesn't always work.
I also looked at DefinitelyTyped contribution guide: https://github.com/DefinitelyTyped/DefinitelyTyped#create-a-new-package. This says to create a typescript file with sample code for type-checking only...is this just a matter of compiling the *.test.ts
file with the typescript compiler?
.d.ts
files? – Gradin.d.ts
file I believe to be correct. Is there a way to confirm that what I think is correct is in fact correct...From your answer it appears that I need to write some typescript that uses the definitions – Jarv