[TypesScript V4] ${X | Y} - ${W | Z}

type Corner = `${'top' | 'bottom'} - ${'left' | 'right'}`

type Corner = Capitalize<`${'top' | 'bottom'} - ${'left' | 'right'}`>
// "Top - left" | "Top - right" | "Bottom - left" | "Bottom - right"

 

posted @ 2022-08-22 16:01  Zhentiw  阅读(31)  评论(0)    收藏  举报