-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Allow custom object types in JSDoc #9276
Comments
Moving to TS team. |
With nightly you can defined customized type using the
Then use it elsewhere in jsdoc. And with #9546, you can use the |
Trying to write type definitions according #8103 Format 3 doesn't work properly /**
* @typedef {Object} Product
* @property {String} name
*/
/**
* Creates a product instance
* @return {Product}
*/
function makeProduct() {} However format 1 works /**
* @typedef {{name: String}} Product
*/
/**
* Creates a product instance
* @return {Product}
*/
function makeProduct() {}
|
Also, function declarations are required. Something like: /**
* @typedef {{name: String, workClosure: () => (Error, Date) => void}} Product
*/ |
@Grim2d That's a bug, I'll send a fix soon, it should have worked. Regarding the function type, we use the popular jsdoc notation instead, so to achieve what you want you can do:
Reference for the type expression pattern: |
From @Grim2d on June 18, 2016 10:11
I'm using "vanilla" javascript for development. If I write custom object type in JSDoc, it appears as
any
orvoid
. It will be more helpful, if one can type custom types.Steps to Reproduce:
1.
1.
Copied from original issue: microsoft/vscode#7847
The text was updated successfully, but these errors were encountered: