An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
Hi Doug Marquardt,
Thanks for sharing the issue. This is happening because of a change introduced in the latest TypeScript version. As you mentioned, TypeScript 6.x has stricter rules and it no longer allows using the module keyword inside a namespace. That is why the Azure Maps SDK typings are failing to compile.
This is not an issue with your code. It is due to a compatibility mismatch between the TypeScript version and the current Azure Maps SDK version.
Here are a few ways you can handle this:
First option You can temporarily downgrade TypeScript to an earlier stable version like 5.x. This is the simplest workaround until the SDK is updated.
Second option You can manually update the type definition file in your project. In the index.d.ts file, replace the line export module data with export namespace data
This aligns with the new TypeScript rules and avoids the compilation error.
Third option Keep an eye on newer versions of the Azure Maps SDK. Since this behavior is by design in TypeScript, the SDK will need to update its type definitions to be compatible.
Helpful reference: TypeScript namespace changes and stricter rules are documented here https://www.typescriptlang.org/docs/handbook/namespaces.html
In short: This is a TypeScript breaking change, not a runtime issue. You just need to either align your TypeScript version or adjust the typings until the SDK is updated.
I Hope this helps. Do let me know if you have any further queries.
Thankyou!