javascript - what does references.d.ts file do and where is it located in a NativeScript Project? - Stack Overflow

i am following this tutorial in nativescript and it states to put<reference path=".node_m

i am following this tutorial in nativescript and it states to put

/// <reference path="./node_modules/nativescript-barcodescanner/barcodescanner.d.ts" /> Needed for autopletion and pilation.

in references.d.ts . my question is what does this file do and where is it located in a nativescript application

i am following this tutorial in nativescript and it states to put

/// <reference path="./node_modules/nativescript-barcodescanner/barcodescanner.d.ts" /> Needed for autopletion and pilation.

in references.d.ts . my question is what does this file do and where is it located in a nativescript application

Share Improve this question asked Jul 31, 2017 at 12:41 daviddavid 4655 silver badges11 bronze badges 1
  • 2 *.d.ts files are typescript declarations that allow you to use pure javascript libraries in typescript (e.g jQuery), without having to convert them into type-safe code. The main references.d.ts file is picked up by the tspiler and usually references all other d.ts files. Depending on config the references.d.ts file is usually in the project root. CodePlex have a good basic intro – 83N Commented Jul 31, 2017 at 12:56
Add a ment  | 

1 Answer 1

Reset to default 5

The reference.d.ts file can be added to your project in the root directory, prior to NativeScript 3.0+ it was included in typescript and angular template projects. It is used to add external type definitions to your project such as tns-platform-declarations. I believe however since that tutorial is a year old you won't need to add the reference.d.ts file to import those anymore and the typescript piler should pull them in automatically.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745453017a4628358.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信