The current release of Lyra is treating the trie structure as a tree (of course), but we're planning to start approaching it as a graph for the exact reason you're mentioning. We don't have performance comparisons yet, but we'll document everything
Lyra author here: I wouldn't compare it with other JS search engines for a simple reason: we'll be targeting edge execution (Cloudflare workers, lambda@edge, etc.), so the focus is really different
The biggest problem I have with TypeScript is to know WHAT .ts files will be compiled into. I.e., if you're using enums or decorators, there's no plain support for them in JS so you'll end up having some kind of "polyfills", which are not so optimized.
Once you analyze your compiled JS, you can write TS knowing what you're gonna get, which is the trick to make it optimized.