ts_interop 0.1.0 copy "ts_interop: ^0.1.0" to clipboard
ts_interop: ^0.1.0 copied to clipboard

Creates Dart interop types for JavaScript based on TypeScript declaration files.

ts_interop #

Creates Dart interop types for JavaScript based on TypeScript declaration files.

Introduction #

  • Read TypeScript AST of a .d.ts file and write it as a JSON structure (done in ts-ast-export).
  • Read JSON structure in Dart to a tree of TsNode objects.
  • Sanitize the tree to fix types not mappable to the Dart type system.
  • Transpile tree to a tree of DartNode objects.
    • Mostly Spec objects from the code_builder package.
  • Write Dart source to an output file.

Command line interface #

This packages provides the cli command tsigen. Install this packages globally to activate the command in your terminal.

dart pub global activate ts_interop

Using this package as a dependency #

If the cli tool does not provide enough features, you can use it as a dependency.

Roadmap #

0
likes
120
points
156
downloads

Publisher

unverified uploader

Weekly Downloads

Creates Dart interop types for JavaScript based on TypeScript declaration files.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

args, binary_tree, built_collection, code_builder, dart_style, es2023, html, http, package_config, path, web, yaml

More

Packages that depend on ts_interop