Improve the TypeScript definitions of functions like `number`, `bignumber`, `boolean`, and `complex` returning an array/matrix with known type of values
Open
feature
typescript
- Dominant language
- JavaScript
- Stars
- 15.1k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Currently the typescript definitions for Arrays and Matrices only supports number, BigNumber,Fraction or Complex
```javascript
type MathNumericType = number | BigNumber | Fraction | Complex
type MathArray = MathNumericType[] | MathNumericType[][]
type MathCollection = MathArray | Matrix
```
But there are functions, like 'number', that process Arrays with non-numeric types, but which are considered wrong by Typescript:
```javascript
let m = [true,false,'1','2','3']
//type error
let toNumber = math.chain(m).number().done() // [ 1, 0, 1, 2, 3 ]
```
Maybe adding a generic matrix/array type should solve ?
Contributor guide
Assessment
This issue has not been assessed yet.