Giter VIP home page Giter VIP logo

android-dts-generator's Introduction

android-dts-generator

A tool that generates TypeScript declaration files (.d.ts) from Jars

Because there are certain incompatibilities between Java and TypeScript, definitions MAY NOT always be completely accurate. They will however compile and provide auto complete feature inside a modern text editor supporting typings.

Quirks

  • Interfaces are represented by classes, this will allow you to extend them by using the new syntax, as well as show you all its members that need to be implemented
  • Classes from the package java.util.function don't have their typings generated, as function is a reserved keyword in TypeScript and JavaScript
  • Classes returning values of Type in the package java.util.function will return any instead
  • Classes using methods with parameters of Type in the package java.util.function will take any instead
  • Classes implementing java.util.Iterator, android.animation.TypeEvaluator, java.lang.Comparable do not implement those interfaces in the generated definitions for compatibility-related issues

Generate definitons for Android SDK

cd dts-generator
gradlew jar
java -jar build\libs\dts-generator.jar -input %ANDROID_HOME%\platforms\android-<Platform Level (21/22/23/24)>\android.jar

Generate definitions for any Jar

cd dts-generator
gradlew jar
java -jar build\libs\dts-generator.jar -input <Path to your Jar>

Pass multiple jars to generator

cd dts-generator
gradlew jar
java -jar build\libs\dts-generator.jar -input <jar1> <jar2> <jar3>

Generate definitions for .aar

Open the .aar archive
Extract the classes.jar and any dependencies it may have inside libs/
Rename classes.jar if necessary
java - jar build\libs\dts-generator.jar -input classes.jar dependency-of-classes-jar.jar

android-dts-generator's People

Contributors

panayotcankov avatar petekanev avatar plamen5kov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.