otris / jsdoc-tsd

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

Add support for module tag #18

Closed tineheller closed 6 years ago

tineheller commented 6 years ago
  1. The since-test failed, so I changed the part where the versionComparator is added. I'm not sure, if this is how you meant it. If not, maybe you can change it again. For now, the since-tests run and I think the versionComparator does what I'd expect :)
  2. I'm still not sure about the flags. I read that a module member is exported if it's static. The probem is, if it's not exportet, there is still a declare added to the output... I'm not sure if this is correct?
wehrstedt commented 6 years ago

I'm still not sure about the flags. I read that a module member is exported if it's static. The probem is, if it's not exportet, there is still a declare added to the output... I'm not sure if this is correct?

It's definitily not correct that module members will be declared with the 'declare' keyword, because that's not valid typescript. But I'm not sure how to deal with that for now. Actually we should fix that in the dts-dom module... Fact is, that every module member, that is not explicity exportet, will be private or rather the access description will be omitted.

tineheller commented 6 years ago

Fact is, that every module member, that is not explicity exportet, will be private or rather the access description will be omitted.

But how is it explicitly exported in jsDoc? I tried to list the members in @exports (http://usejsdoc.org/tags-exports.html) but it didn't work. The export was not even shown in the JSON output of jsdoc... Then, after reading that http://usejsdoc.org/tags-module.html#examples I thought, maybe static members should be exported. But yes, the members are all static on default, so they are not explicitly exported.

tineheller commented 6 years ago

I just realised, the line ending fix didn't work. Maybe I have to change something in my git settings...?

wehrstedt commented 6 years ago

In my opinion every member is public until you add the private-tag.

Possible. Search for git line ending and set it to "checkout as is, commit as is"

tineheller commented 6 years ago

seems it has been CRLF before... I don't really understand but hope it's correct again now

wehrstedt commented 6 years ago

Looks good. Maybe because of your git settings it was changed to LF. I will publish the new version tomarrow, ok?