How do make typescript understand a factory function that returns dynamic class definitions? I’m working on a project that uses both Angular v16 and ngxs v18.0.