Skip to content
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

TypeScript definition errors #132

Open
OrangeDog opened this issue Jul 13, 2022 · 3 comments
Open

TypeScript definition errors #132

OrangeDog opened this issue Jul 13, 2022 · 3 comments

Comments

@OrangeDog
Copy link

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/[email protected].
These require the use of // @ts-ignore to skip type checking in order to use the API.

Those that I have noticed:

  • H.geo.Point.validate has this : H.geo.Point as the first argument, which should not be present in a static method
  • Multiple classes have data as a required member when (according to the documentation) it should be optional.
    • H.map.AbstractMarker.Options
    • H.map.Circle.Options
    • H.map.DomMarker.Options
    • H.map.Group.Options
    • H.map.Marker.Options
    • H.map.Object.Options
    • H.map.Overlay.Options
    • H.map.Polygon.Options
    • H.map.Polyline.Options
    • H.map.Rect.Options
    • H.map.Spatial.Options
    • H.map.provider.Tile
    • H.ui.base.Button.Options
@OrangeDog
Copy link
Author

All errors still there in 1.36.0

@OrangeDog
Copy link
Author

OrangeDog commented Mar 22, 2023

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
Copy link

vector.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants