stephenh / ts-poet

A code generator DSL for typescript
Apache License 2.0
100 stars 12 forks source link

Add type/const modifiers to imports #25

Closed stephenh closed 11 months ago

stephenh commented 2 years ago

I.e. imp("Foo@foo").t --> becomes a type import, imp("Foo@foo").c --> a non-type import.

Given ts-poet doesn't know the AST, it doesn't automatically know if an import is being used as a type or not, so the user needs to give us hints.

stephenh commented 11 months ago

This has been done via a t: prefix, i.e. imp("t:Foo@bar") turns into a type import, otherwise imports are assumed to be const imports.