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

Callback parameters for multiple types #643

Open
rivo opened this issue Mar 16, 2016 · 4 comments
Open

Callback parameters for multiple types #643

rivo opened this issue Mar 16, 2016 · 4 comments

Comments

@rivo
Copy link

rivo commented Mar 16, 2016

I often have a situation where two types are allowed for a parameter or config. If one of them is a function, I would like to be able to specify the function's signature but that currently does not work. Here's an example:

/**
 * @cfg {number/Function} myCfg This can be either a number or a function.
 * When I specify the signature of the function, however, the result is not
 * as I expect.
 * @cfg {string} myCfg.in Some input string.
 * @cfg {string} myCfg.return Some return value.
 */

This turns into:

image

It works ok if the accepted type for this config is just {Function} but not if multiple types are allowed like {number/Function}. Is there a way to have jsduck recognize that what follows is the function's signature?

I understand that there may be an ambiguity if one specifies {Object/Function} but in that case, I would be ok with a fixed preference, e.g. additional subparameters would be interpreted as object fields.

@nene
Copy link
Member

nene commented Mar 17, 2016

Yeah, it would make sense to detect if the type contains "Function" instead of checking that it strictly equals to "Function".

But truth to be told, the development of JSDuck has kinda stagnated. No idea when this might be implemented.

Thanks for suggestion.

@rivo
Copy link
Author

rivo commented Mar 17, 2016

Out of curiosity, what's the reason for that stagnation?

@nene
Copy link
Member

nene commented Mar 17, 2016

That's just me not being really motivated to develop it as I'm not developing with Sencha stack any more.

@rivo
Copy link
Author

rivo commented Mar 17, 2016

Ok, I understand. Actually, I'm not using it for a Sencha project. I like that JSDuck is so flexible that it will adapt to my own style and code organization while still generating very precise documentation.

I would probably contribute but I'm not very familiar with the stack (and I kind of skipped ruby) so there's a bit of a learning curve.

Anyway, it still works for now. It would be great if it could at least remain on life support. ;-)

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

No branches or pull requests

2 participants