math.gl icon indicating copy to clipboard operation
math.gl copied to clipboard

Use tuple type for arrays of fixed width

Open Qluxzz opened this issue 3 years ago • 1 comments

An example function: getMapCenterByLngLatPosition, says in the JSDoc comment that it will return an array with two elements in it [lng,lat], but is typed as an array of numbers.

Typing it as [number, number] tuple would improve the help TypeScript can give, while also not being a breaking change(?) https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types

I am willing to go through and create a PR with the changes if you also feel they would improve the quality of the library.

Qluxzz avatar Mar 10 '22 09:03 Qluxzz