Typescript: How to say a variable is of type moment?

Viewed 6222

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?

2 Answers
Related