MakeTypes generates TypeScript classes that parse and typecheck JSON objects at runtime, and let you statically type check code that interacts with JSON objects. All it requires is a set of JSON samples.
Want to run MakeTypes as part of a build process? npm i -g maketypes installs the command line tool maketypes.
Enter a single JSON object or an array of JSON objects.
Use these if you want to statically type check interactions with JSON objects without runtime type checks.
Use these if you want to statically type check interactions with JSON objects with runtime type checks.
Proxy classes generated with MakeTypes will parse your JSON and check that it matches the expected type at runtime.
Proxy objects generated with MakeTypes are expressed as TypeScript classes, so you can statically type check that your code is appropriately accessing fields on the JSON object. Code against web services with confidence!
Don't want the overhead of runtime type checking, and trust that your samples are representative? Or perhaps you are reluctant to manually create TypeScript typings for your web service? MakeTypes can generate TypeScript interfaces, which describe the expected structure of the JSON object and facilitate static type checking.