Is there any official Typescript definition for fabric js

0 votes

At the moment, I am able to find a Typescript definition for fabric.js in https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fabric (https://www.npmjs.com/package/@types/fabric). However, I am not sure if it is an official one. Does anyone know it?

On the other hand, the version of the above definition is 1.5.27 whereas the latest version of fabric.js is 1.7.19. Does it mean the definition is outdated? Does anyone know how to generate an updated definition for the latest fabric.js?

Thanks.

Aug 2, 2022 in TypeSript by Elton
• 400 points
2,401 views

1 answer to this question.

0 votes

Typically, packages in Definitely Typed aren't official type definitions. They are user contributed for the better typing of all: https://github.com/DefinitelyTyped/DefinitelyTyped#how-can-i-contribute.

If there were official type definitions, it would likely be in the library itself, in which case, you wouldn't need a separate file download.

From FabricJs's github: https://github.com/fabricjs/fabric.js/issues/4507#issuecomment-469191403

we do not have any. No one ever did them.

The Definitely Typed file is likely the best you are going to get right now. If there's anything wrong with the type definitions, you should be able to set up a .d.ts file that extends the type definitions that exist. Or just bring the definitely typed files into your project and modify them as needed to update it.

There are Definitely Typed versions for version 3.6.3 of fabricjs.

answered Aug 3, 2022 by Abhinaya
• 1,160 points

Related Questions In TypeSript

0 votes
1 answer
0 votes
1 answer

TypeScript TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'

If you want a key/value data structure ...READ MORE

answered Jun 7, 2022 in TypeSript by Nina
• 3,060 points
20,677 views
0 votes
1 answer
0 votes
1 answer
0 votes
0 answers

Is there any official Typescript definition for fabric.js?

At the moment, I am able to ...READ MORE

Jul 5, 2022 in TypeSript by Logan
• 2,140 points
980 views
0 votes
1 answer