admin管理员组

文章数量:1425820

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.

本文标签: javascriptwhat does referencesdts file do and where is it located in a NativeScript ProjectStack Overflow