Acknowledged
over 1 year ago

Confusing definition of LightNetwork.getBikeLights() in API documentation

In API documentation (and also in SDK) it is:

getBikeLights() as Lang.Array<AntPlus.LightNetworkState> or Null

But it returns an Array of BikeLight.

When type check level is set to strict you need to do a lot of workaround code to handle this.

Like:

mBikeLights = mLightNetwork.getBikeLights();
 var bikeLights = mBikeLights as Array;
for (var i = 0; i < bikeLights.size(); i++) {
          var light = bikeLights[i] as BikeLight?;

See: https://github.com/djs2014/settled