Given the following type:
type Fn = () => Record<"A" | "B", boolean>;
I want to enforce the following typing:
const fn: Fn = () => ({
A: true,
B: true,
// @ts-expect-error C should throw an error
C: false
})
I was wondering if there's a way I could enforce typescript to accept only the exact return type and no more than that.