-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds some documentation to public facing classes and functions #106
base: main
Are you sure you want to change the base?
Conversation
There is some lint errors, can you fix them? |
Also I think it's a little bit weird to use TS with JSDoc, is it common in libraries? |
Having these descriptions helps to aid in ambiguity where you might have a certain idea of how something works but you're not sure, thats why i also wanted to type the options in createEngine, but im not sure what every one of those options does under the hood |
Oh, i forgot that tsconfig has "removeComents" as true, for JSDoc to be able to be used for this "removeComments¨ has to be false, is there any reason for this to be set to true? |
Some libraries have comments on their code, this option removes it to decrease the bundle size. |
Well, mongoose uses them, and i've seen some other libs use them too |
Mongoose uses JS + JSDoc... Just found out there is a TSDoc: https://tsdoc.org/ |
Well, i tried to use mongoose as an example since it was the first one that came to mind, and it was a bad example, so im sorry. |
… original method of extracting from the constructor gave any types on the options, this adds explicit typing and documents 2 options
I would like these comments to be only on the .d.ts files, to not affect the bundle size: microsoft/TypeScript#14619 But since this is not something on TS yet, I just have to check how this affects our bundle and it's good to merge. |
public doString(script: string): Promise<any> { | ||
return this.callByteCode((thread) => thread.loadString(script)) | ||
} | ||
|
||
/** | ||
* Executes Lua code from a file asynchronously. | ||
* @async |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add @async with TSDoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to remove async
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please just remove this async and we are good to merge :)
Ill get to it soon, thanks for helping with the comments for CreateEngineOptions
With "removeComments": false,
"declaration": false, Builds stripped JS, then emits declarations with JSDoc preserved. Originally posted by @michal-kapala in microsoft/TypeScript#14619 (comment) |
…ns in engine.ts and removes private type annotations
@ceifa would like to have access to more docs, can I continue new PR just by making the remaining adjustments? indded, what do you think about me preparing a workflow with github-pages and some documentation generator tool? jsdoc, doxygen, something like that...? |
Pretty much described in the title, adds some documentation, mainly for public facing functions and classes, i would have typed the options of
factory.ts
- createEngine function, but i don't understand the project enough. I did use AI to help me write some of these types