otris / jsdoc-tsd

JSDoc template for generating TypeScript definition files based on JSDoc comments.
MIT License
29 stars 7 forks source link

Sorting support #57

Open whitlockjc opened 5 years ago

whitlockjc commented 5 years ago

It would be really nice to have some way to dictate how things are sorted in the generated .d.ts, even if only for the class/interface members.

wehrstedt commented 5 years ago

Hmm .. The input is just a taffy DB from jsdoc. For the extension the order should not matter. The only important thing is that the parent members are parsed before the child members, otherwise they can't be mapped together. I don't know a quick solution without spending too much effort.

Can I ask you for what purpose you wan't to sort the .d.ts?

whitlockjc commented 5 years ago

It's common convention (or at least preference for some), and sometimes enforced, that sources be sorted. I would like it to be sorted alphabetically, instead of order of definition (sub-classing causes issues here), but it's not something I must have. I was just inquiring about it.