rsek / datasworn

The successor to the original Datasworn repository and Dataforged package, which provide game rules from the Ironsworn and Ironsworn: Starforged TTRPGs in JSON.
https://ko-fi.com/r_sek
120 stars 26 forks source link

Express type inheritance and generic type parameters in generated Typescript code #63

Open rsek opened 4 days ago

rsek commented 4 days ago

Internally, the JSON schema (which is the source of truth for all typings) is composed in ways that parallel common OOP patterns like class inheritance and generic type parameters.

This information could be attached as a symbol property during TypeBox composition. Ideally, it will be expressed in a language-agnostic way; for the time being it would just be used for TS types, but it may be useful for Python, too (see #62).