How to add plugin to moment.js?

Hi,
I would like to add moment-timer plugin (https://github.com/SeverinDK/moment-timer) to my project
where i using moment.js.
I installed plugin moment-timer in path
’…\project_name\node_modules\moment’ with npm (npm install moment-timer -save) where is placed package.json file for moment.js.
Dependencie was added correctly.
Basic version of moment.js works fine.
But when i try to use basic moment-timer function, for example:

var timer = moment.duration(5, "seconds").timer(function() { 
  // Callback 
});

i get error “Property ‘timer’ does not exist on type ‘Duration’”.
It seems that environment can’t ‘see’ moment-timer plugin.
Should i add some extra import (i’m using “import * as moment from ‘moment’;” for moment.js)?
I tried add “import ‘moment-timer’;” but didn’t work.
Any tips?

I would ditch moment and just use RxJS’s interval operator for this.

Maybe you’re right and RxJS would be better, but I already use moment.js in my project.
I just want to add this plugin (moment-timer) and check his features.
When i will have some time i will test RxJS.
Thanks for your answer.

Hi.
Did you figure out how to import it?

Hi,
no, I didn’t. I just did it in a different way (without moment.js plugins).