自动类型获取打字稿定义文件在哪里保存? [英] Where are Automatic Type Acquisition typescript definition files saved?

查看:72
本文介绍了自动类型获取打字稿定义文件在哪里保存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我处于无法访问github的环境中,键入内容,并且我想在vscode中增强智能感知功能.

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

为此,我想我需要从具有用于各种所需npm软件包的计算机上复制缓存的打字稿定义.

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

所以我在哪里可以找到那些缓存的ata ts文件?

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

推荐答案

请考虑选择其他方法,但这是标准位置:

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

这将把快速打字文件的副本下载到项目的普通 node_modules 文件夹中.如果您不能使用npm,那么这是一个在其间复制文件的好地方.

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.

键入文件是构建TypeScript项目所必需的,但仅用于通过JavaScript项目增强VSCode IntelliSense.

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

希望能解决所有问题.

这篇关于自动类型获取打字稿定义文件在哪里保存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆