Within a typescript class, I have a method instance...
createArea = d3.area<Point>().x((d) => d.x).y0((d) => d.max).y1((d) => d.y);
Although this method works fine, it is being seen as an instance field. To rectify this, I tried adding a typed lambda...
createArea = (points:Point[]):String => d3.area<Point>().x((d) => d.x).y0((d) => d.max).y1((d) => d.y);
Unfortunately, this approach did not work
An error occurred - Type 'Area' is not assignable to type 'String'.
Could this be due to an issue in the type definition (@types/d3) ?
export function area<Datum>(): Area<Datum>;
It is confirmed that the Area() method returns a string..
if (buffer) return output = null, buffer + "" || null;
The contents of my package.json file are as follows:
"dependencies": {
"d3": "^5.5.0",
},
"devDependencies": {
"@types/d3": "^5.0.0",
},