导入gridster TypeScript定义

时间:2017-12-16 17:11:24

标签: cordova typescript ionic-framework typescript-typings gridster

我启动了一个新的离子项目,并在项目根目录中安装了gridster.js npm install gridsternpm 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/

1 个答案:

答案 0 :(得分:0)

gridster类型是全局的。您不应该需要任何导入来获取它们:

// @ts-check

/** @type {Gridster} */
const g = {};