【发布时间】:2021-11-04 09:13:57
【问题描述】:
我在 Typescript 中编写了一个小辅助函数,但收到错误消息 A spread argument must either have a tuple type or be passed to a rest parameter.ts(2556)
export type TDemethodise = (f: Function) => (...args: any[]) => void
export const demethodise: TDemethodise = (fn) => (...args): void => fn.bind(...args);
我很不确定是否要输入这个。是否可以在不大量更改功能的情况下键入它?
【问题讨论】:
标签: typescript args spread-syntax