You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Classes and constructor functions are not exported as types in js files #24064
// a.js/** @type {import("./b").C} */varx;x.// expect 'prop' to show in the list/** @type {import("./b").F} */vary;y.// expect 'prop' to show in the list
Expected behavior:
both x and y should have prop in their completion list
Actual behavior:
No completions
Related Issues:
I would also expect this to be have the same way:
// b.js functionF(){this.prop=0;}classC{prop=0;}module.exports={
F,
C
}
The first repro now works, but the second one with module.exports = { F, C } still doesn't.
Edit: It's probably because we treat the former similarly to the typescript export class C { prop = 0 }; and the latter similarly to export = { F, C }, which also doesn't work with import types. That's a separate issue.
Activity
sandersn commentedon Aug 23, 2018
The first repro now works, but the second one with
module.exports = { F, C }still doesn't.Edit: It's probably because we treat the former similarly to the typescript
export class C { prop = 0 }; and the latter similarly toexport = { F, C }, which also doesn't work with import types. That's a separate issue.joma74 commentedon Sep 1, 2018
TS 3.1.0-dev.20180901 here.
The following works.
But writing here as the following may be covered here alike, but is currently not. Or should i open another issue?
joma74 commentedon Sep 1, 2018
My bad. In my second case, this works and is sufficient