JSON-LD TypeScript types for Schema.org vocabulary
Switch branches/tags
Nothing to show
Clone or download
Eyas Merge pull request #5 from Eyas/nicer-comments
Properly parse comments from HTML to jsdoc
Latest commit 6891aa1 Dec 12, 2018

README.md

Build Status schema-dts npm version schema-dts-gen version

schema-dts

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.

Example of Code Completion using schema-dts

This repository contains two NPM packages:

  • schema-dts-gen Providing a command-line tool to generate TypeScript files based on a specific Schema version and layer.
  • schema-dts Pre-packaged TypeScript typings of latest Schema.org schema, without pending and other non-core layers.

Note: This is not an officially supported Google product.

Usage

To use the typings for your project, simply add the schema-dts NPM package to your project:

npm install schema-dts

Then you can use it as follows:

Manually using the Schema Typings generator

npm install schema-dts-gen
npx schema-dts-gen --schema=3.4

Developers

Use NPM to install dependencies:

npm install

Use Gulp to build the package:

gulp generate-ts

or simply build the schema-dts generator:

gulp build-generator

To contribute changes, see the CONTRIBUTING.md file.