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

[JSDoc] Missing support of JSdoc @type #16199

Closed
4 tasks
yuit opened this issue Jun 1, 2017 · 4 comments
Closed
4 tasks

[JSDoc] Missing support of JSdoc @type #16199

yuit opened this issue Jun 1, 2017 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@yuit
Copy link
Contributor

yuit commented Jun 1, 2017

  • {Object} has type any, it should be {}
// @ts-check
/**
 * @type {Object}
 */
var bar;
// @ts-check
/**
 * @type {Object.<string, number>} obj
 */
var bar;
  • Specify property in object type
// @ts-check
/**
 * @type {Object} myObj
 * @type {number} myObj.a
 */
var bar;
  • Using with @callback
// @ts-check
/**
 * @callback myCallback
 * @param {number} x - ...
 */

/** @type {myCallback} */
var cb;
@yuit yuit added Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation labels Jun 1, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Jun 1, 2017

{Object} has type any, it should be {}

this is intentional. ppl use Object both in input and output locations. in input locations {} is fine, but in output locations it is not. they really mean any. see #14284 for more details.

Object.<type1, type2> has type any

tracked by #15105

Specify property in object type

tracked by #11597

Using with @callback

tracked by #7515

@mhegazy mhegazy added Duplicate An existing issue was already created and removed Bug A bug in TypeScript Domain: JSDoc Relates to JSDoc parsing and type generation labels Jun 1, 2017
@yuit
Copy link
Contributor Author

yuit commented Jun 1, 2017

For this

{Object} has type any, it should be {}
this is intentional. ppl use Object both in input and output locations. in input locations {} is fine, but in output locations it is not. they really mean any. see #14284 for more details.

You can then use {*} for any....I guess it may not be intuitive ?

@mhegazy
Copy link
Contributor

mhegazy commented Jun 1, 2017

yes. but users use them interchangabley. just like function, Function to mean any function

@mhegazy
Copy link
Contributor

mhegazy commented Aug 17, 2017

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

@mhegazy mhegazy closed this as completed Aug 17, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants