In Visual Studio Code, how to install arcgis-js-api.d.ts

6073
17
10-21-2016 08:27 PM
WenhuaPeng
New Contributor

I am new to javascript. In windows  Visual Studio Code, I want to get arcgis api Intellisense , some guidebook says first install node.js and typings, then install arcgis api.

The typings tool may be used to install this using the command:
typings install --global github:Esri/jsapi-resources/4.x/typescript/arcgis-js-api.d.ts

execute above line in cmd.exe  , error  shows the location is bad.

SO how can I install arcgis-js-api.d.ts

Thanks!

0 Kudos
17 Replies
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
WenhuaPeng
New Contributor

Robert,

If i ignore the warning , i can't get arcgis api Intellisense in visual studio code. Is there any other IDE that can hint intelligently   ArcGis  API( function/attribute)?  I think the intelligently hint is quite helpful.

 Thank you so much!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Wenhua,

   I am not sure what to do then. Lets see if some experts can provide some help.

odoe

dpaddock-esristaff

0 Kudos
WenhuaPeng
New Contributor

In Rene Rubalcava's first vedeo , we can see he is using VisualStudioCode, and successfully get Intellisense

0 Kudos
ReneRubalcava
Frequent Contributor

You need to have a tsconfig.json in the root of your folder with your TS settings and files.

You can see a sample project here.

GitHub - odoe/esrijs4-ts: Sample EsriJS 4 TypeScript Application 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rene,

   Can you do a setting up type script in VS for dummies (i.e. people that have no experience with any of the components involved except VS)? 

WenhuaPeng
New Contributor

I copy tsconfig.json and typings.json  from your sample, it still not work.

0 Kudos
JeffJacobson
Occasional Contributor III

The use of the "typings" tool was deprecated in TypeScript 2.0. The type definitions for version 3.x of the ArcGIS API can be downloaded via NPM here, but I'm not sure what to do for version 4.x.

WenhuaPeng
New Contributor

According your suggestion , I have installed the type definitions for version 3.x of the ArcGIS API . In Visual Studio 2015 ,intellsense now can provide a some hint. I don't know if it could be better. In Visual Studio Code, it still not work.

0 Kudos