Properties missing when adding a module/namespace
See original GitHub issueUsing the current beta, I have this example code:
'use strict';
/** @module util */
/**
* @class MyClass
* @param {string} message
* @returns {MyClass}
*/
class MyClass {
constructor(message) {
/** @type {string} */
this.message = message;
}
}
Which is converted to
/**
* @module util
*/
declare namespace util {
/**
* @class MyClass
* @param {string} message
* @returns {MyClass}
*/
class MyClass {
constructor(message: string);
}
}
As you can see, the message
property is missing.
When I use the following code (without module
), this.message
is not missing:
'use strict';
/**
* @class MyClass
* @param {string} message
* @returns {MyClass}
*/
class MyClass {
constructor(message) {
/** @type {string} */
this.message = message;
}
}
Converted:
/**
* @class MyClass
* @param {string} message
* @returns {MyClass}
*/
declare class MyClass {
constructor(message: string);
/**
* @type {string}
*/
message: string;
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Unable to access properties of namespace from imported ...
Importing from this module which exports the namespace is as its default export doesn't recognize any of the properties within the namespace ...
Read more >Can modules have properties the same way that objects can?
modules is a Python 2 issue -- Python 3.4 works as intended. If you need access to the class object in Py2, add...
Read more >How To Use Namespaces in TypeScript | DigitalOcean
In TypeScript, you can use namespaces to organize your code. Previously known as internal modules, namespaces in TypeScript are based on an ...
Read more >Documentation - Namespaces and Modules - TypeScript
This post outlines the various ways to organize your code using modules and namespaces in TypeScript. We'll also go over some advanced topics...
Read more >JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module syntax.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@englercj The jsdoc3/jsdoc#1182 issue has been resolved with JSDoc 3.5.0: https://github.com/jsdoc3/jsdoc/issues/1182#issuecomment-313750674
Current release version of JSDoc is 3.5.4, so it looks like this issue here can get fixed? 🤗
Sorry, I haven’t tested with JSDoc 3.5.0. It has been a while. But Florian posted demo code here which could be used for a unit test in your library?