I have an interface which has a callback and it takes two parameters which are moment object. Here is how it looks like
interface IProps {
callback: (startDate: any, endDate: any) => void
}
This is working for me but I want to be more specific and say that they are not any but moment like so which results in an error:
interface IProps {
callback: (startDate: moment, endDate: moment) => void
}
How can I fix this?
According to moment.d.ts
import * as moment from 'moment';
interface IProps {
callback: (startDate: moment.Moment, endDate: moment.Moment) => void
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With