我具有功能接口:
interface FunctionType {
(param: string): number
}
然后我创建此接口的实现:
const Function: FunctionType = (param: string) => {
// ...
}
export default Function
是否可以在不创建变量/常量的情况下指定函数类型?
// Parameter has wrong type, but there is no error, because this function has no FunctionType interface.
export default (param: number) => {
}