DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

1 1

Is it possible for a JS library to have full TS support, but doesn't use TS extension?

For example, I want to use Flow, as well as Babel, probably also with tcomb. (or some other reasons?)

To compile with tsc to JavaScript for web browsers, you have to add .js to all imports and exports. This is a known issue in TypeScript (and probably wontfix).

IMO, Babel can be more powerful than TypeScript, as it allows me to define my own grammars; therefore, more plugins to choose, not limited to a single authority. Also, plugins are written in JavaScript, therefore can emit JavaScript codes, not only some IDE safety only.

I know both Flow and TypeScript emit their own specific type definitions, not cross-compatible with each other; but are there ways to normalize that (e.g. emit JSDoc as well)?

I have seen repos with *.d.ts inside it. Are there libraries to help writing that?

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay