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

Support @event tag #148

Open
thw0rted opened this issue Apr 15, 2022 · 0 comments
Open

Support @event tag #148

thw0rted opened this issue Apr 15, 2022 · 0 comments

Comments

@thw0rted
Copy link

Looking around StackOverflow and various blog posts, it seems like the event tag might be one of the least-well-understood tags. Right now, as far as I can tell, tsd-jsdoc just ignores it.

I think it's meant to work similarly to a @typedef -- when I declare an event, I'm saying that the owning function / class / namespace will at some point invoke a callback with an object that has certain properties. That sounds a lot like a TypeScript interface.

What I'm suggesting is that tsd-jsdoc treat these as equivalent:

/**
 * @typedef {Object} Foo.BarEvent
 *
 * An Event with an "x" property
 *
 * @property {number} x
 */
/**
 * An Event with an "x" property
 * @event Foo.BarEvent
 *
 * @type {Object}
 * @property {number} x
 */

In both case an interface called BarEvent should be created in the namespace Foo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant