JSONAPI-typescript
TypeScript type information for compile-time validation of JSON:API documents. Supports TS 2.3 and above.
How to use this
- Install this package
npm install --save-dev jsonapi-typescript
- Import this module
import * as JSONAPI from 'jsonapi-typescript';
- check to see if json types are validated correctly
import * as JSONAPI from 'jsonapi-typescript';
let doc: JSONAPI.Document = {
data: {
type: 'articles',
id: '1'
}
};
let doc: JSONAPI.Document = {
result: "Success!"
};
let doc: JSONAPI.Document = [];
Copyright
© 2017 Mike North, All Rights Reserved.