[dart2js] Produce TypeScript type annotations for compiled files #48947
Labels
area-web-js
Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.
closed-duplicate
Closed in favor of an existing report
web-js-interop
Issues that impact all js interop
Dart as of now supports web by using AOT and JIT compiling. The AOT compiler already produces proper source maps.
I would like to propose to extend this to TypeScript-compatible type annotations too.
By using the
allowInterloop
function fromdart:js
, it is already possible to interloop a compiled dart library by native JS. Unfortunately, this is not easily implementable with TypeScript because all members are eitherany
(dynamic
) or the developers are required to manually create a.d.ts
file for type annotations.I would propose to either add a compiler option to produce corresponding
.d.ts
files (likely) or to add a two-stage compiler option compiling to TypeScript instead of ECMA script (unlikely).As both Dart and TypeScript have a similar typing system, the effort should be comparably low.
The text was updated successfully, but these errors were encountered: