SVG-Edit / svgedit

Powerful SVG-Editor for your browser
MIT License
6.33k stars 1.52k forks source link

Feature request: Typescript definitions #367

Open jamiehowarth0 opened 4 years ago

jamiehowarth0 commented 4 years ago

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.

brettz9 commented 4 years ago

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.

jamiehowarth0 commented 4 years ago

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

jamiehowarth0 commented 4 years ago

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.

jfhenon commented 2 years ago

can this issue be closed?

brettz9 commented 2 years ago

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.

mccolljr commented 3 months ago

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