Can anyone explain the versioning behind TypeScript @types https://github.com/DefinitelyTyped/DefinitelyTyped
For example: I assumed that if I was using [email protected] then I would been to install @types/[email protected].
Howerver, this version does not exist. It get worse. for example, [email protected] and @types/[email protected]. What does that mean? What version is this targeting?
How, can I make sure that I'm installing the correct version of the Types for the library version?
What is a type in TypeScript. In TypeScript, a type is a convenient way to refer to the different properties and functions that a value has. A value is anything that you can assign to a variable e.g., a number, a string, an array, an object, and a function. When you look at this value, you can say that it's a string.
The @types npm organization is for obtaining type definitions with npm . Using these type definitions is a feature is coming in TypeScript 2.0. This will replace the current projects/tools such as typings and tsd, though these will continue to be supported for some time.
TypeScript contains types for standard libraries, such as the DOM. TypeScript uses these types when type checking code that interacts with these libraries. By default, the standard types that are checked depend on the target compilation option.
Unfortionaly it may be just a "doing it wrong" matter. Generally, It's a good practice to give the @types
version the same version of the library itself. But regarding the patch part of the semantic version, it will differ in most cases.
Possible causes why versions may differ:
@types
one hasn't.@types
library is not well maintained. @types
library has many bugs and patches.Nice to mention:
You can definitely contribute to any @types
library and help to keep it well versioned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With