我有一个接口,它有一个回调函数,并且需要两个参数,这两个参数都是moment对象。以下是示例代码:
我该如何解决这个问题?
interface IProps {
callback: (startDate: any, endDate: any) => void
}
这对我来说是有效的,但我想更具体地说,它们不是任何时刻,而是像这样的时刻,这会导致错误:
interface IProps {
callback: (startDate: moment, endDate: moment) => void
}
我该如何解决这个问题?