最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Include a *.d.ts file (and the corresponding JS) in a TypeScript project using PHPStorm - Stack Overflow

programmeradmin2浏览0评论

I want to dive into TypeScript (because to me it looks very promising) and therefore I want to rewrite a little JS project of my own.

So I started to create some classes (each class in a seperate file), but I'm a little bit confused about those *.d.ts files.

How do I exactly work with them? Do I need to reference them in the .ts files? Because PHPStorm seems to index the *.d.ts file anyway.

I'm using grunt-ts () to pile the project down to JavaScript, seems that this one needs the reference files.

But when I'm referencing it like so in the first line:

///<reference path="../../../lib/typed/jquery.d.ts">

The piler says:

....Model.ts(37, 20): error TS1084: Invalid reference directive syntax.

What am I missing?

I want to dive into TypeScript (because to me it looks very promising) and therefore I want to rewrite a little JS project of my own.

So I started to create some classes (each class in a seperate file), but I'm a little bit confused about those *.d.ts files.

How do I exactly work with them? Do I need to reference them in the .ts files? Because PHPStorm seems to index the *.d.ts file anyway.

I'm using grunt-ts (https://github./grunt-ts/grunt-ts) to pile the project down to JavaScript, seems that this one needs the reference files.

But when I'm referencing it like so in the first line:

///<reference path="../../../lib/typed/jquery.d.ts">

The piler says:

....Model.ts(37, 20): error TS1084: Invalid reference directive syntax.

What am I missing?

Share Improve this question asked Apr 10, 2014 at 8:12 Johannes KlaußJohannes Klauß 11k17 gold badges70 silver badges126 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 16

That needs to be a self closing tag :

///<reference path="../../../lib/typed/jquery.d.ts" />

Notice /> at the end

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论