We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies.

We use cookies and other tracking technologies to improve your browsing experience on our site, analyze site traffic, and understand where our audience is coming from. To find out more, please read our privacy policy.

By choosing 'I Accept', you consent to our use of cookies and other tracking technologies. Less

We use cookies and other tracking technologies... More

Login or register
to publish this job!

Login or register
to save this job!

Login or register
to save interesting jobs!

Login or register
to get access to all your job applications!

Login or register to start contributing with an article!

Login or register
to see more jobs from this company!

Login or register
to boost this post!

Show some love to the author of this blog by giving their post some rocket fuel 🚀.

Login or register to search for your ideal job!

Login or register to start working on this issue!

Login or register
to save articles!

Login to see the application

Engineers who find a new job through WorksHub average a 15% increase in salary 🚀

You will be redirected back to this page right after signin

Blog hero image

Scala-TS v0.5.0

Cédric Chantepie 3 February, 2021 | 1 min read

Scala-TS is a simple tool which generates TypeScript types from Scala types.

For example, with a Scala case class as below,

case class Incident(id: String, message: String)

It generates the appropriate TypeScript:

export interface Incident {
  id: string;
  message: string;
}

const incident: Incident = {
  id: 'id',
  message: 'A message'
}

Scala-TS now supports a lot a type kinds: generic class, Value class, sealed trait, enumeration, union type.

See more examples

It's useful to share model between Scala and TypeScript (e.g.across REST API).

This new major release 0.5.0 provide easy to use, but yet highly configurable & extensible compiler and SBT plugins to generate TypeScript types from Scala compiled one.

It can be configured by adding to project/plugins.sbt:

addSbtPlugin("io.github.scala-ts" % "sbt-scala-ts" % "0.5.0")

Then the plugin can be enabled per project:

// Not enabled by default
enablePlugins(TypeScriptGeneratorPlugin)

The TypeScript files are generated at compile-time.

sbt compile

See documentation

Originally published on scala-ts.github.io

Related Issues

open-editions / corpus-joyce-ulysses-tei
open-editions / corpus-joyce-ulysses-tei
  • Open
  • 0
  • 0
  • Intermediate
  • HTML
open-editions / corpus-joyce-ulysses-tei
open-editions / corpus-joyce-ulysses-tei
  • Started
  • 0
  • 1
  • Intermediate
  • HTML
open-editions / corpus-joyce-ulysses-tei
open-editions / corpus-joyce-ulysses-tei
  • Open
  • 0
  • 0
  • Intermediate
  • HTML
open-editions / corpus-joyce-ulysses-tei
open-editions / corpus-joyce-ulysses-tei
  • Open
  • 0
  • 0
  • Intermediate
  • HTML

Get hired!

Sign up now and apply for roles at companies that interest you.

Engineers who find a new job through WorksHub average a 15% increase in salary.

Start with GitHubStart with Stack OverflowStart with Email