import { Record, Number, Static } from 'runtypes'; export const Thing = Record({ thing: Number }); export type Thing = Static<Thing>;
import { Thing } from './thing'; function (thing: Thing) { if (Thing.guard(thing)) { console.log('we have a thing!'); } }