When I try to use $arcgis.import to load modules via CDN, TypeScript throws an error, saying there is no global variable named $argis.
error TS2339: Property '$arcgis' does not exist on type 'Window & typeof globalThis'.
How do I get TypeScript to recognize $arcgis?
I've figured out that $arcgis is defined in "@arcgis/core-adapter". I can get Visual Studio Code to stop complaining if I add "@arcgis/core-adapter" to package.json, but tsc still throws the error.
// This gets Visual Studio Code to stop complaining, but not tsc.
const FeatureLayer = await window.$arcgis.import<typeof __esri.FeatureLayer>("@arcgis/core/layers/FeatureLayer.js");