我启动了一个新的离子项目,并在项目根目录中安装了gridster.js
npm install gridster
和npm install @types/jquery.gridster
。但我无法导入已安装的定义。我正在使用以下声明:
import { Gridster } from '@types/jquery.gridster';
我认为这个import语句应该有效,但事实并非如此。 VScode告诉我/home/user/git/Project/node_modules/@types/jquery.gridster/index.d.ts"
不是模块,但我还应该导入什么?
我的项目gridster/
目录中还有@types/jquery.gridster/
和node_modules/
。
答案 0 :(得分:0)
gridster类型是全局的。您不应该需要任何导入来获取它们:
// @ts-check
/** @type {Gridster} */
const g = {};