I'm reading through this documentation trying to understand the purpose of TypeScript
The stackoverflow documentation has a nice overview on how to install declaration libraries.
For moment specifically, you will just have to run
typings install --global dt~moment ("install the global declaration file of moment from the source Definitely Typed").
The reason you need a declaration file, is because the external library is probably not written in typescript. As a result, you have to define what the api of the library looks like, so typescript knows roughly what is available.
The easiest declaration file would look something like this:
declare module 'moment'
This will allow you to use the moment library however you want, but you won't have any of the juicy autocomplete or typechecking available for any of the functions of this library. However, typechecking for an external module is extremely helpful, as you probably aren't very familiar with the api, compared to the code you wrote yourself.