Is it possible in TypeScript to ensure that objValidator has the same keys as the obj it validates, with different key values? Any suggestions on how I can achieve this requirement? Specifically, the obj and objValidator should share identical keys.
I want to be notified if my objValidator does not possess the exact same keys as the obj.
interface obj {
alpha: number
beta: string
}
interface objValidator {
alpha: {
message: string
valid(ALPHA'S TYPE): boolean
}
beta: {
message: string
valid(BETA'S TYPE): boolean
}
}