heremaps / maps-api-for-javascript-examples

Self-contained examples for Maps API for JavaScript v3.
https://developer.here.com/javascript-apis/documentation/v3/maps
Other
191 stars 431 forks source link

TypeScript definition errors #132

Open OrangeDog opened 2 years ago

OrangeDog commented 2 years ago

There seems to be no public issue tracker for the library itself, so I'm putting this here for now.

There are several errors in the index.d.ts in @here/maps-api-for-javascript@1.31.0. These require the use of // @ts-ignore to skip type checking in order to use the API.

Those that I have noticed:

OrangeDog commented 1 year ago

All errors still there in 1.36.0

OrangeDog commented 1 year ago

1.38.0 has added a new problem. The return type of H.service.Platform.createDefaultLayers() has changed from H.service.DefaultLayers to GlobalObject. The former type appears to have been removed entirely.

This will cause a compilation failure for almost everyone.

Error: src/app/here-map.component.ts:56:23 - error TS2339: Property 'vector' does not exist on type 'Object'.

56         defaultLayers.vector.normal.map,
                         ~~~~~~

As a workaround, users must now cast it to any:

const platform = new H.service.Platform(environment.herePlatform);
const defaultLayers = platform.createDefaultLayers() as any;
Simoon-F commented 1 month ago

vector.

+1