You can return either a PHPDocumenter type or a TypeScriptType instance for TypeScript specific types. In a later step of generting the TypeScript definition, each property type will be converted into a string.
Since any type can exist of arrays, compound types, nullable types, and more, you'll sometimes need to walk (or loop) over these types to specify types case by case. This can be done by including the ProcessesClassProperties trait into your ClassPropertyProcessor.
This trait will add a walk method that takes an initial type and closure.
Let's say you have a compound type like string|bool|int. The walk method will run a string, bool and int type through the closure. You can then decide a. type to be returned per type. Finally, the updated compound type will also be passed to the closure. This gives you the opportunity to remove the type by returning null.
Let's take a look at an example where we only keep string types and remove any others: