Coder Social home page Coder Social logo

ts2kt's Introduction

TeamCity (simple build status)

Description

Converter of TypeScript definition files to Kotlin declarations

This requires Kotlin 1.1.x to run. It generates Kotlin files that are compatible with Kotlin 1.1+.

How to use

The simplest way to use is install the latest version form npm:

npm install -g ts2kt

Usage

ts2kt [<options>] <d.ts files>

Where possible options include:
-d <path> Destination directory for files with converted declarations, current directory is used by default
-h Print a synopsis of standard options
-X Print a synopsis of advanced options

How to setup project

  1. clone this project
git clone <this project url>
  1. get submodules (https://github.com/DefinitelyTyped/DefinitelyTyped)
git submodule init
git submodule update
  1. install dependencies
  • using installed node.js:
npm install
  • without installing node.js:
ant -f build.xml update.tools
ant -f build.xml update.node.modules
  1. setup path to node interpreter in IDEA (Languages & Frameworks | Node.js and NPM)

  2. Convert the tool to Javascript. One way is to open the project in IntelliJ and build the project (e.g. Ctrl+Shift+F9).

  3. (optional) Run the unit tests

ant -f build.xml run.test.for.testData
  1. Run the tool in one of these ways:
  • Run it with node.js (Note: the root of the project should be working dir):

    node out/production/ts2kt/ts2kt.js path/to/input.d.ts path/to/output.kt
  • Directly call translateToFile_puj7f4$ from JS (translateToFile in code).

  • Create run configuration like shared jq and run it.

How to update submodules
git submodule update --remote

Useful links

ts2kt's People

Contributors

bashor avatar epabst avatar erokhins avatar ilya-g avatar dzharkov avatar udalov avatar abreslav avatar yole avatar

Watchers

James Cloos avatar Ilia Malanin 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.