So I'm just playing with types in typescript. I'd like to use a type that accepts any type that has only one property (with any type, and any name).
const myWeirdMethod = <T>(t:TypeWithOnlyOneField<T>)=> {
let numFields = 0
for(const key in t){
numFields++
}
assert(numFields === 1)
}