Skip to content
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

@event @type is not printed #99

Open
borisovg opened this issue Oct 14, 2015 · 4 comments
Open

@event @type is not printed #99

borisovg opened this issue Oct 14, 2015 · 4 comments

Comments

@borisovg
Copy link

There's no mention of type in in the output for event (output in jsdoc2md/jsdoc-to-markdown#9 suggests there once was).

Source:

/**
 * Instance of Test
 *
 * @constructor
 */
function Test () {

}

/**
 * Object event
 *
 * @event Test#event1
 * @type {object}
 * @property {boolean} isPacked - Indicates whether the snowball is tightly packed.
 */

/**
 * String event
 *
 * @event Test#event2
 * @type {string}
 */

Output:

<a name="Test"></a>
## Test
**Kind**: global class  

* [Test](#Test)
  * [new Test()](#new_Test_new)
  * ["event1"](#Test+event_event1)
  * ["event2"](#Test+event_event2)

<a name="new_Test_new"></a>
### new Test()
Instance of Test

<a name="Test+event_event1"></a>
### "event1"
Object event

**Kind**: event emitted by <code>[Test](#Test)</code>  
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| isPacked | <code>boolean</code> | Indicates whether the snowball is tightly packed. |

<a name="Test+event_event2"></a>
### "event2"
String event

**Kind**: event emitted by <code>[Test](#Test)</code>
@75lb
Copy link
Member

75lb commented Oct 14, 2015

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

@75lb
Copy link
Member

75lb commented Oct 14, 2015

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..

@borisovg
Copy link
Author

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:

http://usejsdoc.org/tags-event.html

@75lb
Copy link
Member

75lb commented Oct 14, 2015

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.

@75lb 75lb added the bug label Oct 14, 2015
@75lb 75lb added this to the milestone Dec 5, 2015
@75lb 75lb modified the milestone: Mar 21, 2017
@75lb 75lb added enhancement and removed bug labels May 24, 2017
@75lb 75lb transferred this issue from jsdoc2md/jsdoc-to-markdown Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants