mirror of
https://github.com/cincheo/jsweet.git
synced 2025-12-14 23:09:22 +00:00
@Ambient annotation was used to inline declarations. However they suffer from the Java packages structure, which is less flexible than namespaces in TypeScript. Since @Ambient are always defined in the package they appear, they are not convenient when working out of the root package. Plus, now that def.* packages are working well in version 2, the @Ambient annotation is redundant with using def.* packages. So, it was decided that all ambient declarations should be defined in def.* packages, thus forcing the developers to cleanly separate the actual implementation from the bridges to external libraries. We believe it is good practice to do so in Java in order to have a better-structured program.
JSweet core API
This JSweet sub-project defines the core APIs for JSweet programs. It aims at allowing the programming of JavaScript applications in Java.
Main content
It contains a Maven project for each JavaScript version (so far only ES5 version). Each version defines the following APIs:
- a
def.jspackage, which contains all the JavaScript language core APIs for the appropriate JavaScript version. - a
def.dompackage, which contains all the JavaScript language W3C DOM APIs for the appropriate JavaScript version. - a
jsweet.langpackage that contains the JSweet language extensions for Java (mainly annotations). - a
jsweet.utilpackage that contains some utilities (helpers).
License
This project is licensed with the Apache 2 license. It means that you can use this API and its source code in any kind of projects, even closed source and commercial projects.