Does Deno support `export type` statements?
Hello, we are using Deno + TS and I am getting the following error if I try to export a type from another file:
Is this something possible in Deno?
1 Reply
Yes, Deno does support
export type
statements. According to the documentation, if you're encountering an error when trying to export types, it might be due to the way you're importing or exporting them.
In Deno 1.4 and later, you should use import type
and export type
for type-only imports and exports. This helps ensure that when the code is emitted, all the types are erased. Here's an example:
If you're still encountering issues, please ensure that you're running a version of Deno that supports these features (Deno 1.4 or later), and that your syntax matches the example above. 🦕