I am currently working on converting JSON data called JsonData
that includes time-series of parameters:
[
[ timestamp1, [ [paramset1, ...], [paramset2, ...], ...] ],
[ timestamp2, [ [paramset1, ...], [paramset2, ...], ...] ],
...
]
into a new structure called ParamPoint
export class ParamPoint{
constructor(
public tstamp: number,
public paramSets: number[][]
){}
}
using the following code snippet:
let res = JsonData.map<ParamPoint>((p) => new ParamPoint(p[0], p[1]));
However, I encounter an error message:
error TS2345: Argument of type 'number | number[][]' is not assignable to parameter of type 'number'.
Type 'number[][]' is not assignable to type 'number'.
I need clarification on what this error signifies and how it can be prevented.