使用以下代碼,any如果可能的話,我將如何替換 s 。我想刪除 TS 中的警告“任何意外。指定不同的類型”interface Props { isPrime: boolean;}interface Other { isEdit: boolean;}type TFunc = (a: any, b: any) => any;const myFunc = (c: TFunc) => (a: any) => (b: any) => c(a, b);const funcA = myFunc((props: Props, other: Other) => { // ..somecode}// Code to call the func A result ect.
不確定如何推斷函數參數類型
明月笑刀無情
2023-09-21 16:40:33