【发布时间】:2021-04-05 21:22:22
【问题描述】:
我想确保我的输入只接受下面的函数作为参数:
async getAll<T extends Entity>(url: string, params?: any): Promise<T[]> {
// func body
}
我的功能:
setFunc(getAllFunc: any){
this.func = getAllFunc;
}
我想用自定义类型替换any。
提前致谢。
【问题讨论】:
标签: typescript types typescript-typings