Schema.org Enumerations in TypeScript
JSON-LD Logo in Public Domain.Last time, we talked about
modeling the Schema.org class hierarchy in TypeScript.
We ended up with an elegant, recursive solution that treats any type Thing
as
a "@type"
-discriminated union of ThingLeaf
and all the direct sub-classes of
the type. The next challenge in the journey of building TypeScript typings for
the Schema.org vocabulary is modeling
Enumerations.
Let’s look at a few examples from the Schema.org website to get a better sense of what Enumerations look like.
Read more →