sudo-suhas/elastic-builder

Types for geo shape query coordinates seem to be incorrect

lostpebble opened this issue · 2 comments

I'm getting a type error while trying to create a geo shape query like so:

esb.geoShapeQuery("geoShape")
      .shape(
        esb.geoShape("envelope").coordinates([[topLeft.lon, topLeft.lat], [bottomRight.lon, bottomRight.lat]])
      )

The error is showing up over the parameters passed to coordinates():

TS2322: Type 'number[]' is not assignable to type 'number'.

So I think there is a problem, and the correct type is an array of number[] - so number[][].

It was an issue with the type declaration. Fixed in v2.3.1 🎉

Great! Can see it is working fine now after updating.