Combination key type
约 135 字小于 1 分钟
2026-02-11
题目
- 把多个修饰键两两组合,但不可以出现相同的修饰键组合。
- 提供的
ModifierKeys中,前面的值比后面的值高,即cmd ctrl是可以的,但ctrl cmd是不允许的。
解题思路
待补充
答案
// 实现 Combs
type Combs<T extends any[]> = any验证
import type { Equal, Expect } from '@type-challenges/utils'
type ModifierKeys = ['cmd', 'ctrl', 'opt', 'fn']
type CaseTypeOne = 'cmd ctrl' | 'cmd opt' | 'cmd fn' | 'ctrl opt' | 'ctrl fn' | 'opt fn'
type cases = [
Expect<Equal<Combs<ModifierKeys>, CaseTypeOne>>,
]参考
无
