Search Terms
package json types field types types module
Suggestion
Allow libraries written in JavaScript to be able to declare that they have types in DT (or other modules), and that they support a certain version of it.
For example:
Express does not support TypeScript but trusts that the DefinitelyTyped express maintainers know what they are doing generally. They want to declare that DT is the way for TypeScript users to get types out of the box. Today that's not really possible.
Examples
Two potential routes:
-
Override the "types" parameter to support: "types": "@types/express:^3.0" in a package.json
-
Recommend a new field in the package.json: "typesModule": "@types/express:^3.0" - then when TypeScript normally offers a 'no types found', then it can offer the command to install with the correct semver range.
Checklist
My suggestion meets these guidelines:
/cc @wesleytodd @isaacs @ljharb
Search Terms
package json types field types types module
Suggestion
Allow libraries written in JavaScript to be able to declare that they have types in DT (or other modules), and that they support a certain version of it.
For example:
Express does not support TypeScript but trusts that the DefinitelyTyped express maintainers know what they are doing generally. They want to declare that DT is the way for TypeScript users to get types out of the box. Today that's not really possible.
Examples
Two potential routes:
Override the "types" parameter to support:
"types": "@types/express:^3.0"in a package.jsonRecommend a new field in the package.json:
"typesModule": "@types/express:^3.0"- then when TypeScript normally offers a 'no types found', then it can offer the command to install with the correct semver range.Checklist
My suggestion meets these guidelines:
/cc @wesleytodd @isaacs @ljharb