Hi,
I am maintaining an application that began using ArcGIS 4.10 and TypeScript, within the VSCode environment. I need to use some of the newer methods within version 4.18. I have made the updates and the last one was installing the types:
npm install --save @types/arcgis-js-api
Unfortunately, this installs the latest 4.27 version. I cannot use that without extensive modification of the code due to deprecation of many of the methods that the code uses.
Is there a way to install the types for a specific API version? If so, please show that command or direct me to where I can find the information.
TIA.
Solved! Go to Solution.
It depends if you're building your app or using TypeScript and using the CDN.
If using the CDN, you can do "npm install --save @types/arcgis-js-api@4.18.0"
If building the app, like @AddisonShaw mentioned, if you are installing the arcgis-js-api or @arcgis/core packagers, you don't need to install the types separately.
AFAIK types should be bundled into the API and you shouldn't need to install them from DefinitelyTyped. You should be able to then just specify the version you want (4.18) in your package.json.
I did specify the version in my package.json and I was still not able to use MapView.ui.find(). Now that I've installed the latest Types, the code does recognize that find() method, but, as I mentioned, there are many errors that popped up as well due to the incompatible version
It depends if you're building your app or using TypeScript and using the CDN.
If using the CDN, you can do "npm install --save @types/arcgis-js-api@4.18.0"
If building the app, like @AddisonShaw mentioned, if you are installing the arcgis-js-api or @arcgis/core packagers, you don't need to install the types separately.
Thank you. That's exactly what I was looking for. I didn't see if there was a way to specifically indicate the version as you have above.
I did also find all previous versions via this link: https://unpkg.com/browse/@types/arcgis-js-api@4.18.0/index.d.ts