JSON-typescript
TypeScript type information for compile-time validation of JSON objects.
How to use this
- Install this package
npm install --save-dev json-typescript
- Import this package
import * as _JSON from 'json-typescript';
- Check to see if json types are validated correctly
import * as { Value as JSONValue, Object as JSONObject } from 'json-typescript';
let doc: JSONValue = {
data: {
type: 'articles',
id: '1'
}
};
let doc: JSONValue = {
foo() {
return bar;
}
};
let doc: JSONObject = [];
Copyright
© 2018 Mike North, All Rights Reserved.