文字列リテラル型かどうかの判定
code:ts
type IsStringLiteralType<S extends string> = string extends S ? false : true
// examples
type T1 = IsStringLiteralType<'a'> // true
type T2 = IsStringLiteralType<'x' | 'y'> // true
type T3 = IsStringLiteralType<string> // false