We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Fraction type only exposes s, n add d properties
Fraction
s
n
d
mathjs/types/index.d.ts:4018:
export interface Fraction { s: number n: number d: number }
so we can't use methods
To Reproduce
math.fraction('1.5').toFraction() // "3/2"
> tsc error TS2339: Property 'toFraction' does not exist on type 'Fraction'. 9 math.fraction('1.5').toFraction() ~~~~~~~~~~
The text was updated successfully, but these errors were encountered:
Thanks for reporting, we should improve the TypeScript definitions. Ideally, we can import and use type definitions from Fraction.js.
Who can help fix the TypeScript definitions of fractions?
Sorry, something went wrong.
I think you might need to update the fraction.js version first, which is out outdated.
Yes, that is addressed via #3283, it is a breaking change planned for v14.
v14
Fixed now in v14.0.1.
v14.0.1
Successfully merging a pull request may close this issue.
Describe the bug
Fraction
type only exposess
,n
addd
propertiesmathjs/types/index.d.ts:4018:
so we can't use methods
To Reproduce
The text was updated successfully, but these errors were encountered: