schema-dts0.3.1 • Public • Published
JSON-LD TypeScript types for Schema.org vocabulary.
schema-dts provides TypeScript definitions for Schema.org vocabulary in JSON-LD format. The typings are exposed as complete sets of discriminated type unions, allowing for easy completions and stricter validation.
Note: This is not an officially supported Google product.
To use the typings for your project, simply add the
schema-dts NPM package to
npm install schema-dts
Then you can use it by importing
Defining Simple Properties
JSON-LD requires a
"@context" property to be set on the top-level JSON object,
to describe the URIs represeting the types and properties being referenced.
schema-dts provides the
WithContext<T> type to facilitate this.