Created
January 4, 2018 09:42
-
-
Save Quramy/48f30d06cb4cb06a622783045dd22ad7 to your computer and use it in GitHub Desktop.
Generate .d.ts from JSON schema using @ngtools/json-schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SchemaClassFactory } from '@ngtools/json-schema'; | |
// Input JSON schema json file | |
const factory = SchemaClassFactory<any>(require('@angular/cli/lib/config/schema.json')); | |
const schemaClass = new factory(null); | |
// Output .d.ts | |
console.log(schemaClass.$$serialize('text/x.dts')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment