Is your feature request related to a problem? Please describe.LatLngTuple is an alias for number[] which can have n number of values in it instead of being [number, number] tuple with only 2 numbers. Hence it can be used with ... spread operator but cannot be used in places where only 2 positional values of Lat and Long are required.
Example:
Using it with firestore GeoPoint like this
class GeoPoint {
//...
constructor(latitude: number, longitude: number);
//...
const location: LatLngTuple = [0, 0];
new GeoPoint(...location); //invalid
will cause the following error
error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter
Describe the solution you'd like
Make LatLngTuple a proper [number: number] tuple and in encode function let the union type be (number[] | LatLng | LatLngTuple) to keep the fliexibility
Describe alternatives you've considered
const location: LatLngTuple = [0, 0];
new GeoPoint(location[0], location[1]);
Is your feature request related to a problem? Please describe.
LatLngTuple
is an alias fornumber[]
which can have n number of values in it instead of being[number, number]
tuple with only 2 numbers. Hence it can be used with...
spread operator but cannot be used in places where only 2 positional values of Lat and Long are required.Example: Using it with firestore
GeoPoint
like thiswill cause the following error
error TS2556: A spread argument must either have a tuple type or be passed to a rest parameter
Describe the solution you'd like Make LatLngTuple a proper
[number: number]
tuple and in encode function let the union type be(number[] | LatLng | LatLngTuple)
to keep the fliexibilityDescribe alternatives you've considered