Open borisovg opened 8 years ago
handbrake-js is a project with documented events - the event docs on this project generate fine..
this source
/**
Fired at regular intervals passing a `progress` object.
@event module:handbrake-js~Handbrake#progress
@param progress {object} - details of encode progress
@param progress.taskNumber {number} - current task index
@param progress.taskCount {number} - total tasks in the queue
@param progress.percentComplete {number} - percent complete
@param progress.fps {number} - Frames per second
@param progress.avgFps {number} - Average frames per second
@param progress.eta {string} - Estimated time until completion
@param progress.task {string} - Task description, either "Encoding" or "Muxing"
*/
Handbrake.prototype._emitProgress = function (progress) {
if (!this._inProgress) this._emitBegin()
this.emit('progress', progress)
}
...generates this output
yes, i agree the @type
field is ignored.. because the event can pass more than 1 type to the event handler.. instead, define the args the the event fires with as @param
, as in my example..
That doesn't seem right though - the data that an event sends in not a parameter - it might be a parameter in the listener callback and be documented there as such, but for the event it is not.
jsdoc documentation specifically uses "type" and "property" in the "event" example:
both the jsdoc and handbrake-js examples are correct.. they should both be supported (both the @type and @param) method.. the @type method isn't supported yet but it will be in future.
There's no mention of type in in the output for event (output in jsdoc2md/jsdoc-to-markdown#9 suggests there once was).
Source:
Output: