Closed
Description
Bug Report
🔎 Search Terms
Import type syntax error after generate .d.ts from js
Import type error after generate .d.ts using JSdoc
🕗 Version & Regression Information
💻 Code
// index.js
/** @type {import('./type').Foo} */
export const foo;
// type.ts
export type Foo = string;
demo repo (using 'import-types' branch, not 'master')
🙁 Actual behavior
output index.d.ts
/** @type {import('./type').Foo} */
export const foo: import('./type').Foo;
import
is a method for loading async resource in js/ts, not import a type. it should be transformed to import .. from ..
.
🙂 Expected behavior
output index.d.ts
import {Foo} from './type';
/** @type {import('./type').Foo} */
export const foo: Foo;