How do I use the deno’s node compatibility mode with definitely typed modules? I tried this but that didn’t seem to work as intended.
/// <reference types='npm:@types/three' />
- I simply want the types available globally within my project
- I do not want three.js library included in my code, only types
>Solution :
As of Deno v1.26.1, TypeScript is not supported in Node compatibility mode. From the Node Compatibility Mode page in the manual:
TypeScript support
Currently, the compatibility mode does not support TypeScript.
In the upcoming releases we plan to add support for a
typesfield inpackage.json, to automatically lookup types and use them during type checking.In the long term, we’d like to provide ability to consume TypeScript code authored for the Node runtime.