ts_definition

Use the TypeScriptDefinitionTranspilerBuilder found in
package:ts_definition/builder.dart.

I don't expect this library to be 100% perfect, but it was capable of
generating automatic, serializable Dart files for the entire
Language Server Protocol.
This should be a good bet for many projects.

1. Depend on it

Add this to your package's pubspec.yaml file:

dependencies:
ts_definition: "^1.0.0-beta"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get.
Check the docs for your editor to learn more.