有一个用于进程的枚举。它们有不同的步骤,也被表示为枚举,如下所示。console.log('step number of C', getStepNumber(Process.Simple, AdvancedStep.C)); 正如您在代码示例中看到的,是否可以防止在使用泛型的编译时以错误的步骤调用函数
在TypeScript中,有没有办法键入以下fn函数,以便TypeScript仍然知道result的类型是'hello' const hello = 'hello' // hello is of type'hello'
const result = fn(hello) // result is of type unknown 对于泛