Open HendrikPetertje opened 3 years ago
Thanks for reporting!
Anyone able to help out adding type definitions for Unit
?
As described in this discussion, I cannot retrieve math.Unit.UNITS
in typescript.
However, the following code works:
import { all, create } from "mathjs";
const math = create(all);
// @ts-ignore
console.log(math.Unit.UNITS);
Is this still being worked on?
Thanks for reporting Jakob. There is no one working on that right now, help would be welcome.
And indeed, you can resort to @ts-ignore
as a workaround.
When creating the following code in Typescript
It looks like Unit isn't properly part of the new MathJS typescript definitions or it's not linking correctly.
if I replace the line above with
window['testing'] = math
then the Unit is in fact present.Edit: I am running mathjs 9.4.4 without
@types/mathjs
(relying on the built-in type definitions)