logoalt Hacker News

apatheticonionlast Monday at 6:04 AM1 replyview on HN

You cannot replicate `import type { x } from './foo'` without also re-exporting that import - which causes collisions.

The alternative is to do an inline `const foo = /** @type {import('./foo').x} */ ({})` however this gets messy, repetitive and it's difficult to use algebraic types (e.g. `Event & { detail: string }`)


Replies

rangedbarbarianlast Monday at 1:36 PM

Would `import type { x as y } from `./foo.x` not work?