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

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

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论