Open
Description
🔎 Search Terms
Declaration emit for this file requires using private name '__type' from module '{path}'. An explicit type annotation may unblock declaration emit
implements
import
type
JSDoc
🕗 Version & Regression Information
This is the behavior in every version I tried (v5.5.4 - Nightly)
⏯ Playground Link
💻 Code
// @filename: foo.js
/**
* @typedef { { foo: string } } Foo
*/
// @filename: bar.js
/**@import { Foo } from "./foo.js" */
/**@implements {Foo} */
class Bar { // <-- Declaration emit for this file requires using private name '__type'. An explicit type annotation may unblock declaration emit.
foo = "42";
}
🙁 Actual behavior
Declaration emit for this file requires using private name '__type'. An explicit type annotation may unblock declaration emit
🙂 Expected behavior
no errors.
same code in typescript files works fine.
Additional information about the issue
if redefine type in the same file, error can be avoided
// @filename: foo.js
/**
* @typedef { { foo: string } } Foo
*/
// @filename: bar.js
/**
* @import { Foo } from "./foo.js"
* @typedef { Foo } $Foo
*/
/**@implements {$Foo} */
class Bar { // <-- Ok
foo = "42";
}