-
-
Notifications
You must be signed in to change notification settings - Fork 57
typescript def file generator from jsdoc annotations #1389
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
base: master
Are you sure you want to change the base?
Conversation
The Windows CI is currently expected to fail, so don't worry about that. |
Co-authored-by: Julian Groß <[email protected]>
Thank you there was so much we needed to do to get everything working |
we are wondering if this template even belongs in the main repo as we have talked to some people that want the typescript bindings in a npm package and if that makes more since the generator is in its own overte repo to package the bindings to npm package |
if you still want it in the repo we can make the template a package to be installed with npm and then for another repo pulls overte in and runs the template and packages the type def and publishes to npm |
that would only be if there is already a cmake that command for only building the docs |
found out that the overte namespaces clash with namespaces from the typescript library itself |
@@ -56,7 +56,7 @@ class ConsoleScriptingInterface : public QObject, protected Scriptable { | |||
* Logs an "INFO" message to the program log and triggers {@link Script.infoMessage}. | |||
* The message logged is "INFO -" followed by the message values separated by spaces. | |||
* @function console.info | |||
* @param {...*} [message] - The message values to log. | |||
* @param {*} [message] - The message values to log. |
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.
This command takes multiple parameters, for example console.log("a", "b", "c")
. Is there a way of representing this in TypeScript?
@@ -782,7 +782,7 @@ void ScriptManager::init() { | |||
* The message logged is the message values separated by spaces. | |||
* <p>Alternatively, you can use {@link Script.print} or one of the {@link console} API methods.</p> | |||
* @function print | |||
* @param {...*} [message] - The message values to print. | |||
* @param {*} [message] - The message values to print. |
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.
Same as in console.info
* @example <caption>Creating a pair of vec3 objects to represent two 3D vectors.</caption> | ||
* const myVec3Pair = { | ||
* first: new vec3(1.0, 0.0, 0.0), // First vector pointing along the X-axis | ||
* second: new vec3(0.0, 1.0, 0.0) // Second vector pointing along the Y-axis |
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.
Pair is currently defined differently, check example here:
/*@jsdoc
* Draws lines in world space, visible for a single frame. To make the lines visually persist, you need to repeatedly draw
* them.
* <p><strong>Note:</strong> Currently doesn't work.
* @function DebugDraw.drawRays
* @param {Vec3Pair[]} lines - The start and end points of the lines to draw.
* @param {Vec4} color - The color of the lines. Each component should be in the range <code>0.0</code> –
* <code>1.0</code>, with <code>x</code> = red, <code>y</code> = green, <code>z</code> = blue, and <code>w</code> = alpha.
* @param {Vec3} [translation=0,0,0] - A translation applied to each line.
* @param {Quat} [rotation=Quat.IDENTITY] - A rotation applied to each line.
* @example <caption>Draw a red "V" in front of your initial avatar position.</caption>
* var lines = [
* [{ x: -1, y: 0.5, z: 0 }, { x: 0, y: 0, z: 0 }],
* [{ x: 0, y: 0, z: 0 }, { x: 1, y: 0.5, z: 0 }]
* ];
* var color = { x: 1, y: 0, z: 0, w: 1 };
* var translation = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -5 }));
* var rotation = MyAvatar.orientation;
*
* Script.update.connect(function () {
* DebugDraw.drawRays(lines, color, translation, rotation);
* });
*/
|
||
/*@jsdoc | ||
* Information about a parabola-to-avatar intersection. | ||
* @typedef {Object} ParabolaToAvatarIntersectionParameters |
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.
I can't find any references to ParabolaToAvatarIntersectionParameters
anywhere in the source code, is this correct?
* @property {Uuid[]} avatarsToInclude - List of avatars to include in the intersection check. | ||
* @property {Uuid[]} avatarsToDiscard - List of avatars to exclude from the intersection check. | ||
* | ||
* @typedef {RayToAvatarIntersectionResult} ParabolaToAvatarIntersectionResult |
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.
Add a note here that it's deprecated.
*/ | ||
|
||
/*@jsdoc | ||
* Result value returned by {@link Assets.putAsset}. |
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.
Assets.putAsset does not return anything on C++ side, what is this data type used for?
dootaadoo we believe we have integrated the typescript def file generator from jsdoc annotations into the overte repo we need someone to build and test but from ours at least the template works.
we have also done some sprucing on the types of the jsdoc annotations to Aline with jsdoc annotations and the correct generation of typescript and with making sure it stays compatible with JavaScript API docs