title: How to use moment-duration-format in TypeScript?
body: <p>I am using moment.js in my TypeScript (Ionic2/Angular2) project. Following on from <a href="https://stackoverflow.com/questions/43042337/how-to-format-decimal-hours-greater-than-24-hours-into-hours-minutes-in-javascri">this post</a>, I now want to try out a plugin <a href="https://github.com/jsmreese/moment-duration-format" rel="noreferrer">moment-duration-format</a></p>
  
  <p>I have the npm package and the type definition and am able to use by import as..</p>
  
  <pre><code>import moment from 'moment';
  ...
  let duration = moment.duration(decimalHours, 'hours');
  </code></pre>
  
  <p>I now want to use <a href="https://github.com/jsmreese/moment-duration-format" rel="noreferrer">moment-duration-format</a></p>
  
  <p>I have installed via <code>npm install moment-duration-format --save</code> and then the type definition via <code>npm i @types/moment-duration-format --save</code>.</p>
  
  <p>I can see both npm modules.</p>
  
  <p>As always, there is always some mystery on how to use such type definitions (the useage including import never seems to be in any doco).</p>
  
  <p>I have tried adding <code>import 'moment-duration-format';</code>, <code>import duration from 'moment-duration-format';</code> (moment-duration-format/index.d.ts' is not a module.)</p>
  
  <p>I get an error when trying to use as follows..</p>
  
  <pre><code>let dd = moment.duration.format(400.99, 'hours').format('D:HH:mm');
  
  // (TS error [ts] Property 'format' does not exist on type '(inp?: DurationInputArg1, unit?: DurationConstructor) =&gt; Duration'.
  </code></pre>
  
  <p>Does anyone have any idea on how to use this in <em>TypeScript</em>.</p>
  
  <p>Thanks in advance</p>