title: convert javascript to dart
body: <p>I am reading <code>
  To leverage one of the many existing libraries written in JavaScript, use package:js. If a TypeScript type definition file exists for a JavaScript library (see DefinitelyTyped for more info), you can use the js_facade_gen tool to generate Dart code for that library.</code> from <a href="https://webdev.dartlang.org/guides/web-programming" rel="nofollow noreferrer">https://webdev.dartlang.org/guides/web-programming</a>.</p>
  
  <p>I am curious how convert <a href="http://www.chartjs.org/" rel="nofollow noreferrer">javascript library</a> to <a href="https://github.com/google/chartjs.dart/blob/master/lib/chartjs.dart" rel="nofollow noreferrer">dart file</a> in the example <a href="https://github.com/google/chartjs.dart" rel="nofollow noreferrer">https://github.com/google/chartjs.dart</a>. I guess there are two steps: 1, generate <code>TypeScript type definition file</code> (ts file) from the javascript library; 2, Use <a href="https://github.com/dart-lang/js_facade_gen" rel="nofollow noreferrer">js_facade_gen</a> to convert ts file to dart.</p>
  
  <p>I hope get more details. but the document is lacking. Any hints welcomed. Thanks</p>