DEV Community

Discussion on: Imba - a JavaScript alternative for increased developer productivity

Collapse
 
lucas_castro profile image
Lucas Castro

@somebee : with regards to typing, is it possible to type the output of functions as well?

Also, can we create interfaces and types, like in Typescript? Would that just be done in TS files, and imported and used in.imba files? Or does Imba itself have support for these features?

Overall, this looks very interesting, but a feature-set that can compete with Typescript would probably be the biggest barrier to adoption for me.

Collapse
 
somebee profile image
Sindre Aarsaether

It is not currently possible to annotate the return type of a function without resorting to a jsdoc comment above the function declaration. This is currently a limitation that I hope to resolve before final v2 release. That said, I find the type inference of typescript very powerful, so if you use typed parameters etc it will almost always infer the correct return type.

We're considering support for creating types and interfaces, but for now you'll need to do that in separate .d.ts files :)