Type alias SameShape<Out, In>

SameShape<Out, In>: In & {
    [Key in Exclude<keyof In, keyof Out>]: never
}

This is a TypeScript type-level function which replaces any keys in "In" that aren't in "Out" with "never". We use this to reject properties with typos in object literals. See: https://stackoverflow.com/questions/49580725

Type Parameters

  • Out
  • In extends Out