import { Color, colors } from '@material-ui/core'; type KeysEquivalent = keyof T extends keyof U ? keyof U extends keyof T ? true : false : false; function colorTypeMatches(variants: keyof Color) { // Checking that each color has the exact shape as Color // we don't use the Color type for these to provide JSDOC for each color // in which we preview the color const amber: KeysEquivalent = true; const blue: KeysEquivalent = true; const blueGrey: KeysEquivalent = true; const brown: KeysEquivalent = true; // common does not have the `Common` type (nice pun) // const common: KeysEquivalent = true; const cyan: KeysEquivalent = true; const deepOrange: KeysEquivalent = true; const deepPurple: KeysEquivalent = true; const green: KeysEquivalent = true; const grey: KeysEquivalent = true; const indigo: KeysEquivalent = true; const lightBlue: KeysEquivalent = true; const lightGreen: KeysEquivalent = true; const lime: KeysEquivalent = true; const orange: KeysEquivalent = true; const pink: KeysEquivalent = true; const purple: KeysEquivalent = true; const red: KeysEquivalent = true; const teal: KeysEquivalent = true; const yellow: KeysEquivalent = true; }