The updated antlr4 runtime code for Typescript still requires you to import and use types from antlr4 package, which means you need to be careful to keep the versions in sync. It also complicates matters if using multiple parsers that require different antlr4 versions.
This is less of an issue with Java, where (assuming only 1 parser) the correct dep is on the classpath and you don't necessarily need to declare which version you depend on, you can just import directly.
To solve this issue - try to create some type Apex... types for common cases to make the import experience more streamlined. Could also introduce a factory type to make creating a parser, tokenstreams etc single method call depending on your requirements.
The updated antlr4 runtime code for Typescript still requires you to import and use types from
antlr4package, which means you need to be careful to keep the versions in sync. It also complicates matters if using multiple parsers that require different antlr4 versions.This is less of an issue with Java, where (assuming only 1 parser) the correct dep is on the classpath and you don't necessarily need to declare which version you depend on, you can just import directly.
To solve this issue - try to create some
type Apex...types for common cases to make the import experience more streamlined. Could also introduce a factory type to make creating a parser, tokenstreams etc single method call depending on your requirements.