Dealing with an array that contains elements which can either be arrays themselves (recursively) or strings has proven to be a bit tricky. My attempt to create a type definition for this has resulted in the compiler flagging it as a circular reference.
So, my question is: How do I go about creating a type alias that can handle this scenario without running into issues related to circular referencing?
type Foo = Array<Foo | string>
The challenge I am facing has been discussed on Stack Overflow: Type alias circularly references itself. However, the solutions provided there have not fully addressed my specific problem.