JSweet comes with a TS definition files to Java translator (.d.ts to .java). So when you have the TS definition file, you can generate the correspond Java API on-the-fly or use a pre-translated/pre-compiled definition in so-called "candies". The candies are just here for typing in Java and ensure that you have the exact same API as in TS. Then JSweet generates intermediate TS code, which is compiled against the original TS definition. This 2-step transpilation process ensures that the generated code is correct and well-typed. In the end, you can work either directly with the JS code or the TS code depending on what you need.