summary
- With named types like interface, tree definitions, etc. could be done before.
- Since 3.7, type alias can be done in some cases.
- But we can’t define recurrently in the way we wanted to do it this time.
- You can’t even make it an INTERFACE.
- Resolution Create natural numbers with TypeScript types.
I just wanted to add… ts
https://stackoverflow.com/questions/36966444/how-to-create-a-circularly-referenced-type-in-typescript https://github.com/microsoft/TypeScript/pull/33050 TypeScript In 3.7 ts
ts
This page is auto-translated from /nishio/TypeScriptは型を再帰的に定義できない? using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I’m very happy to spread my thought to non-Japanese readers.