svgedit icon indicating copy to clipboard operation
svgedit copied to clipboard

Feature request: Typescript definitions

Open jamiehowarth0 opened this issue 5 years ago • 6 comments

I'm working on a project right now using Typescript and I'd like to see support for SVG Edit added. I'll start working on a PR to create @types/svgedit as a package.

jamiehowarth0 avatar Nov 25 '19 15:11 jamiehowarth0

Great! I've been trying to keep the jsdoc in order, so let us know if, in the course of your work checking through the files, you find any problems with the types expressed within jsdoc.

brettz9 avatar Nov 25 '19 16:11 brettz9

@brettz9 I've got a fork with tsd-jsdoc installed, and it's throwing errors when handling @external definitions, digging a bit deeper

jamiehowarth0 avatar Nov 25 '19 16:11 jamiehowarth0

Update: the bug's in tsd-jsdoc, I've filed an issue & PR. This successfully seems to correctly process & produce a types.d.ts file, I'll try & test it against an active project shortly.

jamiehowarth0 avatar Nov 25 '19 17:11 jamiehowarth0

can this issue be closed?

jfhenon avatar Jun 02 '22 20:06 jfhenon

FWIW, @external is not the approach that should be used for TypeScript-flavored JSDoc. In eslint-plugin-jsdoc, that means setting settings: {jsdoc: {mode: 'typescript'}} and then using the likes of import() within JSDoc type fields to get external types rather than external: references. I.e., the flavor of JSDoc that was in the code (and I presume may still be in the code) needs to be changed to the TypeScript flavor of JSDoc. Then it can be used to build TS declaration files.

brettz9 avatar Jun 02 '22 22:06 brettz9

I know that this is an old issue, but I have an interest in typescript definitions. I would like to use this in a typescript project but not having definitions is a bit of a blocker. I'm happy to generate them myself, i.e. with the tsd-jsdoc, as long as the issue pointed out by @brettz9 has been / can be resolved

mccolljr avatar Apr 06 '24 03:04 mccolljr