Re:TypeScript’s quirks: How inconsistencies make the languag...
by yawaramin on Friday January 31, 2020 @11:30PM
(#22208667)
My advice is bite the bullet and just write a JSON Schema for the interface and use ajv[1] to check it. Keep the interface, the JSON Schema, and the validator function (which should be a type guard[2] to take full advantage of TypeScript) in the same module for easier maintenance.
[1] https://github.com/epoberezkin/ajv
[2] https://www.typescriptlang.org/docs/handbook/advanced-types....