Open
Description
π Search Terms
import
@implements
2304
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about the JSDoc tag
@implements
β― Playground Link
π» Code
/** @implements {import("a").B} */
class A {}
π Actual behavior
Two TypeScript errors:
Cannot find name 'import'.
(2304)'}' expected.
(2304)
π Expected behavior
TypeScript should allow using import()
types within the type of the JSDoc tag @implements
.
Additional information about the issue
A workaround is to use a JSDoc @typedef
to import the type under an alias, and then use that alias within the JSDoc tag @implements
type, e.g:
/** @typedef {import("a").B} B */
/** @implements {B} */
class A {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment