Where are Automatic Type Acquisition typescript definition files saved?

冷暖自知 提交于 2021-01-27 14:34:34

问题


I'm in environment with blocked access to github, typing and I want to have enhanced intellisense in vscode.

To do so I suppose I need to copy cached typescript definitions from machine that does have it for various needed npm packages.

So question where I can find those cached ata ts files?


回答1:


Please consider an alternative, but here are the standard locations:

  • Mac: ~/Library/Caches/TypeScript
  • Windows: %LOCALAPPDATA%\Microsoft\TypeScript
  • Linux: ~/.cache/typescript/

As a better solution, if you cannot rely on automatic typings acquisition, you can manually manage type typings files. Here's some documentation information. For example:

$ npm install --save @types/express

This will download a copy of the express typings files to the normal node_modules folder your project. If you can't use npm, this is a much better place to copy files between.

Typings files are required to builds TypeScript projects, but are only used to enhance VSCode IntelliSense with JavaScript projects.

Hope that clears things up.



来源:https://stackoverflow.com/questions/40941447/where-are-automatic-type-acquisition-typescript-definition-files-saved

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!