-
Notifications
You must be signed in to change notification settings - Fork 557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More docs on using types for 3.x and 4.x? #60
Comments
PS: For reference, please see: |
The 3.x typings have the interfaces in the |
@dasa thank you for pointing that out. With @tomwayson's Even though there would be global namespace pollution, is there any possibility in having something similar to the 4.x types' |
Have you tried only using the syntax for this one line? There's only interfaces in the "esri" module so this isn't in the JS code.
You may also be able to use import from syntax to access these interfaces like this:
|
Yes, trying either of those lines allows for type support, but only "1 level deep". For example, I can begin typing out VSCode will indicate to me that "[ts] Namespace '"esri"' has no exported member 'Map'." |
Right, "esri" mostly just has the constructor options. To get the typing for the "esri/map" module, you still have to import it. |
@jwasilgeo - let me know if you have any more questions on this. |
Thanks @dasa! |
Can someone explain to me (or just set me straight) why the typings for JSAPI 3.x aren't using a
namespace
?For example, I see in the 4.x typings that it does explicitly list the
__esri
namespace.This question stems from an issue conversation over in
angular2-esri-loader, where I am working with JSAPI 3.19 for an Angular2+TypeScript2 demo app. I installed the types with
npm install @types/arcgis-js-api@3.19.0
, but my VSCode claims it doesn't know anything about the__esri
namespace. I poked around and only found "__esri
" in the 4.x typings.Is there something else I need to do (in addition to making sure arcgis-js-api typings are/n't excluded in my project's tsconfig.json)?
Does the 3.x arcgis-js-api.d.ts file need to have this namespace declaration, too?
Thanks!
The text was updated successfully, but these errors were encountered: